Documentation Mercado Libre

Check out all the necessary information about APIs Mercado Libre.
circulos azuis em degrade

Documentation

Last update 26/11/2026

Submit serial numbers for a shipment

This guide explains how to submit serial numbers for a cross-border shipment from the United States to Mexico (US → MLM) and get its shipping label.


Authentication: Authorization: Bearer ACCESS_TOKEN


Overview


To import products in certain domains from the United States into Mexico, you must provide the serial number for each unit sold. This requirement applies to the domains configured for the US → MLM route.


The API issues the label for a covered shipment only after you provide all required serial numbers and they pass validation. A missing serial number prevents the API from generating the label.


On the US → MLM route, the domains that require serial numbers are MLM-TABLETS, MLM-GAME_CONSOLES, MLM-NOTEBOOKS, and MLM-E_READERS. Shipments from other domains continue to follow the current behavior.


Important:
Each order is identified by its order_id. The API reads the quantity, item, and domain from the shipment, so omit them from the request body.

Requirements

  • A valid seller access token, sent as Authorization: Bearer ACCESS_TOKEN.
  • The seller must own the shipment. The API verifies access before writing any data.
  • Each order_id you submit must belong to the shipment.

Complete workflow

Complete these three steps in order.


  1. Retrieve the shipment items with GET /items and check whether any line item includes required.
  2. If any line item requires a serial number, submit serial numbers for all covered orders with POST /attributes. If none do, skip to step 3.
  3. Get the shipping label with GET /labels.

Step 1. Retrieve shipment items

This endpoint retrieves the shipment items and shows which line items require a serial number.


Request

GET https://api.mercadolibre.com/marketplace/shipments/{shipment_id}/items

Headers

Header Value
Authorization Bearer ACCESS_TOKEN

Path parameters

Parameter Type Description
shipment_id string Shipment ID.

Example request

curl -X GET 'https://api.mercadolibre.com/marketplace/shipments/900000001/items' \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

[
  {
    "item_id": "MLM4618060596",
    "variation_id": 188900189598,
    "description": "Mochila De Halloween",
    "quantity": 2,
    "manufacturing_time": null,
    "dimensions": { "height": 20, "width": 20, "length": 20, "weight": 100 },
    "order_id": "2000000000000002",
    "sender_id": 3111236194,
    "domain_id": "MLM-BACKPACKS"
  },
  {
    "item_id": "MLM3815403475",
    "variation_id": null,
    "description": "Casco Rockbros Mtb Road Integral Moldeado A Prueba De Viento",
    "quantity": 1,
    "manufacturing_time": null,
    "dimensions": { "height": 10, "width": 16, "length": 26, "weight": 506 },
    "order_id": "2000000000000001",
    "sender_id": 3111236194,
    "domain_id": "MLM-CYCLING_SKATEBOARDING_AND_SKATING_HELMETS",
    "required": ["serial_number"]
  }
]

Key response fields

Field Description
order_id The order the line item belongs to.
item_id Item ID. Two different orders can share the same item_id and appear as separate line items.
quantity Number of units. Submit one serial number per unit when required.
domain_id Item domain, such as MLM-BACKPACKS. This field appears when the domain is available.
required This field appears with the value ["serial_number"] only for line items that require a serial number. If the field is absent, skip that line item in step 2.

Note:
The helmet order (2000000000000001) includes required, so submit one serial number. Skip the backpack order (2000000000000002) in step 2.

Step 2. Submit serial numbers

Submit serial numbers for all covered orders in the shipment in a single request.


Request

POST https://api.mercadolibre.com/marketplace/shipments/{shipment_id}/attributes

Headers

Header Value
Authorization Bearer ACCESS_TOKEN
Content-Type application/json

Path parameters

Parameter Type Description
shipment_id string Shipment ID. The shipment must belong to the authenticated seller.

Body

Field Type Required Description
orders array Yes One object for each covered order in the shipment. Include the full set of covered orders.
orders[].order_id string Yes ID of a covered order. The order must belong to the shipment.
orders[].serial_numbers array of strings Yes One serial number per unit in the order. The number of entries must match quantity.

Validation rules

  • Include exactly one entry for each order with required.
  • Provide one serial number for each unit in the order.
  • Serial numbers are free-form text. The API rejects null values, empty strings, and strings that contain only whitespace.
  • Each serial number must be unique across the shipment.
  • The API validates the entire request before saving any data. If validation fails, it saves no serial numbers.

Example request

In shipment 900000001, order 2000000000000001 contains one unit and requires one serial number.


curl -X POST 'https://api.mercadolibre.com/marketplace/shipments/900000001/attributes' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "orders": [
      {
        "order_id": "2000000000000001",
        "serial_numbers": ["SN-HELMET-0001"]
      }
    ]
  }'

Response

204 No Content confirms that the API saved the serial numbers. You can now request the shipping label.


Example with multiple units

If the order contains three units, provide three distinct serial numbers in the same entry.


Request

POST https://api.mercadolibre.com/marketplace/shipments/{shipment_id}/attributes

Example request

curl -X POST 'https://api.mercadolibre.com/marketplace/shipments/900000002/attributes' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "orders": [
      {
        "order_id": "2000000000000003",
        "serial_numbers": ["SN-HELMET-001", "SN-HELMET-002", "SN-HELMET-003"]
      }
    ]
  }'

Response

204 No Content.


Step 3. Get the shipping label

Request the shipping label after completing step 2, if applicable. The API issues the label once it has all required serial numbers and returns an error if any are missing.


Request

GET https://api.mercadolibre.com/marketplace/shipments/{shipment_id}/labels

Headers

Header Value
Authorization Bearer ACCESS_TOKEN

Path parameters

Parameter Type Description
shipment_id string Shipment ID.

Example request

curl -X GET 'https://api.mercadolibre.com/marketplace/shipments/900000001/labels' \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

The shipping label is ready to print.


Error response

If a required serial number is missing, the API returns 400 Bad Request without a shipping label.


{
  "message": "shipment is missing valid serial numbers",
  "error": "bad_request",
  "status": 400,
  "cause": ["serial_number is required"]
}

End-to-end example

Shipment 900000001 contains two orders. Only the helmet order requires a serial number.


1. Retrieve shipment items

curl -X GET 'https://api.mercadolibre.com/marketplace/shipments/900000001/items' \
  -H 'Authorization: Bearer ACCESS_TOKEN'

The helmet order (2000000000000001) includes "required": ["serial_number"].


2. Submit the helmet serial number

curl -X POST 'https://api.mercadolibre.com/marketplace/shipments/900000001/attributes' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "orders": [
      { "order_id": "2000000000000001", "serial_numbers": ["SN-HELMET-0001"] }
    ]
  }'

The API returns 204 No Content.


3. Get the shipping label

curl -X GET 'https://api.mercadolibre.com/marketplace/shipments/900000001/labels' \
  -H 'Authorization: Bearer ACCESS_TOKEN'

The API returns a print-ready shipping label.


Troubleshooting

POST /attributes errors

Cause (cause) What it means How to fix it
order does not belong to covered shipment items The order_id belongs to a different shipment or identifies an order outside the scope of the serial number requirement. Use step 1 to verify the order_id.
serial number count must match item quantity The number of serial numbers differs from quantity. Submit one serial number per unit.
Empty or whitespace-only serial number The value is invalid. Submit text containing at least one non-whitespace character.
Duplicate serial number The same value appears more than once in the shipment. Use a unique serial number for each unit.
Duplicate or missing order A covered order is missing an entry or appears twice. Submit exactly one entry per covered order.

Example response

{
  "message": "invalid serial numbers request",
  "error": "bad_request",
  "status": 400,
  "cause": ["order does not belong to covered shipment items"]
}

GET /labels errors

Cause What it means How to fix it
serial_number is required A covered item is missing a serial number. Submit the serial number in step 2, then request the shipping label again.

Warning:
If the POST request returns a 400 error, the API saves no serial numbers. Correct the request body and resubmit the complete set of serial numbers for the shipment.

Frequently asked questions

Do I need to submit serial numbers for every order in the shipment?

Include only covered orders, which are the ones with required in step 1.


Can I submit serial numbers one at a time?

The POST request must include all serial numbers for all covered orders in the shipment in a single request.


What if I submitted an incorrect serial number?

Resubmit the complete set of serial numbers with the corrected value. The API reconciles the submitted values with the ones already on file.


What if a shipment has no covered items?

Skip the POST request and request the shipping label directly.


Can I request the shipping label while I submit serial numbers?

Wait for the POST request to return 204. If you request the label before then, the API returns a missing serial number error.