Skip to main content
Pix Automático via dLocal lets you take recurring payments over Pix. On the first payment the customer is redirected to authorize a recurring mandate — an enrolment — in their banking app, and that same payment is charged. Subsequent payments are charged directly against the enrolment with no customer interaction. Pix Automático is a recurring bank transfer scheme developed by the Banco Central do Brasil and is available in Brazil in BRL only.
Before you build
  • Primer supports the enrolment and initial payment flow. Enrolment on its own, without charging the customer, is not supported.
  • Recurring payment requests must be submitted between 2 and 10 days before the scheduled billing date. For a billing date of 5 August, submit the request between 26 July and 3 August. This is a regulatory requirement from the Banco Central do Brasil that applies to all Pix Automático payments.
  • Pix Automático is available in Brazil only. Set order.countryCode to BR and currencyCode to BRL on every payment.
  • Every merchant-initiated payment after the enrolment must carry a scheduled_date in metadata.

Get started with Pix Automático via dLocal

Before you begin

If this is your first payment method, make sure to follow the Get started guide to begin processing payments with Primer. Pix Automático is not active on a dLocal account by default. Ask your dLocal contact to enable it before you activate it on the Checkout. You need credentials from the dLocal Merchant Dashboard. If you do not have an account, contact your dLocal account manager or support@dlocal.com. To get sandbox credentials, toggle Test mode in the top right of the dLocal dashboard — a blue bar appears across the top to confirm you are in test mode. Your x_login, x_trans_key and secret key are under Settings > Integration, on the Integration tab.

Configure in the Dashboard

  1. Add Pix Automático via dLocal payment method to your Dashboard Go to the integrations section of the Dashboard, click on the ‘New Integration’ button and search for dLocal. Enter your x_login, x_trans_key and secret key, then click Connect.
  2. Add your MID Enter your dLocal AccountId in the MID box. You can find it at the top of the dLocal dashboard.
  3. Configure the webhooks in dLocal Copy the callback URL that Primer shows you during setup. In the dLocal dashboard, under Endpoint configuration, paste it into both the Refunds URL field and the Payins notification URL field. The Payins notification URL is required for Pix Automático.
  4. Activate Pix Automático via dLocal on the Checkout Go to the Checkout section of the Dashboard and toggle on Pix Automático. Add a display condition so it only appears where it can be paid — at a minimum, Currency = BRL.
  5. Configure a Workflow to process payments made with Pix Automático via dLocal Go to Workflows and create a workflow with a Payment created trigger and an Authorize payment action with Auto-continue enabled. Pix Automático via dLocal is a web redirect connection, so no further steps are needed.

Prepare the client session

dLocal leverages the following parameters to process a payment. Pass them when creating the client session.

Enrolment and initial payment

The first payment creates the mandate and charges the customer. Pass the subscription terms in the client session metadata — they dictate when and how much you are allowed to charge on the recurring payments that follow.

Recurring payments

For each merchant-initiated payment after the enrolment, pass the date the payment is scheduled for in metadata. dLocal requires it.
Submit the request between 2 and 10 days before the scheduled_date. The example above was submitted on 4 September for a 4 October billing date.

Automatic retries

On the scheduled_date, between 00:00 and 08:00, dLocal attempts the debit. If it succeeds, the payment settles and Primer sends you a SETTLED webhook. If this first attempt fails, you are not notified. If the first attempt failed because of insufficient funds or account limits, dLocal must retry the same day between 18:00 and 21:00 — a regulatory requirement from the Banco Central do Brasil. That retry is automatic and you do not need to trigger it. It produces a Primer webhook: SETTLED if it succeeds, FAILED if it does not.

Prepare the SDK for payments

Use the payment method type DLOCAL_PIX_AUTOMATICO wherever the code below references YOUR_PAYMENT_METHOD_TYPE.

Test in sandbox

Connect your dLocal test account to your Primer Sandbox environment. Toggle Test mode in the dLocal dashboard before copying your credentials — sandbox and production credentials are different.

Go live

You don’t need to do anything particular to go live — just make sure to use production credentials, and confirm with dLocal that Pix Automático is enabled on your production account. Both the Refunds URL and the Payins notification URL must be configured in your production dLocal dashboard.