Wallet

Create a wallet for a user

Changed on

This POST endpoint creates a new wallet for the user with the specified user_token, in the requested currency. <br> To use this endpoint, you need to provide the user_token as a required parameter in the URL Path and the currency_code as a JSON parameter in the Request Body. The currency_code must be an ISO 4217 currency code, such as USD, EUR or MXN. The user must belong to the authenticated client. <br> Optionally, fee_wallet_token nominates one of your client wallets, in the same currency, as the wallet that pays the fees of payouts funded from the new wallet, so the payee receives the full amount. <br> A user can hold at most one wallet per currency, so the operation is idempotent: if the user already has a wallet in the requested currency, that existing wallet is returned unchanged with a 200 status code instead of 201, and its balance reflects the current balance. If the existing wallet has a different fee-paying configuration than the requested fee_wallet_token, the request is rejected with a 409 status code and nothing is changed. <br> Newly created wallets start with a zero balance and can be funded through loads, pay-ins or wallet transfers. The response has the same shape as the wallets returned by the GET operation on this resource.

post/wallet/{user_token}

Request

Headers

Idempotency-Keystring

Unique key to prevent duplicate processing

Request body

currency_codestring required

Currency the wallet is denominated in, using the ISO 4217 format. Case-insensitive.

fee_wallet_tokenstring

Optional. Token of one of your client wallets (clnt_wlt_ prefix) that will pay the fees of payouts funded from the new user wallet, so the payee receives the full amount. The client wallet must be owned by the authenticated client and denominated in the same currency_code as the new wallet. When omitted, the payee pays the fees from the wallet balance.

Example request

{
  "currency_code": "MXN",
  "fee_wallet_token": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574"
}

Response

The user already has a wallet in the requested currency; the existing wallet is returned and nothing is created.

tokenstring required

Prefixed wallet identifier. User wallets use the usr_wlt_ prefix and client wallets use the clnt_wlt_ prefix.

type'USER_FUNDS' | 'CLIENT_FUNDS' required

Type of wallet: USER_FUNDS when created for a user, CLIENT_FUNDS when created for the client account.

user_tokenstring

Token representing the user who owns the wallet. Present only for USER_FUNDS wallets.

currency_codestring required

Currency the wallet balance is stored in, using the ISO 4217 format.

balancenumber required

The wallet's current balance in currency_code. Zero for a newly created wallet.

activeboolean required

An indicator whether the wallet is active.

client_paying_feesboolean required

An indicator whether the fees for payouts using this wallet are paid by a client wallet. If false, the user pays the fees. Always false for CLIENT_FUNDS wallets.

fee_wallet_tokenstring

Token of your client wallet that pays the fees for payouts using this wallet. Present only when client_paying_fees is true and the fee-paying wallet belongs to the authenticated client.

Example response

{
  "token": "usr_wlt_9e5a349e-8d10-4a0b-9d8f-6b3f2a1c4d7e",
  "type": "USER_FUNDS",
  "user_token": "usr_59a9ccce-0280-4207-9200-891c9109915c",
  "currency_code": "MXN",
  "active": true,
  "client_paying_fees": true,
  "fee_wallet_token": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574"
}

Changes