Skip to main content
Mercado Pago via dLocal redirects the customer to Mercado Pago, where they approve the payment using their wallet balance, a stored card, or Mercado Crédito. Mercado Pago is the payments arm of Mercado Libre and one of the most widely held wallets in Latin America. Through dLocal it is available in six markets, each with its own local currency.
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

Marketorder.countryCodecurrencyCode
ArgentinaARARS
BrazilBRBRL
ChileCLCLP
ColombiaCOCOP
MexicoMXMXN
UruguayUYUYU
To route payments in Chile in CLP, you must request special currency access from Primer. Raise a ticket on the Support Portal before you go live in Chile — without it, CLP payments cannot be processed.

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

  1. 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.
  2. 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.
  3. 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

Use the payment method type DLOCAL_MERCADO_PAGO 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. Run the following for each market you intend to support.
  1. Create a client session with order.countryCode, currencyCode and customer.nationalDocumentId set for that market.
  2. Select Mercado Pago at the checkout.
  3. Complete the payment on the Mercado Pago hosted page.
  4. Drive a PAID callback from dLocal.
  5. Confirm Primer resumes the payment once and the final status is Settled.
Also confirm that the correct Mercado Pago branding and logo are shown for the country under test.

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 sure order.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.