Recommendations to improve payments approval - How to improve payment approval - Mercado Pago Developers
Which documentation are you looking for?

Do not know how to start integrating? 

Check the first steps

Recommendations to improve payments approval

To prevent a legitimate payment from being refused because it does not meet the security validations, it is necessary to include all possible information when carrying out the transaction, as well as having your checkout’s interface optimized.

You can see our recommendations to improve your approval in detail below.

Get and send the Device ID

The Device ID is an important piece of information to ensure better security and, consequently, a better payment approval rate. It's a unique number that's used to identify a customer's device when they are buying.

If a customer makes a purchase on a different device than usual, this may represent an atypical behaviour. Even if it’s not necessarily a fraude, the Device ID could help us to make a correct assessment and avoid legitimate payment rejections.

If you are already using the JS SDK of Mercado Pago, it won’t be necessary to add the security script because the Device ID information is already being collected.

Add the Mercado Pago security script to your page by replacing the view value with the name of the section in which you wish to add it. Adding it to your checkout URL is the most important, but doing it in other pages, such as home, search or item, may be helpful to collect even more information.


<script src="" view="home"></script>
In case of unavailable value for a section, leave it empty.

Implement the Device ID in your site

To use the Device ID on your web and prevent possible fraudulent purchases, follow the steps below:

1. Add the security code

To generate device IDs on your website, add the following code to your Checkout page:


<script src="" view="checkout"></script>

2. Getting the device ID

When you add the Mercado Pago security code to your site, a global JavaScript variable is automatically created with the name MP_DEVICE_SESSION_ID, whose value is the device ID.

If you prefer that we assign it to another variable, indicate the name by adding the attribute output, as in the following example:


<script src="" view="checkout" output="deviceId"></script>

You can also create your own variable by adding an HTML tag on your site as id="deviceId" and the code will automatically assign the value device_id.


<input type="hidden" id="deviceId">

3. Use the device ID

Once you have the Device ID, you must send it to our servers when creating a payment. To do so, simply add the following header to the request:


X-meli-session-id: device_id
Remember to replace device_id with the name of the variable that contains your Device ID value.

Implement the Device ID in your native mobile application

If you have a native application, you can capture the device information with our SDK and send it when creating the token. Follow these steps:

1. Add dependency

Add the following code in the Podfile file.

pod ‘MercadoPagoDevicesSDK’


You need to add the repository and the dependency in the build.gradle file.

repositories {
    maven {
        url ""
dependencies {
   implementation ''


2. Initialize module

We recommend initializing it in the didFinishLaunchingWithOptions event of the AppDelegate.

import MercadoPagoDevicesSDK
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {


We recommend initializing it in the didFinishLaunchingWithOptions event of the AppDelegate.

@import ‘MercadoPagoDevicesSDK’;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[MercadoPagoDevicesSDK shared] execute];


We recommend initializing it in the MainApplication class.



3. Capture information

Execute one of these functions to obtain the information in the format that you prefer.

MercadoPagoDevicesSDK.shared.getInfo() // Returns a Codable Device Object
MercadoPagoDevicesSDK.shared.getInfoAsJson() // Returns a JSON Library Data Object
MercadoPagoDevicesSDK.shared.getInfoAsJsonString() // Returns a JSON String
MercadoPagoDevicesSDK.shared.getInfoAsDictionary() // Returns a Dictionary<String,Any>

[[[MercadoPagoDevicesSDK] shared] getInfoAsJson] // Returns a JSON Library Data Object
[[[MercadoPagoDevicesSDK] shared] getInfoAsJsonString] // Returns a JSON String
[[[MercadoPagoDevicesSDK] shared] getInfoAsDictionary] // Returns a Dictionary<String,Any>

Device device = DeviceSDK.getInstance().getInfo() // Returns a Serializable Device Object
Map deviceMap = DeviceSDK.getInstance().getInfoAsMap()  // Returns a Map<String, Object>
String jsonString = DeviceSDK.getInstance().getInfoAsJsonString() // Returns a JSON String


4. Send information

Finally, send the information in the device field when creating the card_token.


            "device_name":"iPhone Simulator",
            "device_model":"iPhone Simulator",

Detail all information about the payment

To optimize payment security validation and improve approvals, it is important to submit as much buyer and item data as possible. You can check all the available attributes when creating a payment by using the Create payment method. Pay special attention to the attributes present in adicional_inf, such as:

  • Buyer’s data,
  • Product data,
  • Shipping data.

There are also some extra fields that can be sent depending on the branch of activities or industry of your store. You can find details of every branch and the buyer and shipping data that we recommend to include for each of them here.

Improve the User Experience

Often, the buyer can make mistakes when filling in their details at checkout. That's why it's worth reviewing every step, interaction, and even the interface design, to ensure everything is as clear as it should be.

In case you wish to create your front-end from scratch, you can find some advice on how to do so in an efficient way here. If a payment is rejected, it is also important to explain to your customers why and what they can do to fix it. By doing so, your clients would have all the information they need to pay without any further problems. You can find some recommendations on how to inform the main rejection reasons here.

In case you wish to guarantee an optimized interface, you can use the visual components of Checkout Bricks, and also use a predefined visual component with the best messages with Status Screen Brick.

We recommend assessing your integration’s quality before going to production to check if you are meeting the Mercado Pago quality and security standards that would help you obtain a good payment approval rate.