Documentation
Feedback
Guides
API Reference

Guides
Getting Started

Integration Guides



Payments

Orders

VTEX inStore

UI Customization

Message Center

Promotions

Infrastructure

Conversational Commerce

Subscriptions

Search

Pricing

VTEX Session

Orders
Actions in orders
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.

FieldDescription
orderIdMarketplaceOrder identifier in Mercado Libre
paymentIdMarketplacePayment identifiers in Mercado Libre
authorization_codeAuthorization code for Mercado Libre payments
currency_idISO 4127 currency code
first_six_digitsIssuer Identification Number (IIN) of credit cards used in Mercado Libre payments
installmentsNumber of installments for Mercado Libre order
last_four_digitsLast four digits of credit cards used in Mercado Libre payments
payment_method_idPayment method identifier in Mercado Libre
payment_typePayment type identifier in 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 } ] }, ... }
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Fetching marketplace information with the Orders API
Formatting order invoicing time via API
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page