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.

Receive card payments

With Mercado Pago you can collect card information in a secure way through our Tokenizer.

Step 1: Add viewport data

Set the viewport by adding the following code inside the <head> tag of your website:


<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

Step 2: Add HTML code

This fragment of HTML code will insert a payment button. When the buyer presses the button, the checkout will be displayed. Include the following code in the place where the button will be located within your website:


<form action="" method="POST">

You can find the Public Key in the Credentials section page.

Find all the information about your credentials in our FAQs.

Step 3: Get the data

Web Tokenize Checkout will do a POST to the URL that you have defined in the action attribute of the HTML code snippet (In the example: /process-payment) with certain data. You must use this information to make the payment.


Data Description
token  Unique identifier of the tokenized card
payment_method_id Payment method chosen by the buyer
installments Amount of installments chosen by the buyer
issuer_id ID of the issuer of the buyer's card

You will not receive the transaction_amount neither the for security reasons.

  $token = $_REQUEST["token"];
  $payment_method_id = $_REQUEST["payment_method_id"];
  $installments = $_REQUEST["installments"];
  $issuer_id = $_REQUEST["issuer_id"];
String token = request.getParameter("token");
String payment_method_id = request.getParameter("payment_method_id");
Int installments = request.getParameter("installments");
Int issuer_id = request.getParameter("issuer_id");
const token = req.body.token;
const payment_method_id = req.body.payment_method_id;
const installments = req.body.installments;
const issuer_id = req.body.issuer_id;
token = request.body.token
payment_method_id = request.body.payment_method_id
installments = request.body.installments
issuer_id = request.body.issuer_id
token = Request["token"]
payment_method_id = Request["payment_method_id"]
installments = Request["installments"]
issuer_id = Request["issuer_id"]

Step 4: Creating the payment

To make the payment, you must perform an API call using the SDK de Mercado Pago that corresponds with the programming language that you are using on your site.

You should only make an API call including the data you received from the checkout:

    require_once 'vendor/autoload.php';

    $payment = new MercadoPago\Payment();
    $payment->transaction_amount = 155;
    $payment->token = $token;
    $payment->description = "Mediocre Wool Shirt";
    $payment->installments = $installments;
    $payment->payment_method_id = $payment_method_id;
    $payment->issuer_id = $issuer_id;
    $payment->payer = array(
    "email" => ""
    // Guarda y postea el pago
    // Imprime el estado del pago
    echo $payment->status;
Payment payment = new Payment();
       .setDescription("Mediocre Wool Shirt")
       .setPayer(new Payer()
// Save and create the payment;
// Shows payment stauts
var mercadopago = require('mercadopago');

var payment_data = {
  transaction_amount: 155,
  token: token,
  description: 'Mediocre Wool Shirt',
  installments: installments,
  payment_method_id: payment_method_id,
  issuer_id: issuer_id,
  payer: {
    email: ''

// Save and do the payment POST (data) {
  // ...    
  // Shows payment stauts
}).catch(function (error) {
  // ...

require 'mercadopago'
MercadoPago::SDK.access_token = "ENV_ACCESS_TOKEN";

payment =
payment.transaction_amount = 155
payment.token = token
payment.description = 'Mediocre Wool Shirt'
payment.installments = installments
payment.payment_method_id = payment_method_id
payment.issuer_id = issuer_id
payment.payer = {
  email: ""
# Save and create the payment

using MercadoPago;
using MercadoPago.DataStructures.Payment;
using MercadoPago.Resources;
// ...
Payment payment = new Payment()
    TransactionAmount = float.Parse("155"),
    Token = token,
    Description = "Mediocre Wool Shirt",
    Installments = installments,
    PaymentMethodId = payment_method_id,
    IssuerId = issuer_id,
    Payer = new Payer(){
        Email = ""
// Save and create the payment
// Shows payment stauts

The fields required to send are token, transaction_amount, payment_method_id and the



    "status": "approved",
    "status_detail": "accredited",
    "id": 3055677,
    "date_approved": "2017-02-23T00:01:10.000-04:00",
    "payer": {
    "payment_method_id": "master",
    "payment_type_id": "credit_card",
    "refunds": [],

Additional recommendations

Test cards

To make testing payments (with your TEST credentials), you need to use test cards.

Installments offer

We recommend you include the installments offer link of Mercado Pago, or implement one of our payment methods banner.

Your search returns no results.

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