walletsCreateWithHttpInfo method
Future<Response>
walletsCreateWithHttpInfo({
- WalletCreateRequest? walletCreateRequest,
- Future<
void> ? abortTrigger,
Create a wallet
Creates an empty wallet in a currency the partner has no wallet in yet. Take currencyId from GET currencies. The new wallet starts with a zero balance. Without a label it is named after its currency, for example USD wallet. The partner's first wallet is always selected; for a later one, isSelected: true makes it the selected wallet in place of the current one. Returns 201 without a body; list the wallets to read it. A second wallet in the same currency returns 400 with code 17000 (WALLET_CURRENCY_ALREADY_EXISTS); a label already used by another of the partner's wallets, ignoring case, returns 400 with code 17001 (WALLET_LABEL_ALREADY_EXISTS).
Note: This method returns the HTTP Response.
Parameters:
- WalletCreateRequest walletCreateRequest: The wallet to create.
Implementation
Future<Response> walletsCreateWithHttpInfo({ WalletCreateRequest? walletCreateRequest, Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final path = r'/api/v1/b2b/wallets';
// ignore: prefer_final_locals
Object? postBody = walletCreateRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json', 'text/json', 'application/*+json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}