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.

MercadoPago SDK for Java

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

Supported Java Versions:

This SDK supports Java version 8 or newer.


Using Maven

  1. Append MercadoPago dependencies to pom.xml


            <groupId> com.mercadopago </groupId>
            <artifactId> dx-java </artifactId>
            <version> 1.2.1 </version>
  1. Run mvn install and thats all, you have Mercado Pago SDK installed.


Our SDK is compatible with Java 6 or grater. Our development team recomends to use Java 8 or newer versions.

Quick Start

  1. Import Mercado Pago basic clases. import import com.mercadopago.*;
  2. Setup your credentials.
    • For Checkout Mercado Pago: java MercadoPago.SDK.setClientSecret("CLIENT_SECRET_OK"); MercadoPago.SDK.setClientId("CLIENT_ID_OK");
    • For API or Custom-checkout: java MercadoPago.SDK.setAccessToken("ACCESS_TOKEN");
  3. Using Resource objects.

SDK resource structure of Mercado Pago



  import com.mercadopago.*;
  import com.mercadopago.exceptions.MPConfException;
  import com.mercadopago.exceptions.MPException;
  import com.mercadopago.resources.Payment;
  import com.mercadopago.resources.datastructures.payment.Payer;

  public class Main {

      public static void main(String[] args)throws MPException, MPConfException {


          Payment payment = new Payment()
                  .setPayer(new Payer()




Your search returns no results.

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