(wallets().v1())
Confirm a hold
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.ConfirmHoldRequest;
import com.formance.formance_sdk.models.operations.ConfirmHoldResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
import java.math.BigInteger;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
ConfirmHoldRequest req = ConfirmHoldRequest.builder()
.holdId("<id>")
.confirmHoldRequest(com.formance.formance_sdk.models.shared.ConfirmHoldRequest.builder()
.amount(new BigInteger("100"))
.final_(true)
.build())
.build();
ConfirmHoldResponse res = sdk.wallets().v1().confirmHold()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
ConfirmHoldRequest |
✔️ |
The request object to use for the request. |
ConfirmHoldResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Create a balance
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.CreateBalanceRequest;
import com.formance.formance_sdk.models.operations.CreateBalanceResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
CreateBalanceRequest req = CreateBalanceRequest.builder()
.id("<id>")
.build();
CreateBalanceResponse res = sdk.wallets().v1().createBalance()
.request(req)
.call();
if (res.createBalanceResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
CreateBalanceRequest |
✔️ |
The request object to use for the request. |
CreateBalanceResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Create a new wallet
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.CreateWalletRequest;
import com.formance.formance_sdk.models.operations.CreateWalletResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
CreateWalletRequest req = CreateWalletRequest.builder()
.build();
CreateWalletResponse res = sdk.wallets().v1().createWallet()
.request(req)
.call();
if (res.createWalletResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
CreateWalletRequest |
✔️ |
The request object to use for the request. |
CreateWalletResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Credit a wallet
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.CreditWalletRequest;
import com.formance.formance_sdk.models.operations.CreditWalletResponse;
import com.formance.formance_sdk.models.shared.Monetary;
import com.formance.formance_sdk.models.shared.Security;
import com.formance.formance_sdk.models.shared.WalletSubject;
import java.lang.Exception;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
CreditWalletRequest req = CreditWalletRequest.builder()
.id("<id>")
.creditWalletRequest(com.formance.formance_sdk.models.shared.CreditWalletRequest.builder()
.amount(Monetary.builder()
.amount(new BigInteger("201874"))
.asset("<value>")
.build())
.metadata(Map.ofEntries(
Map.entry("key", "")))
.sources(List.of(
WalletSubject.builder()
.identifier("<value>")
.type("<value>")
.build()))
.build())
.build();
CreditWalletResponse res = sdk.wallets().v1().creditWallet()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
CreditWalletRequest |
✔️ |
The request object to use for the request. |
CreditWalletResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Debit a wallet
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.DebitWalletRequest;
import com.formance.formance_sdk.models.operations.DebitWalletResponse;
import com.formance.formance_sdk.models.shared.Monetary;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
import java.math.BigInteger;
import java.util.Map;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
DebitWalletRequest req = DebitWalletRequest.builder()
.id("<id>")
.debitWalletRequest(com.formance.formance_sdk.models.shared.DebitWalletRequest.builder()
.amount(Monetary.builder()
.amount(new BigInteger("245256"))
.asset("<value>")
.build())
.metadata(Map.ofEntries(
Map.entry("key", "<value>")))
.pending(true)
.build())
.build();
DebitWalletResponse res = sdk.wallets().v1().debitWallet()
.request(req)
.call();
if (res.debitWalletResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
DebitWalletRequest |
✔️ |
The request object to use for the request. |
DebitWalletResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get detailed balance
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.GetBalanceRequest;
import com.formance.formance_sdk.models.operations.GetBalanceResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetBalanceRequest req = GetBalanceRequest.builder()
.balanceName("<value>")
.id("<id>")
.build();
GetBalanceResponse res = sdk.wallets().v1().getBalance()
.request(req)
.call();
if (res.getBalanceResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetBalanceRequest |
✔️ |
The request object to use for the request. |
GetBalanceResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get a hold
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.GetHoldRequest;
import com.formance.formance_sdk.models.operations.GetHoldResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetHoldRequest req = GetHoldRequest.builder()
.holdID("<id>")
.build();
GetHoldResponse res = sdk.wallets().v1().getHold()
.request(req)
.call();
if (res.getHoldResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetHoldRequest |
✔️ |
The request object to use for the request. |
GetHoldResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get all holds for a wallet
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.GetHoldsRequest;
import com.formance.formance_sdk.models.operations.GetHoldsResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetHoldsRequest req = GetHoldsRequest.builder()
.cursor("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==")
.metadata(Map.ofEntries(
Map.entry("admin", "true")))
.pageSize(100L)
.walletID("wallet1")
.build();
GetHoldsResponse res = sdk.wallets().v1().getHolds()
.request(req)
.call();
if (res.getHoldsResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetHoldsRequest |
✔️ |
The request object to use for the request. |
GetHoldsResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.GetTransactionsRequest;
import com.formance.formance_sdk.models.operations.GetTransactionsResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetTransactionsRequest req = GetTransactionsRequest.builder()
.cursor("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==")
.pageSize(100L)
.walletID("wallet1")
.build();
GetTransactionsResponse res = sdk.wallets().v1().getTransactions()
.request(req)
.call();
if (res.getTransactionsResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetTransactionsRequest |
✔️ |
The request object to use for the request. |
GetTransactionsResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get a wallet
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.GetWalletRequest;
import com.formance.formance_sdk.models.operations.GetWalletResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetWalletRequest req = GetWalletRequest.builder()
.id("<id>")
.build();
GetWalletResponse res = sdk.wallets().v1().getWallet()
.request(req)
.call();
if (res.getWalletResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetWalletRequest |
✔️ |
The request object to use for the request. |
GetWalletResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get wallet summary
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.GetWalletSummaryRequest;
import com.formance.formance_sdk.models.operations.GetWalletSummaryResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
GetWalletSummaryRequest req = GetWalletSummaryRequest.builder()
.id("<id>")
.build();
GetWalletSummaryResponse res = sdk.wallets().v1().getWalletSummary()
.request(req)
.call();
if (res.getWalletSummaryResponse().isPresent()) {
// handle response
}
}
}
GetWalletSummaryResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
List balances of a wallet
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ListBalancesRequest;
import com.formance.formance_sdk.models.operations.ListBalancesResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
ListBalancesRequest req = ListBalancesRequest.builder()
.id("<id>")
.build();
ListBalancesResponse res = sdk.wallets().v1().listBalances()
.request(req)
.call();
if (res.listBalancesResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
ListBalancesRequest |
✔️ |
The request object to use for the request. |
ListBalancesResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
List all wallets
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.ListWalletsRequest;
import com.formance.formance_sdk.models.operations.ListWalletsResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
ListWalletsRequest req = ListWalletsRequest.builder()
.cursor("aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==")
.expand("balances")
.metadata(Map.ofEntries(
Map.entry("admin", "true")))
.name("wallet1")
.pageSize(100L)
.build();
ListWalletsResponse res = sdk.wallets().v1().listWallets()
.request(req)
.call();
if (res.listWalletsResponse().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
ListWalletsRequest |
✔️ |
The request object to use for the request. |
ListWalletsResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Update a wallet
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.UpdateWalletRequest;
import com.formance.formance_sdk.models.operations.UpdateWalletResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
UpdateWalletRequest req = UpdateWalletRequest.builder()
.id("<id>")
.build();
UpdateWalletResponse res = sdk.wallets().v1().updateWallet()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
UpdateWalletRequest |
✔️ |
The request object to use for the request. |
UpdateWalletResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Cancel a hold
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.VoidHoldRequest;
import com.formance.formance_sdk.models.operations.VoidHoldResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
VoidHoldRequest req = VoidHoldRequest.builder()
.holdId("<id>")
.build();
VoidHoldResponse res = sdk.wallets().v1().voidHold()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
VoidHoldRequest |
✔️ |
The request object to use for the request. |
VoidHoldResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get server info
package hello.world;
import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.WalletsErrorResponse;
import com.formance.formance_sdk.models.operations.WalletsgetServerInfoResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws WalletsErrorResponse, Exception {
SDK sdk = SDK.builder()
.security(Security.builder()
.clientID("<YOUR_CLIENT_ID_HERE>")
.clientSecret("<YOUR_CLIENT_SECRET_HERE>")
.build())
.build();
WalletsgetServerInfoResponse res = sdk.wallets().v1().walletsgetServerInfo()
.call();
if (res.serverInfo().isPresent()) {
// handle response
}
}
}
WalletsgetServerInfoResponse
Error Type |
Status Code |
Content Type |
models/errors/WalletsErrorResponse |
default |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |