Suggest edit
Help us improve the documentation
Did you see wrong information and would you like us to explain something else or improve our manuals? Please leave your suggestions on GitHub.

Integrate other payment methods

With Mercado Pago payment API, you can add alternative payment methods for your customers to make their payments.

Payment Methods

In addition to cards, you can offer other payment choices on your website.

Type of payment method Payment method
ticket Boleto
ticket Pagamento em lotérica

Check the available payment methods

You can check the available payment methods whenever you need.

<?php

  MercadoPago\SDK::setAccessToken("ENV_ACCESS_TOKEN");

  $payment_methods = MercadoPago::get("/v1/payment_methods");

?>
var mercadopago = require('mercadopago');
mercadopago.configurations.setAccessToken(config.access_token);

payment_methods = mercadopago.get("/v1/payment_methods");
import com.mercadopago.*;
MercadoPago.SDK.configure("ENV_ACCESS_TOKEN");

payment_methods = MercadoPago.SDK.get("/v1/payment_methods");

require 'mercadopago'
MercadoPago::SDK.configure(ACCESS_TOKEN: ENV_ACCESS_TOKEN)

payment_methods = MercadoPago::SDK.get("/v1/payment_methods")

using MercadoPago;
MercadoPago.SDK.SetAccessToken = "ENV_ACCESS_TOKEN";

payment_methods = MercadoPago.SDK.get("/v1/payment_methods");

curl -X GET \
    -H 'accept: application/json' \
    -H 'content-type: application/json' \
    'https://api.mercadopago.com/v1/payment_methods?access_token=ENV_ACCESS_TOKEN' \


The result will be a list of payment methods and their features. For example, payment_type_id payment methods with ticket as value refer to cash payment method.

Json

[
    {
        "id": "bolbradesco",
        "name": "Boleto",
        "payment_type_id": "ticket",
        "status": "active",
        "secure_thumbnail": "https://www.mercadopago.com/org-img/MP3/API/logos/bolbradesco.gif",
        "thumbnail": "http://img.mlstatic.com/org-img/MP3/API/logos/bolbradesco.gif",
        "deferred_capture": "does_not_apply",
        "settings": [],
        "additional_info_needed": []
    },
    {
        "id": "pec",
        "name": "Pagamento na lotérica sem boleto",
        "payment_type_id": "ticket",
        "status": "active",
        "secure_thumbnail": "https://www.mercadopago.com/org-img/MP3/API/logos/pec.gif",
        "thumbnail": "https://www.mercadopago.com/org-img/MP3/API/logos/pec.gif",
        "deferred_capture": "supported",
        "settings": [],
        "additional_info_needed": []
    },
    {
        "...": "..."
    }
]

For more information, check API References.

Receive payments with boleto or lotérica

To receive payments with boleto or lotérica, you just have to send the amount, the payment method, the identification data and the buyer's address.

<?php

 require_once 'vendor/autoload.php';

 MercadoPago\SDK::setAccessToken("ENV_ACCESS_TOKEN");

 $payment = new MercadoPago\Payment();
 $payment->transaction_amount = 100;
 $payment->description = "Product Title";
 $payment->payment_method_id = "bolbradesco";
 $payment->payer = array(
     "email" => "test@test.com",
     "first_name" => "Test",
     "last_name" => "User",
     "identification" => array(
         "type" => "CPF",
         "number" => "19119119100"
      ),
     "address"=>  array(
         "zip_code" => "06233200",
         "street_name" => "Av. das Nações Unidas",
         "street_number" => "3003",
         "neighborhood" => "Bonfim",
         "city" => "Osasco",
         "federal_unit" => "SP"
      )
   );

 $payment->save();

?>
var mercadopago = require('mercadopago');
mercadopago.configurations.setAccessToken(config.access_token);

var payment_data = {
  transaction_amount: 100,
  description: 'Product Title',
  payment_method_id: 'bolbradesco',
  payer: {
    email: 'test@test.com',
    first_name: 'Test',
    last_name: 'User',
    identification: {
        type: 'CPF',
        number: '19119119100'
    },
    address:  {
        zip_code: '06233200',
        street_name: 'Av. das Nações Unidas',
        street_number: '3003',
        neighborhood: 'Bonfim',
        city: 'Osasco',
        federal_unit: 'SP'
    }
  }
};

mercadopago.payment.create(payment_data).then(function (data) {

}).catch(function (error) {

});

import com.mercadopago.*;

MercadoPago.SDK.configure("ENV_ACCESS_TOKEN");

Payment payment = new Payment();

payment.setTransactionAmount(100f)
       .setDescription('Product Title')
       .setPaymentMethodId("bolbradesco")
       .setPayer(new Payer()
           .setEmail("test@test.com")
           .setFirstName("Test")
           .setLastName("User")
           .setIdentification(new Identification()
               .setType("CPF")
               .setNumber("19119119100"))
           .setAddress(new Address()
               .setZipCode("06233200")
               .setStreetName("Av. das Nações Unidas")
               .setStreetNumber(3003)
               .setNeighborhood("Bonfim")
               .setCity("Osasco")
               .setFederalUnit("SP"))
);

payment.save();
require 'mercadopago'
MercadoPago::SDK.configure(ACCESS_TOKEN: ENV_ACCESS_TOKEN)

payment_data = {
  transaction_amount: 100,
  description: "Product Title",
  payment_method_id: "bolbradesco",
  payer: {
    email: "test@test.com",
    first_name: "Test",
    last_name: "User",
    identification: {
        type: "CPF",
        number: "191191191-00"
    },
    address: {
        zip_code: "06233-200",
        street_name: "Av. das Nações Unidas",
        street_number: "3003",
        neighborhood: "Bonfim",
        city: "Osasco",
        federal_unit: "SP"
    }
  }
}

payment.save()

using MercadoPago;
using MercadoPago.DataStructures.Payment;
using MercadoPago.Resources;

MercadoPago.SDK.SetAccessToken("ENV_ACCESS_TOKEN");

Payment payment = new Payment()
{
    TransactionAmount = float.Parse("105"),
    Description = "Product Title",
    PaymentMethodId = "bolbradesco",
    Payer = new Payer(){
        Email = "test@test.com",
        FirstName = "Test",
        LastName = "User",
        Identification = new Identification(){
            Type = "CPF",
            Number = "191191191-00"
        },
        Address = new Address(){
            ZipCode = "06233-200",
            StreetName = "Av. das Nações Unidas",
            StreetNumber = "3003",
            Neighborhood = "Bonfim",
            City = "Osasco",
            FederalUnit = "SP"

        }
    }
};

payment.Save();

curl -X POST \
    -H 'accept: application/json' \
    -H 'content-type: application/json' \
    'https://api.mercadopago.com/v1/payments?access_token=ENV_ACCESS_TOKEN' \
    -d '{
      "transaction_amount": 100,
      "description": "Product Title",
      "payment_method_id": "bolbradesco",
      "payer": {
        "email": "test@test.com",
        "first_name": "Test",
        "last_name": "User",
        "identification": {
            "type": "CPF",
            "number": "19119119100"
        },
        "address": {
            "zip_code": "06233200",
            "street_name": "Av. das Nações Unidas",
            "street_number": "3003",
            "neighborhood": "Bonfim",
            "city": "Osasco",
            "federal_unit": "SP"
        }
      }
    }'


The response will show pending status until the buyer makes the payment. The payment voucher ID is the same as the Mercado Pago transaction ID.

Json

[
{
    ...,
    "id": 5466310457,
    "status": "pending",
    "status_detail": "pending_waiting_payment",
    ...,
    "transaction_details": {
        "net_received_amount": 0,
        "total_paid_amount": 100,
        "overpaid_amount": 0,
        "external_resource_url": "http://www.mercadopago.com/mlb/payments/ticket/helper?payment_id=123456789&payment_method_reference_id= 123456789&caller_id=123456",
        "installment_amount": 0,
        "financial_institution": null,
        "payment_method_reference_id": "1234567890"
    }
}
]

In the external_resource_url field you will find an address with payment instructions for your buyer. You can redirect or send him/her the link.

Note

Customers have 3 to 5 days to pay, depending on the payment method. After that, you should cancel it.

Expiration date for boleto

The default expiration date for boleto payments is 3 days. If you want, you can change this date by sending the date_of_expiration field in the payment creation request. The configured date must be between 1 and 30 days from the issue date.

The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz

$payment->date_of_expiration = "2020-05-30T23:59:59.000-04:00";

The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz

date_of_expiration: "2020-05-30T23:59:59.000-04:00",

The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz

payment.setDateOfExpiration("2020-05-30T23:59:59.000-04:00")

The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz

date_of_expiration: "2020-05-30T23:59:59.000-04:00",

The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz

payment.DateOfExpiration = DateTime.Parse("2020-05-30T23:59:59.000-04:00");

The date uses the ISO 8601 format: yyyy-MM-dd'T'HH:mm:ssz

"date_of_expiration": "2020-05-30T23:59:59.000-04:00",

The deadline for approval of the boleto is up to 48 working hours. Therefore, we recommend that you set the due date with at least 3 days to ensure that payment is made.

Important

If the boleto is paid after the expiration date, the amount will be refunded to the payer's Mercado Pago account.

Cancel payments

To avoid collection issues, you need to cancel expired payments. Cash payments should be paid within 3 to 5 business days, based on their relevant term.

Take into account that you can only cancel payments in process or pending status. If a payment expires after 30 days, the cancellation is automatic and the final status will be cancelled or expired.

For more information, check the Refunds and Cancellations section.

Payment credit times

Each payment method has its own credit times; it is immediate in some cases, while in others, it may take up to 3 business days.

Check credit times by payment method whenever you need to.


Next steps

Your search returns no results.

Verifique a ortografia de termos de pesquisa ou teste com outras palavras-chave.