Mercado Pago via dLocal is asynchronous. dLocal confirms the payment by webhook once the customer approves it in Mercado Pago, so fulfil orders only on a final status. Full and partial refunds are supported, and a payment can be refunded more than once.
Supported markets
| Market | order.countryCode | currencyCode |
|---|---|---|
| Argentina | AR | ARS |
| Brazil | BR | BRL |
| Chile | CL | CLP |
| Colombia | CO | COP |
| Mexico | MX | MXN |
| Uruguay | UY | UYU |
Get started with Mercado Pago 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. Mercado Pago is not active on a dLocal account by default. Ask your dLocal contact to enable it before you activate it on the Checkout.Configure in the Dashboard
- Add Mercado Pago 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. Follow the instructions to connect your dLocal account to your Primer Dashboard.
- Activate Mercado Pago via dLocal on the Checkout Go to the Checkout section of the Dashboard and activate the Mercado Pago via dLocal payment method. Add a display condition so it only appears where it can be paid, restrict it to the currencies of the markets you support.
- Configure a Workflow to process payments made with Mercado Pago via dLocal Go to Workflows, and ensure there is a workflow with the Authorization action configured to process APMs.
Prepare the client session
dLocal leverages the following parameters to process a payment. Pass them when creating the client session.Prepare the SDK for payments
- Web
- iOS
- Android
Use the payment method type
DLOCAL_MERCADO_PAGO wherever the code below references YOUR_PAYMENT_METHOD_TYPE.- Primer Checkout (recommended)
- Universal Checkout (legacy)
- Headless Universal Checkout (legacy)
Primer Checkout is our latest web SDK, built around declarative web components. Once Mercado Pago via dLocal is enabled in your Dashboard, the default For dynamic rendering based on what the server returns, listen to primer:methods-update or use primer-payment-method-container for declarative filtering.
<primer-checkout> layout renders it automatically alongside your other methods — no payment-method-specific markup is required.Custom layouts
Only reach for primer-payment-method if you’re building a custom layout and need to place Mercado Pago via dLocal at a specific position. The element only renders when the type is enabled in your Dashboard and returned by the server for this checkout.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. Run the following for each market you intend to support.- Create a client session with
order.countryCode,currencyCodeandcustomer.nationalDocumentIdset for that market. - Select Mercado Pago at the checkout.
- Complete the payment on the Mercado Pago hosted page.
- Drive a
PAIDcallback from dLocal. - Confirm Primer resumes the payment once and the final status is Settled.
Go live
Ensure to use production credentials, and confirm with dLocal that Mercado Pago is enabled on your production account for each market you intend to support. Make sureorder.countryCode and currencyCode match one of the supported markets on every payment you route to it. If you are going live in Chile, confirm your CLP currency access has been granted by Primer.