Recommendations to improve approval
To prevent a legitimate payment from being rejected for not meeting security validations, you need to include as much information as possible when performing the operation and ensure your checkout has an optimized interface.
Check out our recommendations to improve your approval rate.
The Device ID is important information to ensure better security and, consequently, a better payment approval rate. It is a unique identifier for each buyer's device at the time of purchase.
When a frequent buyer makes a purchase from a different device than usual, this might be seen as atypical behavior. Although it is not necessarily fraud, the Device ID helps us refine our evaluation and prevent us from rejecting legitimate payments.
To use Device ID on web and prevent possible fraudulent purchases, follow these steps:
1. Add Mercado Pago's security script
To implement Device ID generation on your site, add this script to your checkout page:
html
<script src="https://www.mercadopago.com/v2/security.js" view="checkout"></script>
view value with the name of the section where you want to add it, such as home or search, for example. This helps to enrich the information collected for generating the Device ID.2. Get the Device ID
When you've added Mercado Pago's security script to your site, a Javascript global variable called MP_DEVICE_SESSION_ID will be automatically created, containing the Device ID.
If you prefer to use another variable, you can specify the name by adding the output attribute to the security script, like this:
html
<script src="https://www.mercadopago.com/v2/security.js" view="checkout" output="deviceId"></script>
You can also create your own variable. Just add an html tag to your site with the identifier id="deviceID", like this:
html
<input type="hidden" id="deviceId">
3. Use the Device ID
Once you have the Device ID value, you need to send it to our servers when creating a payment. It is very simple: just add this header to your request:
html
X-meli-session-id: device_id
device_id with the name of the variable where you stored your Device ID value.To optimize payment security validation and improve approvals, it is important to send as much data as possible about the buyer and the product.
Take a look at all the attributes you can send when creating an orderAPI, especially the additional information (additional_info), such as buyer data, product details, and shipping information.
There are also extra fields you can send based on your business sector. You can see more details about each sector and the data we recommend including in the Industry Data documentation.
Sometimes buyers can make mistakes when filling in their information at checkout. That's why it is good to review each step, the interactions, and even the design, to make sure everything is as clear as possible.
If a payment is rejected, it is important to explain to your customers why it was rejected and what they can do to fix it. This way, they'll have all the information they need to pay without problems.
