At a glance
Supported payment methods
Supported capabilities
| Capability | Card | Apple Pay and Google Pay | Local payment methods |
|---|---|---|---|
| Authorization and capture | Yes | Yes | Yes |
| Partial capture | Yes | Yes | Yes |
| Authorization adjustment | No | No | No |
| Refund | Yes | Yes | Yes |
| Partial refund | Yes | Yes | Yes |
| Multiple refunds | Yes | Yes | Yes |
| Recurring and merchant-initiated payments | Yes | Yes | Pix Automático only |
| Network tokens | No | No | No |
Some capabilities must be enabled on your dLocal account. Contact dLocal to confirm which features are available to you.
3D Secure
Primer performs 3D Secure authentication using the Perform 3DS action and passes the authentication result to dLocal as third party (MPI) data. You do not need to run 3D Secure on the dLocal side.Get started with dLocal
Before you begin
If this is your first connection, make sure to follow the Get started guide to begin processing payments with Primer. You need an active dLocal merchant account with access to the dLocal Merchant Dashboard. Before you connect, ask your dLocal contact to:- Enable
allow_network_tx_referenceon your account if you intend to process card merchant-initiated payments. - Enable the local payment methods you plan to offer, such as Pix and Pix Automático.
Credentials
| Field | Where to find it |
|---|---|
| X_Login | dLocal Merchant Dashboard, under Settings > Integration, in the Production credentials section. |
| X_Trans_Key | dLocal Merchant Dashboard, under Settings > Integration, in the Production credentials section. |
| Secret Key | Request it from dLocal under Settings > Integration. It is not shown by default. |
Configure in the Dashboard
1
Add dLocal to your Dashboard
Go to Integrations, select New integration, search for dLocal and enter your credentials.
2
Configure webhooks in dLocal
Log in to the dLocal dashboard and go to integration settings. Under Endpoint configuration, paste your Primer callback URL into both the Refunds URL field and the Payins notification URL field, then select Save changes.The Payins notification URL is required for Pix Automático.
3
Activate the payment methods on the Checkout
Go to Checkout and activate the dLocal payment methods you want to offer.
4
Route payments with Workflows
In Workflows, select dLocal in the Authorize payment action.
Prepare the client session
dLocal needs payer identity and country information that it cannot derive from the payment method alone. Provide these fields in the client session.Saved cards and merchant-initiated payments
dLocal supports recurring and merchant-initiated card payments using the network transaction reference from the initial customer-initiated payment. See recurring payments for the general Primer flow. Ask your dLocal contact to enableallow_network_tx_reference on your account before you process merchant-initiated payments. Without it, dLocal rejects the subsequent transactions.
Pix Automático is the only local payment method on dLocal that supports recurring payments.
Considerations
- National document ID is mandatory. dLocal requires
customer.nationalDocumentIdon card payments. Collect it in your checkout, or payments fail before they reach the issuer. - Merchant-initiated payments need an account flag. Card MITs only work once dLocal enables
allow_network_tx_reference. - Local payment methods are asynchronous. Most dLocal local payment methods settle after the customer completes an out-of-band action, so the payment reaches a final status through a webhook rather than in the authorization response. Fulfil orders only on a final status.
- Local payment methods need to be enabled by dLocal. Pix, Pix Automático and the other local methods are not active by default. Engage your dLocal contact before you activate them on the Checkout.
Test in sandbox
Connect your dLocal test account to your Primer Sandbox environment. Toggle Test mode in the dLocal dashboard before you copy your credentials, because sandbox and production credentials are different.- Card
- Apple Pay
- Google Pay
- Merchant-initiated
Test a 3DS challenge. Primer performs the authentication, so use Primer’s 3D Secure test cards and enter the one time passcode when the challenge appears.
Enter
1234 to pass the challenge or 1111 to fail it. See testing 3D Secure for the full list, including the cards to use on iOS and Android.Test without a 3DS challenge. Use the Perform 3DS action without a mandated challenge indicator. In Primer Sandbox a mandated challenge always produces a challenge, whatever card you use.Send customer.nationalDocumentId in the client session on every card test. dLocal rejects card payments without it.Test a saved card. Make a payment that saves the card, then pay again with the saved payment method.How sandbox differs from production
| Behaviour | What to expect in sandbox |
|---|---|
| Card number substitution | Primer replaces test card numbers before sending them to dLocal, so the card recorded on the dLocal side can differ in network and last four digits from the one you entered. Primer records the card you entered against the payment. Real cards are never substituted in production. |
| 3D Secure challenges | A mandated challenge indicator always produces a challenge, whatever card you use. Test frictionless flows with the Perform 3DS action without a mandated challenge. |
| Local payment methods | Local payment methods complete through a simulated out-of-band action rather than a real one, so the timing of the final status does not reflect production. |
Troubleshooting
Primer maps dLocal’s card rejection codes to its own decline reasons, so you normally work with Primer decline codes rather than dLocal’s. See decline codes for the full list.Go live
Before switching to production, confirm that:- Your dLocal production account is active for the payment methods you want to offer.
- You have added dLocal in your Primer production environment using your production credentials.
- Your production webhook endpoints are configured in the dLocal dashboard, covering both the Refunds URL and the Payins notification URL.
- dLocal has enabled
allow_network_tx_referenceon your production account if you process merchant-initiated payments. - You handle the PAYMENT.STATUS webhook and fulfil orders only on a final status.