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.
_23{_23 ..._23 "customData": {_23 "customApps": [_23 {_23 "fields": {_23 "orderIdMarketplace": "4113970696",_23 "paymentIdMarketplace": "12040787637",_23 "authorization_code": "1234567",_23 "currency_id": "BRL",_23 "first_six_digits": "0",_23 "installments": "1",_23 "last_four_digits": "0",_23 "payment_method_id": "hipercard",_23 "payment_type": "credit_card"_23 },_23 "id": "marketplace-integration",_23 "major": 1_23 }_23 ]_23 },_23 ..._23}
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 |
The default value returned is
0
if the payment method does not offer any data forauthorization_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
_23{_23 ..._23 "customData": {_23 "customApps": [_23 {_23 "fields": {_23 "orderIdMarketplace": "893431118",_23 "paymentIdMarketplace": "885920310 | 885920410",_23 "authorization_code": "008877 | 211118",_23 "currency_id": "BRL",_23 "first_six_digits": "402360 | 512106",_23 "installments": "1",_23 "last_four_digits": "1001 | 2002",_23 "payment_method_id": "visa | master",_23 "payment_type": "credit_card | credit_card"_23 },_23 "id": "marketplace-integration",_23 "major": 1_23 }_23 ]_23 },_23 ..._23}