- Timing. For example, a pre-defined, fixed schedule for top-ups.
- The amount of funds available on the balance account. For example, a minimum amount that must always remain on the balance account.
Requirements
Sweeps
A sweep is a configuration on your user’s balance account that allows you to push or pull funds from your user’s verified transfer instrument based on a pre-defined schedule and/or amount. This affects the balance in your user’s balance account. When you configure a sweep for a balance account, you must determine the sweep type, the sweep conditions, and the sweep amount:- Sweep type: dictates the direction of the funds transfer in relation to your user’s balance account. For scheduled top-ups, the direction is set to pull, in order to pull funds in to the balance account from a transfer instrument that you specify.
- Sweep conditions: dictates the conditions that must be met for a sweep to be triggered. For example, you can trigger sweeps according to a fixed schedule, or you can configure a trigger amount based on the account’s available balance. By configuring a trigger amount for a pull sweep, you can always maintain a certain minimum balance on your user’s balance account
- Sweep amount: the amount of the funds being transferred.
How it works
- You determine the conditions and amount for the pull sweep to your user’s balance account.
- You create a pull sweep for your user’s balance account using the Configuration API.
- Adyen sends a balancePlatform.balanceAccountSweep.created webhook to your server to inform you of the status of the sweep you created.
- When the conditions for the sweep are met, Adyen initiates an incoming transfer (top-up) to your balance account for the specified sweep amount.
- Adyen sends transfer and transaction webhooks to your server to inform you about the status of the incoming transfer (top-up).
Create a pull sweep
-
To create a sweep, make a POST /balanceAccounts/{balanceAccountId}/sweeps request with the ID of the balance account in the path, and the following parameters in the request body.
Here’s an example of creating a pull sweep to top up a balance account from a transfer instrument if the balance drops below EUR 5,000. Create a pull sweep
curl
Java
PHP
C#
NodeJS (JavaScript)
Go
Python
Ruby
NodeJS (TypeScript)
-
In the response, note the sweep’s unique identifier.
By default, sweeps are created with an active status. You can change it by sending an updated status in a PATCH /balanceAccounts/{balanceAccountId}/sweeps/{sweepId} request.
Response - sweep created
- Listen to the balancePlatform.balanceAccountSweep.created webhook, which Adyen sends to your server when you successfully create a sweep.
