Mercado Pago

Mercado Pago is a payment gateway and digital wallet service. With Mercado Pago, customers can enjoy a seamless checkout experience, with a choice of different payment methods including card upfront payments, card installments and wallet.

Introduction

Mercado Pago is a widely used payment gateway and wallet solution in Latin America that offers a convenient and secure way for customers to pay for goods and services. Integrating Mercado Pago with Payrails allows you to provide a fast, easy-to-use payment option for your customers while leveraging our platform to route the payment to any Payment Service Provider (PSP). This guide will explain the process of integrating MercadoPago into your app or website using Payrails.

Payrails \<-> Mercado Pago workflow

Payrails <-> Mercado Pago workflow

Pre-requisites

In order to start using MercadoPago with Payrails, you must:

  1. Integrate with Payrails using one of our SDKs or our API
  2. Configure a new integration account for Mercado Pago.
  3. Enable Generic Redirect as a payment option.
  4. Make sure you're sending the MercadoPago-specific meta fields (found under Merchant configurations -> Meta fields on your Payrails dashboard and in the examples below) in your requests.

Ways to integrate Mercado Pago

Payrails SDK

The simplest way to use MercadoPago with Payrails is to use our drop-in in your checkout flow. With this integration type, no additional work is required to accept payments with MercadoPago except for handling success/failure screens for your users.

For a more flexible implementation using our SDK, you can use our MercadoPago's (genericRedirectButton) element. See special instructions here for your client-side implementation.

Server-to-server integration

You also have the option to completely manage your own client-side implementation, and use Payrails APIs with a server-to-server integration to process payments with MercadoPago. With this approach, follow the documentation below to build Mercado Pago into your applications:

Parse Mercado Pago from lookup response

With a server-to-server integration, you can call our lookup payment options endpoint to get available payment options and relevant configurations for each payment method. As the example below, you can see genericRedirect returned as an option of the paymentCompositionOptions. You can use this value later to authorize payments with Payrails as you can see in the next sections.

{
    "name": "lookup",
    "actionId": "0bb6413e-cabb-4074-99e6-9e815c69f25b",
    "executedAt": "2024-05-08T12:33:21.527395295Z",
    "data": {
        "paymentCompositionOptions": [
            {
                "integrationType": "api",
                "paymentMethodCode": "genericRedirect",
                "description": "GenericRedirect"
            }
        ]
    },
    "links": {
        "execution": "http://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/83c534ac-13b7-43e6-b04b-f3e8b4eb4424",
        "authorize": {
            "method": "POST",
            "href": "http://payrails-api.staging.payrails.io/merchant/workflows/payment-acceptance/executions/83c534ac-13b7-43e6-b04b-f3e8b4eb4424/authorize"
        }
    }
}

Pass Mercado Pago payment method in request to authorize payment with Payrails

You can then make a request to our authorize a payment endpoint with genericRedirect as the paymentMethodCode. See an example below:

{
  "executionId": "c0fd1c51-e709-47e5-bfd1-5d1c98f7d990",
  "amount": {
    "value": "1000",
    "currency": "ARS"
  },
  "paymentComposition": [{
    "integrationType": "api",
    "paymentMethodCode": "genericRedirect",
    "amount": {
      "value": "1000",
      "currency": "ARS"
    }
  }],
  "meta": {
    "order": {
      "lines": [{
        "id": "UUID",
        "name": "Order Name",
        "quantity": 1,
        "unitPrice": {
          "currency": "ARS",
          "value": "1000"
        }
      }]
    }
  },
  "returnInfo": {
    "success": "https://mysuccessurl.com",
    "error": "https://myerrorurl.com"
  }
}

Supported payment methods and regions / countries

Payment methodRegion(s)Countries
Cards (including Installments)South America (Latam)🇦🇷 Argentina, 🇧🇷 Brazil, 🇨🇱 Chile,
🇨🇴 Colombia, 🇲🇽 Mexico, 🇵🇪 Peru,
🇺🇾 Uruguay
WalletSouth America (Latam)🇦🇷 Argentina, 🇧🇷 Brazil, 🇨🇱 Chile,
🇨🇴 Colombia, 🇲🇽 Mexico, 🇵🇪 Peru,
🇺🇾 Uruguay

Supported workflows and services

WorkflowSupported
Available via Payrails SDK✔️
Available via Payrails API✔️
Delayed / Manual Capture✖️
Instant Capture✔️
Cancel / Void✖️
Refund / Reverse✔️
Save Instruments✔️ (on Mercado Pago side)
Merchant Initiated Transaction (MIT)✖️
Interoperability✖️