{"title":"Top up on a schedule","category":"default","creationDate":1776961627,"content":"<p>You can configure settings to automatically trigger top-ups to your users' balance accounts when certain conditions are met. These conditions include:<\/p>\n<ul>\n<li>Timing. For example, a pre-defined, fixed schedule for top-ups.<\/li>\n<li>The amount of funds available on the balance account. For example, a minimum amount that must always remain on the balance account.<\/li>\n<\/ul>\n<p>You can define the conditions relevant for your use cases by setting up <a href=\"#sweeps\">sweeps<\/a>. When any of these conditions are met, Adyen automatically triggers an incoming transfer that tops up your user's balance account.<\/p>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Adyen for Platforms<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/development-resources\/api-credentials\/roles\/\">API credential roles<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that you have the credentials for the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/overview\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Configuration API<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/development-resources\/webhooks\">Webhooks<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Subscribe to the following webhook(s): Subscribe to the following webhooks: <ul><li markdown=\"1\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform-webhooks\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Configuration webhooks<\/a><\/li><li markdown=\"1\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transfer-webhooks\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Transfer webhooks<\/a><\/li><li markdown=\"1\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/transaction-webhooks\/latest\/overview\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Transaction webhooks<\/a><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/marketplaces\/verification-overview\/capabilities\">Capabilities<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that the user has the following capability: <ul><li markdown=\"1\"><strong>receiveFromTransferInstrument<\/strong><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Limitations<\/strong><\/td>\n<td style=\"text-align: left;\">Scheduled top-ups are only supported for account holders with verified bank accounts in the EU, the UK, and the US. The top-ups are processed over corresponding standard debit rails of\u00a0<a href=\"https:\/\/finance.ec.europa.eu\/consumer-finance-and-payments\/payment-services\/single-euro-payments-area-sepa_en\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Single Euro Payments Area (SEPA)<\/a>,\u00a0<a href=\"https:\/\/www.bacs.co.uk\/pages\/home.aspx\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Bankers' Automated Clearing Services (BACS)<\/a>, and\u00a0<a href=\"https:\/\/www.nacha.org\/content\/ach-network\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Automated Clearing House (ACH) Network<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Contact our <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a> to enable scheduled top-ups for your marketplace.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Sweeps<\/h2>\n<p>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.<\/p>\n<p>When you configure a sweep for a balance account, you must determine the sweep type, the sweep conditions, and the sweep amount:<\/p>\n<ul>\n<li>\n<p><strong>Sweep type<\/strong>: dictates the direction of the funds transfer in relation to your user's balance account. For scheduled top-ups, the direction is set to <em>pull<\/em>, in order to pull funds in to the balance account from a transfer instrument that you specify.<\/p>\n<\/li>\n<li>\n<p><strong>Sweep conditions<\/strong>: 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<\/p>\n<\/li>\n<li>\n<p><strong>Sweep amount<\/strong>: the amount of the funds being transferred.<\/p>\n<\/li>\n<\/ul>\n<p>When the conditions for a sweep are met, it triggers a top-up request from a transfer instrument for the specified sweep amount. Adyen sends webhooks to your server when an incoming transfer results from a sweep.<\/p>\n<h2>How it works<\/h2>\n<ol>\n<li>You determine the conditions and amount for the pull sweep to your user's balance account.<\/li>\n<li>You create a pull sweep for your user's balance account using the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/overview\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Configuration API<\/a>.<\/li>\n<li>Adyen sends a <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/balanceplatform-webhooks\/latest\/post\/balancePlatform.balanceAccountSweep.created\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">balancePlatform.balanceAccountSweep.created<\/a> webhook to your server to inform you of the status of the sweep you created.<\/li>\n<li>When the conditions for the sweep are met, Adyen initiates an incoming transfer (top-up) to your balance account for the specified sweep amount.<\/li>\n<li>Adyen sends transfer and transaction webhooks to your server to inform you about the status of the incoming transfer (top-up).<\/li>\n<\/ol>\n<h2 id=\"create-sweep\">Create a pull sweep<\/h2>\n<ol>\n<li>\n<p>To create a sweep, make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/balanceAccounts\/{balanceAccountId}\/sweeps<\/a> request with the ID of the balance account in the path, and the following parameters in the request body.<\/p>\n<div class=\"sticky-table-container\">\n    \n<table>\n<thead>\n<tr>\n<th>Parameter name<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-counterparty-transferInstrumentId\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">counterparty.transferInstrumentId<\/a><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/legalentity\/latest\/post\/transferInstruments\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">transfer instrument<\/a> ID of the source of the funds. The transfer instrument must be linked to the account holder's  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/legalentity\/latest\/post\/legalEntities\" class=\" external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">legal entity<\/a>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-counterparty-merchantAccount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">counterparty.merchantAccount<\/a><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The merchant account ID that will be the source of funds.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-currency\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">currency<\/a><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The currency of the sweep. This must match one of the currencies of the balances.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-schedule-CronSweepSchedule-type\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">schedule.type<\/a><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The schedule when the sweep is evaluated. Set this parameter to <strong>balance<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-schedule-type\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">type<\/a><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The direction of sweep. Set this parameter to <strong>pull<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-triggerAmount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">triggerAmount<\/a><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The threshold amount that triggers the sweep.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-sweepAmount\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">sweepAmount<\/a><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td>The amount that must be pulled in.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/balanceAccounts\/(balanceAccountId)\/sweeps#request-description\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">description<\/a><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td>Your description for the resulting transfers.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n<\/div>\n\n<p>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&nbsp;5,000.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Create a pull sweep'\" :id=\"'create-topUp-sweep'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/balanceAccounts\\\/BA00000000000000000000001\\\/sweeps \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST \\\\\\n-d '{\\n    \\&quot;description\\&quot;: \\&quot;Top-up if balance drops below 5000\\&quot;,\\n    \\&quot;counterparty\\&quot;: {\\n        \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n        \\&quot;transferInstrumentId\\&quot; : \\&quot;SE00000000000000000000001\\&quot;\\n    },\\n    \\&quot;sweepAmount\\&quot;: {\\n        \\&quot;value\\&quot;: 100000,\\n        \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;\\n    },\\n    \\&quot;triggerAmount\\&quot;: {\\n        \\&quot;value\\&quot;: 500000,\\n        \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;\\n    },\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n    \\&quot;schedule\\&quot;: {\\n        \\&quot;type\\&quot;: \\&quot;balance\\&quot;\\n    },\\n    \\&quot;type\\&quot;: \\&quot;pull\\&quot;\\n}'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v33.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.balanceplatform.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.service.balancePlatform.*;\\n\\nClient client = new Client(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nSweepSchedule sweepSchedule2 = new SweepSchedule()\\n  .type(SweepSchedule.TypeEnum.BALANCE);\\n\\nSweepCounterparty sweepCounterparty2 = new SweepCounterparty()\\n  .merchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;)\\n  .transferInstrumentId(\\&quot;SE00000000000000000000001\\&quot;);\\n\\nAmount amount2 = new Amount()\\n  .currency(\\&quot;EUR\\&quot;)\\n  .value(500000L);\\n\\nAmount amount3 = new Amount()\\n  .currency(\\&quot;EUR\\&quot;)\\n  .value(100000L);\\n\\nCreateSweepConfigurationV2 createSweepConfigurationV2 = new CreateSweepConfigurationV2()\\n  .schedule(sweepSchedule2)\\n  .description(\\&quot;Top-up if balance drops below 5000\\&quot;)\\n  .counterparty(sweepCounterparty2)\\n  .triggerAmount(amount2)\\n  .currency(\\&quot;EUR\\&quot;)\\n  .sweepAmount(amount3)\\n  .type(CreateSweepConfigurationV2.TypeEnum.PULL);\\n\\n\\\/\\\/ Send the request\\nBalanceAccountsApi service = new BalanceAccountsApi(client);\\nSweepConfigurationV2 response = service.createSweep(\\&quot;balanceAccountId\\&quot;, createSweepConfigurationV2, null);&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;&lt;?php\\n\\\/\\\/ Adyen PHP API Library v24.0.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\BalancePlatform\\\\SweepSchedule;\\nuse Adyen\\\\Model\\\\BalancePlatform\\\\SweepCounterparty;\\nuse Adyen\\\\Model\\\\BalancePlatform\\\\Amount;\\nuse Adyen\\\\Model\\\\BalancePlatform\\\\CreateSweepConfigurationV2;\\nuse Adyen\\\\Service\\\\BalancePlatform\\\\BalanceAccountsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;);\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$sweepSchedule2 = new SweepSchedule();\\n$sweepSchedule2\\n  -&gt;setType(\\&quot;balance\\&quot;);\\n\\n$sweepCounterparty2 = new SweepCounterparty();\\n$sweepCounterparty2\\n  -&gt;setMerchantAccount(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setTransferInstrumentId(\\&quot;SE00000000000000000000001\\&quot;);\\n\\n$amount2 = new Amount();\\n$amount2\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setValue(500000);\\n\\n$amount3 = new Amount();\\n$amount3\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setValue(100000);\\n\\n$createSweepConfigurationV2 = new CreateSweepConfigurationV2();\\n$createSweepConfigurationV2\\n  -&gt;setSchedule($sweepSchedule2)\\n  -&gt;setDescription(\\&quot;Top-up if balance drops below 5000\\&quot;)\\n  -&gt;setCounterparty($sweepCounterparty2)\\n  -&gt;setTriggerAmount($amount2)\\n  -&gt;setCurrency(\\&quot;EUR\\&quot;)\\n  -&gt;setSweepAmount($amount3)\\n  -&gt;setType(\\&quot;pull\\&quot;);\\n\\n\\\/\\\/ Send the request\\n$service = new BalanceAccountsApi($client);\\n$response = $service-&gt;createSweep('balanceAccountId', $createSweepConfigurationV2);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .net API Library v27.0.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.BalancePlatform;\\nusing Adyen.Service.BalancePlatform;\\n\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nSweepSchedule sweepSchedule2 = new SweepSchedule\\n{\\n  Type = SweepSchedule.TypeEnum.Balance\\n};\\n\\nSweepCounterparty sweepCounterparty2 = new SweepCounterparty\\n{\\n  MerchantAccount = \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  TransferInstrumentId = \\&quot;SE00000000000000000000001\\&quot;\\n};\\n\\nAmount amount2 = new Amount\\n{\\n  Currency = \\&quot;EUR\\&quot;,\\n  Value = 500000\\n};\\n\\nAmount amount3 = new Amount\\n{\\n  Currency = \\&quot;EUR\\&quot;,\\n  Value = 100000\\n};\\n\\nCreateSweepConfigurationV2 createSweepConfigurationV2 = new CreateSweepConfigurationV2\\n{\\n  Schedule = sweepSchedule2,\\n  Description = \\&quot;Top-up if balance drops below 5000\\&quot;,\\n  Counterparty = sweepCounterparty2,\\n  TriggerAmount = amount2,\\n  Currency = \\&quot;EUR\\&quot;,\\n  SweepAmount = amount3,\\n  Type = CreateSweepConfigurationV2.TypeEnum.Pull\\n};\\n\\n\\\/\\\/ Send the request\\nvar service = new BalanceAccountsService(client);\\nvar response = service.CreateSweep(\\&quot;balanceAccountId\\&quot;, createSweepConfigurationV2);&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v23.3.0\\nconst { Client, BalancePlatformAPI } = require('@adyen\\\/api-library');\\n\\nconst client = new Client({ apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\n\\n\\\/\\\/ Create the request object(s)\\nconst createSweepConfigurationV2 = {\\n  description: \\&quot;Top-up if balance drops below 5000\\&quot;,\\n  counterparty: {\\n    merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n    transferInstrumentId: \\&quot;SE00000000000000000000001\\&quot;\\n  },\\n  sweepAmount: {\\n    value: 100000,\\n    currency: \\&quot;EUR\\&quot;\\n  },\\n  triggerAmount: {\\n    value: 500000,\\n    currency: \\&quot;EUR\\&quot;\\n  },\\n  currency: \\&quot;EUR\\&quot;,\\n  schedule: {\\n    type: \\&quot;balance\\&quot;\\n  },\\n  type: \\&quot;pull\\&quot;\\n}\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = balancePlatformAPI.BalanceAccountsApi.createSweep(\\&quot;balanceAccountId\\&quot;, createSweepConfigurationV2);&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v16.3.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v16\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v16\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v16\\\/src\\\/balancePlatform\\&quot;\\n)\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\nsweepSchedule2 := balancePlatform.SweepSchedule{\\n  Type: \\&quot;balance\\&quot;,\\n}\\n\\nsweepCounterparty2 := balancePlatform.SweepCounterparty{\\n  MerchantAccount: common.PtrString(\\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;),\\n  TransferInstrumentId: common.PtrString(\\&quot;SE00000000000000000000001\\&quot;),\\n}\\n\\namount2 := balancePlatform.Amount{\\n  Currency: \\&quot;EUR\\&quot;,\\n  Value: 500000,\\n}\\n\\namount3 := balancePlatform.Amount{\\n  Currency: \\&quot;EUR\\&quot;,\\n  Value: 100000,\\n}\\n\\ncreateSweepConfigurationV2 := balancePlatform.CreateSweepConfigurationV2{\\n  Schedule: sweepSchedule2,\\n  Description: common.PtrString(\\&quot;Top-up if balance drops below 5000\\&quot;),\\n  Counterparty: sweepCounterparty2,\\n  TriggerAmount: &amp;amount2,\\n  Currency: \\&quot;EUR\\&quot;,\\n  SweepAmount: &amp;amount3,\\n  Type: common.PtrString(\\&quot;pull\\&quot;),\\n}\\n\\n\\\/\\\/ Send the request\\nservice := client.BalancePlatform()\\nreq := service.BalanceAccountsApi.CreateSweepInput(\\&quot;balanceAccountId\\&quot;).CreateSweepConfigurationV2(createSweepConfigurationV2)\\nres, httpRes, err := service.BalanceAccountsApi.CreateSweep(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v13.3.0\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;description\\&quot;: \\&quot;Top-up if balance drops below 5000\\&quot;,\\n  \\&quot;counterparty\\&quot;: {\\n    \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n    \\&quot;transferInstrumentId\\&quot;: \\&quot;SE00000000000000000000001\\&quot;\\n  },\\n  \\&quot;sweepAmount\\&quot;: {\\n    \\&quot;value\\&quot;: 100000,\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;\\n  },\\n  \\&quot;triggerAmount\\&quot;: {\\n    \\&quot;value\\&quot;: 500000,\\n    \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;\\n  },\\n  \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n  \\&quot;schedule\\&quot;: {\\n    \\&quot;type\\&quot;: \\&quot;balance\\&quot;\\n  },\\n  \\&quot;type\\&quot;: \\&quot;pull\\&quot;\\n}\\n\\n# Send the request\\nresult = adyen.balancePlatform.balance_accounts_api.create_sweep(request=json_request, balanceAccountId=\\&quot;balanceAccountId\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v10.1.1\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :description =&gt; 'Top-up if balance drops below 5000',\\n  :counterparty =&gt; {\\n    :merchantAccount =&gt; 'YOUR_MERCHANT_ACCOUNT',\\n    :transferInstrumentId =&gt; 'SE00000000000000000000001'\\n  },\\n  :sweepAmount =&gt; {\\n    :value =&gt; 100000,\\n    :currency =&gt; 'EUR'\\n  },\\n  :triggerAmount =&gt; {\\n    :value =&gt; 500000,\\n    :currency =&gt; 'EUR'\\n  },\\n  :currency =&gt; 'EUR',\\n  :schedule =&gt; {\\n    :type =&gt; 'balance'\\n  },\\n  :type =&gt; 'pull'\\n}\\n\\n# Send the request\\nresult = adyen.balancePlatform.balance_accounts_api.create_sweep(request_body, 'balanceAccountId')&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v23.3.0\\nimport { Client, BalancePlatformAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\nconst client = new Client({ apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot; });\\n\\n\\\/\\\/ Create the request object(s)\\nconst sweepSchedule2: Types.balancePlatform.SweepSchedule = {\\n  type: Types.balancePlatform.SweepSchedule.TypeEnum.Balance\\n};\\n\\nconst sweepCounterparty2: Types.balancePlatform.SweepCounterparty = {\\n  merchantAccount: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n  transferInstrumentId: \\&quot;SE00000000000000000000001\\&quot;\\n};\\n\\nconst amount2: Types.balancePlatform.Amount = {\\n  currency: \\&quot;EUR\\&quot;,\\n  value: 500000\\n};\\n\\nconst amount3: Types.balancePlatform.Amount = {\\n  currency: \\&quot;EUR\\&quot;,\\n  value: 100000\\n};\\n\\nconst createSweepConfigurationV2: Types.balancePlatform.CreateSweepConfigurationV2 = {\\n  schedule: sweepSchedule2,\\n  description: \\&quot;Top-up if balance drops below 5000\\&quot;,\\n  counterparty: sweepCounterparty2,\\n  triggerAmount: amount2,\\n  currency: \\&quot;EUR\\&quot;,\\n  sweepAmount: amount3,\\n  type: Types.balancePlatform.CreateSweepConfigurationV2.TypeEnum.Pull\\n};\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = balancePlatformAPI.BalanceAccountsApi.createSweep(\\&quot;balanceAccountId\\&quot;, createSweepConfigurationV2);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>In the response, note the sweep's unique identifier.<\/p>\n<p>By default, sweeps are created with an <strong>active<\/strong> status. You can change it by sending an updated status in a PATCH  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/patch\/balanceAccounts\/(balanceAccountId)\/sweeps\/(sweepId)\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/balanceAccounts\/{balanceAccountId}\/sweeps\/{sweepId}<\/a> request.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response - sweep created'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"id\\\": \\\"SWPC00000000000000000000000001\\\",\\n    \\\"description\\\": \\\"Top-up if balance drops below 5000\\\",\\n    \\\"counterparty\\\": {\\n        \\\"merchantAccount\\\": \\\"YOUR_MERCHANT_ACCOUNT\\\",\\n        \\\"transferInstrumentId\\\" : \\\"SE00000000000000000000001\\\"\\n    },\\n    \\\"sweepAmount\\\": {\\n        \\\"value\\\": 100000,\\n        \\\"currency\\\": \\\"EUR\\\"\\n    },\\n    \\\"triggerAmount\\\": {\\n        \\\"value\\\": 500000,\\n        \\\"currency\\\": \\\"EUR\\\"\\n    },\\n    \\\"currency\\\": \\\"EUR\\\",\\n    \\\"schedule\\\": {\\n        \\\"type\\\": \\\"balance\\\"\\n    },\\n    \\\"type\\\": \\\"pull\\\",\\n    \\\"status\\\": \\\"active\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Listen to the <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/balanceplatform-webhooks\/latest\/post\/balancePlatform.balanceAccountSweep.created\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">balancePlatform.balanceAccountSweep.created<\/a> webhook, which Adyen sends to your server when you successfully create a sweep.<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"get-updates\">Get updates when a sweep triggers a transfer request<\/h2>\n<p>You can track incoming transfer requests that result from sweeps through <a href=\"\/pt\/marketplaces\/top-up-balance-account\/top-up-webhooks\">top-up webhooks<\/a>. These webhooks provide the status of the incoming transfer request, from the time when Adyen received the request and the transfer was authorised, up to when the funds were added to the balance account. The webhooks will also inform you if the transfer failed.<\/p>\n<p>You can also <a href=\"\/pt\/marketplaces\/view-transfers-details\">view the resulting transfer in your Customer Area<\/a>.<\/p>\n<h2>See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/marketplaces\/view-transfers-details\"\n                        target=\"_self\"\n                        >\n                    View transfer details in your Customer Area\n                <\/a><\/li><li><a href=\"\/marketplaces\/top-up-balance-account\/top-up-webhooks\"\n                        target=\"_self\"\n                        >\n                    Top-up webhooks\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/marketplaces\/top-up-balance-account\/scheduled-top-ups","articleFields":{"description":"Set up a pull sweep to trigger a direct debit from a verified transfer instrument.","cache_enable":false,"search_tags":["autofunding","auto funding","sweep","sweeps","pull sweep","pull sweeps"],"parameters":{"directoryPath":"\/marketplaces","model":"marketplace"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/marketplaces\/top-up-balance-account\/scheduled-top-ups","title":"Top up on a schedule","content":"You can configure settings to automatically trigger top-ups to your users' balance accounts when certain conditions are met. These conditions include:\n\nTiming. For example, a pre-defined, fixed schedule for top-ups.\nThe amount of funds available on the balance account. For example, a minimum amount that must always remain on the balance account.\n\nYou can define the conditions relevant for your use cases by setting up sweeps. When any of these conditions are met, Adyen automatically triggers an incoming transfer that tops up your user's balance account.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nAdyen for Platforms\n\n\nAPI credential roles\nMake sure that you have the credentials for the  Configuration API.\n\n\nWebhooks\nSubscribe to the following webhook(s): Subscribe to the following webhooks:  Configuration webhooks Transfer webhooks Transaction webhooks\n\n\nCapabilities\nMake sure that the user has the following capability: receiveFromTransferInstrument\n\n\nLimitations\nScheduled top-ups are only supported for account holders with verified bank accounts in the EU, the UK, and the US. The top-ups are processed over corresponding standard debit rails of\u00a0Single Euro Payments Area (SEPA),\u00a0Bankers' Automated Clearing Services (BACS), and\u00a0Automated Clearing House (ACH) Network.\n\n\nSetup steps\nContact our Support Team to enable scheduled top-ups for your marketplace.\n\n\n\nSweeps\nA 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.\nWhen you configure a sweep for a balance account, you must determine the sweep type, the sweep conditions, and the sweep amount:\n\n\nSweep 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.\n\n\nSweep 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\n\n\nSweep amount: the amount of the funds being transferred.\n\n\nWhen the conditions for a sweep are met, it triggers a top-up request from a transfer instrument for the specified sweep amount. Adyen sends webhooks to your server when an incoming transfer results from a sweep.\nHow it works\n\nYou determine the conditions and amount for the pull sweep to your user's balance account.\nYou create a pull sweep for your user's balance account using the  Configuration API.\nAdyen sends a balancePlatform.balanceAccountSweep.created webhook to your server to inform you of the status of the sweep you created.\nWhen the conditions for the sweep are met, Adyen initiates an incoming transfer (top-up) to your balance account for the specified sweep amount.\nAdyen sends transfer and transaction webhooks to your server to inform you about the status of the incoming transfer (top-up).\n\nCreate a pull sweep\n\n\nTo 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.\n\n    \n\n\n\nParameter name\nRequired\nDescription\n\n\n\n\n counterparty.transferInstrumentId\n\nThe  transfer instrument ID of the source of the funds. The transfer instrument must be linked to the account holder's  legal entity.\n\n\n counterparty.merchantAccount\n\nThe merchant account ID that will be the source of funds.\n\n\n currency\n\nThe currency of the sweep. This must match one of the currencies of the balances.\n\n\n schedule.type\n\nThe schedule when the sweep is evaluated. Set this parameter to balance.\n\n\n type\n\nThe direction of sweep. Set this parameter to pull.\n\n\n triggerAmount\n\nThe threshold amount that triggers the sweep.\n\n\n sweepAmount\n\nThe amount that must be pulled in.\n\n\n description\n\nYour description for the resulting transfers.\n\n\n\n\n\n\nHere's an example of creating a pull sweep to top up a balance account from a transfer instrument if the balance drops below EUR&nbsp;5,000.\n\n\n\n\n\nIn the response, note the sweep's unique identifier.\nBy 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.\n\n\n\n\n\nListen to the balancePlatform.balanceAccountSweep.created webhook, which Adyen sends to your server when you successfully create a sweep.\n\n\nGet updates when a sweep triggers a transfer request\nYou can track incoming transfer requests that result from sweeps through top-up webhooks. These webhooks provide the status of the incoming transfer request, from the time when Adyen received the request and the transfer was authorised, up to when the funds were added to the balance account. The webhooks will also inform you if the transfer failed.\nYou can also view the resulting transfer in your Customer Area.\nSee also\n\n\n                    View transfer details in your Customer Area\n                \n                    Top-up webhooks\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Marketplaces","lvl2":"Top up balance accounts","lvl3":"Top up on a schedule"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/marketplaces","lvl2":"https:\/\/docs.adyen.com\/pt\/marketplaces\/top-up-balance-account","lvl3":"\/pt\/marketplaces\/top-up-balance-account\/scheduled-top-ups"},"levels":4,"category":"Marketplaces","category_color":"green","tags":["autofunding","auto funding","sweep","sweeps","pull sweep","pull sweeps"]}}
