Sweep money from your merchant account
Learn how to automate withdrawals and ensure the funds in your merchant account don't exceed a certain value.
What is sweeping?
Sweeping refers to automatic payments to the business account linked to your merchant account. When funds are swept are based on two criteria:
- Frequency: How often to sweep funds. Can be daily, weekly, or fortnightly.
- Maximum account balance: The balance above which you want to sweep funds.
Once set up, the balance of your merchant account is checked at the frequency you specified. TrueLayer sweeps any funds in excess of your specified maximum account balance to your linked business account.
Sweeping overview
By default, automated sweeping isn't enabled, but you can make ad hoc payouts to the SCAN or IBAN details of your business account. To enable sweeping, you must either:
- Configure your preferences with TrueLayer's sweeping endpoints, as explained on this page.
- Set it up in Console.
Sweeping can be useful if you want to ensure that the account balance of your merchant accounts doesn't exceed a certain amount. For example, if you want to make sure your GBP merchant account never has a balance of over £10,000.
To set up sweeping, you need to:
- Complete the TrueLayer KYC process with your IBAN.
- Ask your point of contact at TrueLayer to enable sweeping for your account.
- Use the sweeping endpoints to configure your preferences.
What IBANs do we support?
To sweep from your GBP merchant account, the destination account details for sweeping must be a GB IBAN (these IBANs start with "GB").
To sweep from your EUR merchant account, the destination account details can be any IBAN that is connected to SEPA. You can check iban.com to know if the IBAN you'd like to sweep to is connected to SEPA.
References
On bank statements, references for sweeping payments are standardised. They are always formatted to include the date and time that the sweeping payment occurred, like this: TL YYYY-MM-DD HH:MM
.
Set up account sweeping
To set up sweeping for a given currency for a given merchant account, make a POST request to the /v3/merchant-accounts/{merchant_account_id}/sweeping
endpoint. Ensure you provide the merchant account id
to set up sweeping for as a path parameter in your request.
Your request must include an access_token
with the payments
scope as a bearer header and must also be signed.
Include these requests in the body of your request to specify the currency to sweep from, the amount of money to sweep over, and how often to sweep:
Field | Mandatory | Type | Description |
---|---|---|---|
currency | Mandatory | String | The ISO-4217 currency code of the account sweep source. |
max_amount_in_minor | Mandatory | Number | The maximum amount, above which funds will be automatically withdrawn. Specified in terms of the fractional monetary unit of the payment currency. For example, 100 is equal to 1 GBP or 1 EUR. |
frequency | Optional | String | How often the available balance is checked for sweeping. The possible values are daily , weekly or fortnightly . If omitted, defaults to daily .Funds are always swept at 10:00 UTC on a Monday if you select Weekly or Fortnightly. |
This is an example of a request to the /v3/merchant-accounts/{merchant-account_id/sweeping}
endpoint:
curl -X POST \
-H "Authorization: Bearer $access_token" \
-H "TL-Signature: $signature" \
--data '{
"currency": "GBP",
"max_amount_in_minor": 100000,
"frequency": "daily"
}' \
https://api.truelayer.com/v3/merchant-accounts/{id}/sweeping
Update account sweeping settings
You can update existing sweeping settings such as frequency
or max_amount_in_minor
. To update these settings, make an additional POST request to the /v3/merchant-accounts/{merchant_account_id}/sweeping
endpoint, including the updated values for your settings. We use the settings in the most recent request you've submitted for each currency and merchant account id
.
Get existing sweeping settings
To see the sweeping settings for a given merchant account's currency, make a GET request to the /v3/merchant-accounts/{id}/sweeping
endpoint. If you haven't enabled automated sweeping, the endpoint returns a 404 error.
curl -H "Authorization: Bearer $access_token" https://api.truelayer.com/v3/merchant-accounts/{id}/sweeping
The response you get from the /v3/merchant-accounts/{id}/sweeping
endpoint contains the following objects:
Field | Type | Description |
---|---|---|
currency | String | The ISO-4217 currency code of the account sweep source. |
max_amount_in_minor | Number | The maximum amount, above which funds will be automatically withdrawn. Specified in terms of the fractional monetary unit of the payment currency. For example, 100 is equal to 1 GBP or 1 EUR. |
iban | String | The IBAN of the target account that funds will be withdrawn into from your merchant account. This is configured and validated as part of KYC onboarding when you go live with your merchant account. |
frequency | String | How often the available balance is checked for sweeping. The possible values are daily , weekly or fortnightly . If omitted, defaults to daily .Funds are always swept at 10:00 UTC on a Monday if you select Weekly or Fortnightly. |
This is an example of the response you receive:
{
"results": [
{
"currency": "GBP",
"max_amount_in_minor": 100000,
"iban": "GB43BUKB20201666666666",
"frequency": "daily"
}
]
}
Disable merchant account sweeping
To disable automated sweeping for a given merchant account's currency, make a DELETE request to the /v3/merchant-accounts/{id}/sweeping
endpoint. This not only disables sweeping, but also deletes the associated sweeping settings. Include the id
of the merchant account you want to disable sweeping for as a path parameter, and the currency
in the request body.
Your request to the /v3/merchant-accounts/{id}/sweeping
endpoint contains this parameter:
Field | Mandatory | Type | Description |
---|---|---|---|
currency | Mandatory | String | ISO 4217 Currency Code of the account sweep source. |
This is an example of a request to disable merchant account sweeping:
curl -X DELETE \
-H "Authorization: Bearer $access_token" \
-H "TL-Signature: $signature" \
https://api.truelayer.com/v3/merchant-accounts/{id}/sweeping
A successful request to disable merchant account sweeping returns a 204 response.
Updated 6 months ago