Requirements
Before you initiate a cashout, take into account the following requirements.How it works
To make a cashout request:- (Recommended) Check whether the transfer instrument supports instant payouts: Calculate a transfer route for the transfer instrument.
- (Recommended) Get the pending available balance on the user’s balance account: Ensure that your user has enough funds for the cashout.
- Initiate the cashout: Specify the details of the cashout in an API request.
- Get updates on the status of the cashout: Listen to webhooks to check the status of the cashout.
(Recommended) Check whether the transfer instrument supports instant payouts
Before you initiate a cashout for a user, we recommend that you check whether the counterparty bank supports instant payouts. This reduces the risk of failed cashouts. To check whether the transfer instrument supports instant payouts:-
Make a POST /transferRoutes/calculate request, specifying the following parameters:
The following code shows an example of this request. Example request—Calculate the available transfer routes for a transfer instrument
- In the response, verify that you receive an object with the transferRoutes.priority set to instant.
(Recommended) Get the pending available balance on the balance account
Before you initiate a cashout for a user, we recommend that you get the pending available balance on the user’s balance account. By doing this, you can:- Show to your users the balance that is available for cashouts. This helps your users know the maximum amount that they can ask for.
- Check that the amount that your user is asking for is less than or equal to the pending available balance.
- Make a GET /balanceAccounts/{id} request.
- In the response, note the value of the balances.pendingAvailable parameter.
Initiate a cashout
To initiate a cashout:-
Make a POST /cashouts request and specify the following parameters in the request body:
The following example shows a cashout request for EUR 1000, with a fee of EUR 10. Initiate a cashout request
-
If the request succeeds, note the following response parameters, which help you identify cashout-related transfers:
The following example shows a successful response for a created cashout. Response for a created cashout
Get updates on the status of the cashout
A cashout involves multiple funds transfers, which you can track by listening to webhooks. Webhooks inform you about any status change in the transfers, and whether the transfers succeed or fail. Adyen sends three types of webhooks for each transfer:- balancePlatform.transfer.created, which informs your server that funds will be transferred to or from a balance account in your platform.
- balancePlatform.transfer.updated, which informs your server of changes in the status of the transfer.
- balancePlatform.transaction.created, which informs your server when funds have been debited from or credited to a balance account.
- Ensure that your server can receive and accept webhooks.
- Subscribe to Transfer webhooks and Transaction webhooks in your Customer Area.
Troubleshooting
A cashout request can fail because of communication issues with the bank, or because of invalid request parameters. If the cashout request is successful, but the payout to your user’s transfer instrument fails, the cashout request is reversed. This means that:- The cashout amount is returned to the user’s balance account and settled as pending available balance.
- The fee charged to your user is returned to the user’s balance account and settled as pending available balance.
- Your platform is not charged any fees for the failed cashout.
Error responses
If the request fails, you receive an error response with information about the error. Error responses for invalid cashout requests can include the following fields:title: Specifies the type of error.detail: Specifies the cause of the error.invalidFields: Specifies whether one or more fields contain invalid information.
Could not find transfer instrument
title: “The request is missing required fields or contains invalid data”.detail: “Could not find transfer instrument with reference: SE0000000000000000000001”.
transferInstrumentId that you specified:
- Does not exist.
- Does not belong to the same legal entity as the
instructingBalanceAccount.
No instant route found for transfer instrument
title: “The request is missing required fields or contains invalid data”.detail: “No instant route found for transfer instrument id: SE0000000000000000000001”.
transferInstrumentId that you specified. This can happen because, for example:
- The counterparty bank is located in a region where Adyen does not support instant payouts.
- The counterparty bank does not accept the currency of the payout.
- Adyen could not reach the counterparty at the moment of the request.
Invalid amount / Invalid fee amount
title: “Configuration is missing or incorrect”.invalidFields.name: amount or fee.amount.invalidFields.message: “Invalid amount” or “Invalid fee amount”.
Fee amount has a different currency than instruction amount
title: “Configuration is missing or incorrect”.invalidFields.name: fee.amount.currency.invalidFields.message: “Fee amount has a different currency than instruction amount”.
amount.currency and fee.amount.currency have different values.
Solution: Make sure that amount.currency and fee.amount.currency have the same value. Then, retry the request.
**
Minimum required amount not reached
title: “Configuration is missing or incorrect”.invalidFields.name: amount.invalidFields.message: “Minimum required amount not reached”.
Amount exceeds pending balance
title: “The request is missing required fields or contains invalid data”.detail: “Amount exceeds pending balance : EUR 123.45”.
- The cashout amount is higher than the pending available balance.
- The sum of the cashout amount and the fee is higher than the pending available balance.