Skip to content
Mercado Pago's Official PHP SDK
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
img Improving readme (#141) Mar 11, 2019
samples Options on calls support (#155) Apr 8, 2019
src/MercadoPago Update Version Jan 2, 2020
tests Options on calls support (#155) Apr 8, 2019
.travis.yml Fixing tests [WIP] (#114) Dec 18, 2018
LICENSE Create LICENSE Jun 13, 2018 Update Mar 14, 2019
phpunit.phar add test for pre_approval entity Sep 5, 2018
phpunit.xml fixed phpunit testing Jun 6, 2017

Mercado Pago SDK for PHP

Build Status

This library provides developers with a simple set of bindings to the Mercado Pago API.

PHP Versions Supported:

The SDK supports PHP 5.6 or major


Using Composer

  1. Download Composer if not already installed
  2. Go to your project directory and run composer require "mercadopago/dx-php:1.2.1" on the command line.
  3. This how your directory structure would look like.
  4. Thats all, you have Mercado Pago SDK installed.


Quick Start

  1. You have to require the library from your Composer vendor folder.
require __DIR__  . '/vendor/autoload.php';
  1. Setup your credentials

You have two types of credentials:

  • For API or custom checkout:
    MercadoPago\SDK::setAccessToken("YOUR_ACCESS_TOKEN");      // On Production
    MercadoPago\SDK::setAccessToken("YOUR_TEST_ACCESS_TOKEN"); // On Sandbox
  • For Web-checkout:
  1. Using resource objects.

You can interact with all the resources available in the public API, to this each resource is represented by classes according to the following diagram:

sdk resource structure


    require __DIR__  . '/vendor/autoload.php';


    $payment = new MercadoPago\Payment();

    $payment->transaction_amount = 141;
    $payment->token = "YOUR_CARD_TOKEN";
    $payment->description = "Ergonomic Silk Shirt";
    $payment->installments = 1;
    $payment->payment_method_id = "visa";
    $payment->payer = array(
      "email" => ""
    echo $payment->status;


Write us at

You can’t perform that action at this time.