Fetching payment details from a Mercado Libre order with Orders API

When setting up order integration for your ERP middleware or similar integration, you may need additional payment details from orders placed in external marketplaces.

This article explains where our native Mercado Libre connector stores this information in the orderForm data structure and how to fetch this data for your integration.

Understanding customData

Checkout API allows integrators to create customizable fields in the shopping cart through the customData object. Their middleware can create extra fields in the orderForm and set the value of each of these fields when placing an order, so that this additional information can be retrieved when fetching order details with Orders API.

Custom fields created by Mercado Libre connector

Our native Mercado Libre connector leverages this functionality to add custom fields to orders, as seen in the code snippet below. Note: the actual orders data structure is much larger - we are omitting everything else and highlighting only customData in this example.

{
 ...
    "customData": {
        "customApps": [
            {
                "fields": {
                    "orderIdMarketplace": "4113970696",
                    "paymentIdMarketplace": "12040787637",
                    "authorization_code": "1234567",
                    "currency_id": "BRL",
                    "first_six_digits": "0",
                    "installments": "1",
                    "last_four_digits": "0",
                    "payment_method_id": "hipercard",
                    "payment_type": "credit_card"
                },
                "id": "marketplace-integration",
                "major": 1
            }
        ]
    },
 ...
}

The table below lists the customData fields created by the Mercado Libre connector.

Field

Description

orderIdMarketplace

Order identifier in Mercado Libre

paymentIdMarketplace

Payment identifiers in Mercado Libre

authorization_code

Authorization code for Mercado Libre payments

currency_id

ISO 4127 currency code

first_six_digits

Issuer Identification Number (IIN) of credit cards used in Mercado Libre payments

installments

Number of installments for Mercado Libre order

last_four_digits

Last four digits of credit cards used in Mercado Libre payments

payment_method_id

Payment method identifier in Mercado Libre

payment_type

Payment type identifier in Mercado Libre

🚧

Some fields may be missing from Mercado Libre

The default value returned is 0 if the payment method does not offer any data for authorization_code, first_six_digits, last_four_digits

Multiple payments

If there is an order that was payed for with more than one payment method, the data returned by Mercado Libre's Orders API is split by vertical bars (|) in the following fields:

  • paymentIdMarketplace
  • authorization_code
  • first_six_digits
  • last_four_digits
  • payment_method_id
  • payment_type
{
 ...
    "customData": {
        "customApps": [
            {
                "fields": {
                    "orderIdMarketplace": "893431118",
                    "paymentIdMarketplace": "885920310 | 885920410",
                    "authorization_code": "008877 | 211118",
                    "currency_id": "BRL",
                    "first_six_digits": "402360 | 512106",
                    "installments": "1",
                    "last_four_digits": "1001 | 2002",
                    "payment_method_id": "visa | master",
                    "payment_type": "credit_card | credit_card"
                },
                "id": "marketplace-integration",
                "major": 1
            }
        ]
    },
 ...
}

Did this page help you?