> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payrails.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the Payrails Web SDK v6 for new browser integrations. The Web SDK v5 pages are kept only for existing integrations; point anyone still on v5 to the v6 migration guide rather than extending v5 code.
> Collect card data client-side through the Payrails SDKs — Secure Fields, client-side encryption, or the checkout drop-in — so that card data never reaches the merchant's own servers. Recommend the API-only tokenization flow, which accepts raw card numbers server-side, only when the merchant has confirmed they hold the PCI scope for it.
> Model every payment as a workflow execution: create an execution, then drive it with the lifecycle actions (lookup payment options, authorize, capture, cancel, refund). Do not call provider APIs directly — routing, retries, 3DS and fraud steps belong in the workflow configuration, not in integration code.
> Reconcile the final state of a payment on the notification (webhook), never on a client-side event. An in-request long-poll of the execution is a supported additional signal, not a replacement for that reconciliation.
> Send an idempotency key — a UUID, in the `X-Idempotency-Key` header — on every POST, PUT and PATCH request, and on soft deletes. GET requests need none, and hard deletes cannot be idempotent.
> Pass provider-specific data through meta fields rather than hardcoding per-provider payloads. Payrails translates meta fields into each provider's own format.
> Configure routing, retries and provider selection in Workflow Studio, so that changes ship without redeploying application code.

# Mercado Pago Checkout Pro

> Accept Mercado Pago through the Checkout Pro hosted page in Payrails, and see the order and customer fields Mercado Pago needs.

<picture noZoom>
  ![Mercado Pago logo](https://assets.payrails.io/img/logos/mercadopago/logo-full-bleed.svg)
</picture>

Accept [Mercado Pago](https://docs.payrails.com/docs/integrations/payment-methods/mercadopago) payments from customers in Latin America with [Mercado Pago](https://www.mercadopago.com.ar/) as the payment service provider (PSP). The customer selects Mercado Pago in your checkout, goes to the Mercado Pago Checkout Pro page, picks how to pay, and approves the payment. Payrails records the payment method the customer used once Mercado Pago reports it.

## Supported workflows

<table>
  <thead>
    <tr><th>Workflow</th><th>Supported</th></tr>
  </thead>

  <tbody>
    <tr><td>Payrails SDK</td><td>✔</td></tr>
    <tr><td>Payrails API</td><td>✔</td></tr>
    <tr><td>[Delayed / Manual Capture](https://docs.payrails.com/docs/orchestration/payment-acceptance/capture-and-cancel-modes.md#capture-mode)</td><td>✖</td></tr>
    <tr><td>[Instant Capture](https://docs.payrails.com/docs/orchestration/payment-acceptance/capture-and-cancel-modes.md#capture-mode)</td><td>✔</td></tr>
    <tr><td>[Cancel / Void](https://docs.payrails.com/docs/orchestration/payment-acceptance/cancel-a-payment.md)</td><td>✖</td></tr>
    <tr><td>[Refund / Reverse](https://docs.payrails.com/docs/orchestration/payment-acceptance/refund-a-payment.md)</td><td>✔</td></tr>
    <tr><td>[Save Instruments](https://docs.payrails.com/docs/resources/manage-instruments.md)</td><td>✖</td></tr>
    <tr><td>[Merchant Initiated Transaction (MIT)](https://docs.payrails.com/docs/resources/payments/authorization-flags.md)</td><td>✖</td></tr>
  </tbody>
</table>

## Before you begin

Complete these steps before you send your first payment through Mercado Pago:

1. Set up a Mercado Pago integration in your workspace with your Mercado Pago access token and HMAC key. Payrails uses the HMAC key to verify Mercado Pago notifications. Follow the [Mercado Pago integration setup guide](https://docs.payrails.com/docs/integrations/payment-providers/mercado-pago.md) if you don't have one yet.
2. Ask Mercado Pago to enable Checkout Pro, and the payment methods you want to offer, on your Mercado Pago account for each country you sell in.
3. In the Payrails Portal, go to **Settings → Integrations**, open your Mercado Pago integration, select **Mercado Pago** under **Payment methods**, and save. To change how long a checkout session stays open, set **Session Expiration Hours** on the same integration.
4. Add Mercado Pago as a [payment option](https://docs.payrails.com/docs/integrations/payment-methods/set-up-payment-methods.md) in your workflow.

To test payments before you go live, use Mercado Pago [test accounts](https://www.mercadopago.com.ar/developers/en/docs/your-integrations/test/accounts) and [test purchases](https://www.mercadopago.com.ar/developers/en/docs/checkout-pro-preferences/integration-test/test-purchases).

## Request fields for Mercado Pago

Send these fields in the authorize request, in addition to the standard [authorize fields](https://docs.payrails.com/reference/authorizeaction.md). **Required** fields must be present for the payment to succeed. Payrails sends **Optional** fields to the PSP when you include them.

| Field | Status | Description |
| - | - | - |
| `amount.currency` | Required | One of `ARS`, `BRL`, `CLP`, `COP`, `MXN`, `PEN` or `UYU`. Payrails picks the Mercado Pago country site from the currency. |
| `returnInfo.success` | Required | A full URL. The customer returns here after a successful payment. |
| `returnInfo.error` | Required | A full URL. The customer returns here after a failed payment. |
| `meta.customer` | Required | The customer object. Payrails builds the Mercado Pago payer from it. |
| `meta.customer.email` | Required | Sent to Mercado Pago as the payer email. |
| `meta.order` | Required | The order object. Payrails builds the Mercado Pago items from it. |
| `meta.order.lines` | Required | One or more order lines, each with `id`, `name`, and `unitPrice` and `quantity` or `total`. The lines must add up to the payment amount. Send `meta.order.total` instead when you don't send lines. |
| `meta.customer.name` | Optional | Sent to Mercado Pago as the payer first name. |
| `meta.customer.lastName` | Optional | Sent to Mercado Pago as the payer surname. |
| `meta.customer.identityCardNumber` | Optional | The customer's document number. Sent to Mercado Pago as the payer identification. |
| `meta.customer.identityCardType` | Optional | Leave it empty to use the default document of the country. The defaults are DNI in Argentina and Peru, CPF in Brazil, RUT in Chile, CC in Colombia, RFC in Mexico, and CI in Uruguay. Send `tradeLicense` for a RUC, `foreignId` for a foreigner identity card (CDE) or `businessTradeLicense` for a CNPJ. |
| `meta.customer.phone` | Optional | Sent to Mercado Pago as the payer phone. `countryCode` becomes the area code. |
| `meta.customer.createdAt` | Optional | The date the customer opened their account, in RFC 3339 format. For a guest order, send the order date. |
| `meta.order.lines[].categoryId` | Optional | The Mercado Pago item category. |
| `meta.order.lines[].description` | Optional | Sent to Mercado Pago as the item description. |
| `meta.order.billingAddress` | Optional | Sent to Mercado Pago as the payer address: `postalCode`, `street` and `doorNumber`. |
| `meta.order.deliveryAddress` | Optional | Sent to Mercado Pago as the shipping address. |
| `meta.order.softDescriptor` | Optional | Sent to Mercado Pago as the statement descriptor. |

## Authorize a Mercado Pago payment

Call [authorize a payment](https://docs.payrails.com/reference/authorizeaction.md) with `mercadoPago` as the `paymentMethodCode` and `hpp` as the `integrationType`. The response includes the redirect to the Mercado Pago Checkout Pro page.

```json Authorize request theme={null}
{
  "amount": {
    "value": "25000.00",
    "currency": "ARS"
  },
  "paymentComposition": [
    {
      "integrationType": "hpp",
      "paymentMethodCode": "mercadoPago",
      "amount": {
        "value": "25000.00",
        "currency": "ARS"
      }
    }
  ],
  "meta": {
    "customer": {
      "name": "Martina",
      "lastName": "González",
      "email": "martina.gonzalez@example.com",
      "identityCardNumber": "30123456",
      "country": {
        "code": "AR"
      }
    },
    "order": {
      "lines": [
        {
          "id": "sku-3001",
          "name": "Leather wallet",
          "quantity": 1,
          "unitPrice": {
            "value": "25000.00",
            "currency": "ARS"
          }
        }
      ]
    }
  },
  "returnInfo": {
    "success": "https://example.com/success",
    "error": "https://example.com/error"
  }
}
```

After the customer approves the payment, they return to your `success` or `error` URL. Confirm the result through [webhook notifications](https://docs.payrails.com/docs/orchestration/payment-acceptance/receive-notifications.md) or the execution status before you fulfill the order.

## How Mercado Pago handles Checkout Pro payments

* Payrails creates a Mercado Pago checkout session for each authorize request. The customer picks the payment method on the Mercado Pago page.
* When Mercado Pago reports the payment, Payrails updates its payment method from `mercadoPago` to the method the customer used: `card`, `mercadoPagoWallet` for account balance, `mercadoPagoConsumerCredit` for Mercado Pago credit, `yape` or `pagoEfectivo`.
* For a card payment, Payrails also records the card network, type and issuer details that Mercado Pago returns.
* The checkout session stays open for the **Session Expiration Hours** set on your Mercado Pago integration, or 24 hours by default.
* The customer can retry inside the same checkout session. Payrails records the payment as successful when one of the attempts succeeds.
* Payrails captures Mercado Pago payments immediately, so a successful payment is final. Refunds work for the full amount or part of it.
* Payrails sends your `merchantReference` to Mercado Pago as the external reference of the payment.


## Related topics

- [Mercado Pago](https://docs.payrails.com/docs/integrations/payment-methods/mercadopago.md)
- [PagoEfectivo via Mercado Pago](https://docs.payrails.com/docs/integrations/payment-methods/pagoefectivo/mercadopago.md)
- [Yape via Mercado Pago](https://docs.payrails.com/docs/integrations/payment-methods/yape/mercadopago.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.