Domestic Auth

Overview

This endpoint enables carriers to approve domestic shipments (inside one country). It interfaces with the carrier systems to verify that a package has been accepted and to retrieve tracking numbers.

Key Features

  • Idempotency: Sending the same request twice returns the same tracking number
  • OAuth 2.0: Secure authentication with bearer tokens
  • Performance: Average response time under 1 second
  • Scalability: Handles high-volume shipment requests
  • Variable Data Length and Carrier Responsibility: Mercado Libre will send data fields with variable lengths, which may change over time. It is the carrier's responsibility to truncate this data as necessary to meet their specific storage requirements.

Mercado Libre is expected to receive a result, based on the "Status Code" section, that reflects whether the authorization was successful. If an error occurs, the system will automatically retry the communication following the retry schema established during the integration process.

Important: The Tracking Number of any shipment must only change on “n” authorizations if, and only if, a cancellation was previously requested.

HTTP Request

bash
1POST {url}/shipments/{shipment_id}/authorization 2--header 'Content-Type: application/json' 3--header 'Authorization: Bearer <access_token>' 4 --data-raw '{ 5  "id": 2000005041469149431, 6 "transport_order_id": "ec4beec0-54d8-5066-a82d-3baa11649451", 7 "direction": "forward", 8 "test": false, 9 "carrier_information": { ... }, 10 "shipment_information": { ... }, 11 "authorization_information": { ... } 12 }'

Authentication

All requests require OAuth 2.0 Bearer token authentication. Include your access token in the Authorization header:

bash
1Authorization: Bearer YOUR_ACCESS_TOKEN

Request Parameters

Headers parameters

Name
Value
Description
Content-Typeapplication/jsonExpected media type of the resource.
AuthorizationBearer <access_token>Token generated (see OAuth 2.0 )

Body Parameters

Root level fields

These are the top-level fields in the authorization request:

Name
Data type
Description
Field presence in every request
idLongUnique identifier of the shipment used by Mercado Libre, required to authorize. This ID will later be used to notify the events that occur in the operational flow of the shipment.Always present in the request
transport_order_idStringUnique identifier for the transport leg. This field is used to guarantee idempotencyAlways present in the request
directionStringShipment direction. Values: forward (seller→buyer) or return (buyer→seller)Optional
testBooleanIndicates that the request sent is for testingOptional
keywordStringThe HASH (SHA256) of a secret word. The value of this parameter can be empty. If a value is present, the Carrier must request the secret word from the receiver of the package.Conditional
carrier_informationObjectCarrier contract and agency informationOptional
shipment_informationObjectSender, receiver, and package detailsOptional
requirementsObjectPickup and delivery requirements, among othersConditional

Carrier Information

Carrier contract and agency details for the shipment:

Name
Data type
Description
Field presence in every request
contractStringIdentifies the contract / service defined by the carrier with which the shipment is to be authorized. For example, home delivery from XD, shipment to DS agency, etc.Optional
agencyObjectContains information related to the destination agency. Mandatory only when it is a shipment to a carrier agency.Optional

Agency Object

Name
Data type
Description
Field presence in every request
idStringId given by Mercado Libre to the agency.Optional

Shipment Information

Container object for sender, receiver, and package details:

Name
Type
Description
Field presence in every request
senderObjectShipment sender information (name, phone, address)Always present in the request
receiverObjectShipment receiver information (name, phone, address)Always present in the request
packageObjectItems, dimensions, and package valueAlways present in the request

Sender & Receiver

Complete user information for both sender and receiver. All fields are set when the user object exists:

Name
Data type
Description
Field presence in every request
full_nameStringFull name or company nameAlways present in the request
first_nameStringFirst nameAlways present in the request
last_nameStringLast nameAlways present in the request
phoneObjectContact phone information (number)Always present in the request
addressObjectComplete address detailsAlways present in the request

Phone Object

Name
Data type
Description
Field presence in every request
numberStringPhone number. Only numbers.Always present in the request

Identification

Name
Data type
Description
Field presence in every request
typeStringUser Identification Type (it may vary depending on the country)Always present in the request
numberStringUser identification numberAlways present in the request

Address Fields

Complete address information for sender and receiver.

Field
Data type
Description
Field presence in every request
street_nameStringStreet name. Example: Main StreetOptional
street_numberStringStreet number. Example: 123Optional
intersectionStringSecondary street, intersection or additional referenceOptional
address_lineStringContains the street_name and street_number fields dataAlways present in the request
commentStringSpecial delivery instructions. Example: Ring bell 3 timesOptional
zip_codeStringRequired in: Argentina, Brazil, Mexico, Peru. Optional in: Colombia, Uruguay, Chile, EcuadorAlways present in the request (for detailed countries)
cityObjectCity localization (id, name)Always present in the request
stateObjectState/Province localization (id, name)Always present in the request
countryObjectCountry localization (id, name)Always present in the request
neighborhoodObjectNeighborhood/locality localization (id, name)Optional
municipalityObjectMunicipality localization (id, name)Optional
geolocationObjectGeographic coordinates (latitude, longitude, source)Optional
facility_idStringFacility identifier (for pickups or delivery at facilities)Optional

Localization Object

Used for city, state, country, neighborhood, municipality:

Name
Data type
Description
Field presence in every request
idStringLocalization identifier provided by Mercado Libre. Format ISO 3166.Optional
nameStringLocalization nameOptional

Geolocation Object

Field
Type
Description
Field presence in every request
geolocation_typeStringIt can be one of the following values: APPROXIMATE: approximate geolocation. GEOMETRIC_CENTER: locates the center of a region that is used as a reference. RANGE_INTERPOLATED: restricts precision to the midpoint of 2 nearby reference points. ROOFTOP: indicates that the location is exact. UNKNOWN: indicates that the location was not validated.Always present in the request
latitudeDoubleGeographic latitude in number format with 8 decimal places.Always present in the request
longitudeDoubleGeographic longitude in number format with 8 decimal places.Always present in the request
sourceStringSource of geolocation dataAlways present in the request

Package Information

Details about the shipment package:

Name
Data type
Description
Field presence in every request
itemsArrayArray of items in the packageAlways present in the request
dimensionsObjectPackage dimensions (height, width, length, weight)Always present in the request
amountDecimalPackage total value/amount. Example: 150.00Always present in the request

Items

Individual items contained in the shipment package:

Field
Data type
Description
Field presence in every request
item_idStringUnique item identifier on MercadolibreAlways present in the request
descriptionStringItem description on MercadlibreAlways present in the request
quantityLongItem quantityAlways present in the request

Dimensions

Package dimensions and weight specifications:

Name
Data type
Description
Unit
Field presence in every request
heightDecimalPackage heightCentimeters (cm)Always present in the request
widthDecimalPackage widthCentimeters (cm)Always present in the request
lengthDecimalPackage lengthCentimeters (cm)Always present in the request
weightDecimalTotal package weightGrams (g)Always present in the request
volumetric_weightDecimalCalculated volumetric weight (optional)Grams (g)Always present in the request

Requirements (Optional)

Additional shipment requirements (pickup and delivery schedules and special treatments):

Name
Date type
Description
Field presence in every request
special_treatmentsArrayArray of special treatment codes (groupable, has_battery, special_goods, etc)Optional
pickupObjectPickup schedule and location metadata requirementsOptional
deliveryObjectDelivery schedule, strategy, and location metadata requirementsOptional

Pickup Object

Name
Data type
Description
scheduleObjectTime window for pickup
location_metadataObjectLocation details and access information

Delivery Object

Field
Type
Description
scheduleObjectTime window for delivery
affinity_groupStringDelivery affinity group (for grouping deliveries together)
delivery_strategyStringOperational strategy for delivery. E.g. "joint_delivery" (indicate that it must be delivered together with other shipments with the same affinity_group ).
location_metadataObjectLocation details and access information

Schedule Object

Field
Type
Description
fromDateTimeWindow start time (ISO 8601 format)
toDateTimeWindow end time (ISO 8601 format)

Location Metadata Object

Field
Type
Description
location_idStringUnique location identifier
has_receptionBooleanWhether location has reception desk available
typesArrayArray of location types (residence, commercial, etc)
nameStringLocation name or description
sourceStringSource of location data
timetableObjectOperating hours/timetable information
external_dataObjectExternal reference data (external_id, phone)
is_presentBooleanWhether location is currently present/active
  • Note: Requirements are optional and only included under certain flows

Request Examples

Complete domestics shipment

json
1{ 2 "id": "10101033319242", 3 "transport_order_id": "5c81e696e69190a58c13d4de71816b743", 4 "direction": "forward", 5 "carrier_information": { 6 "contract": "contract", 7 "agency": { 8 "id": "id" 9 } 10 }, 11 "shipment_information": { 12 "sender": { 13 "full_name": "John Doe", 14 "first_name": "John", 15 "last_name": "Doe", 16 "phone": { 17 "number": "123456789" 18 }, 19 "address": { 20 "address_line": "Route 36 1234", 21 "street_name": "Route 36", 22 "street_number": "1234", 23 "intersection": "intersection", 24 "comment": "comment", 25 "city": { 26 "id": "TUVDQ1BVRXJ0b3F1aQ", 27 "name": "Puerto Quito" 28 }, 29 "state": { 30 "id": "EC-P", 31 "name": "Pichincha" 32 }, 33 "country": { 34 "id": "EC", 35 "name": "Ecuador" 36 }, 37 "neighborhood": { 38 "name": "Puerto Quito" 39 }, 40 "municipality": {}, 41 "geolocation": { 42 "geolocation_type": "GEOMETRIC_CENTER", 43 "latitude": -0.12345, 44 "longitude": -78.123456 45 } 46 } 47 }, 48 "receiver": { 49 "full_name": "John Doe", 50 "first_name": "John", 51 "last_name": "Doe", 52 "phone": { 53 "number": "123456789" 54 }, 55 "address": { 56 "address_line": "Route 1 SN", 57 "street_name": "Route 1", 58 "street_number": "SN", 59 "intersection": "intersection", 60 "comment": "comment", 61 "city": { 62 "id": "TUVDQ0VMWmMyZWRj", 63 "name": "El Carmen" 64 }, 65 "state": { 66 "id": "EC-M", 67 "name": "Manabí" 68 }, 69 "country": { 70 "id": "EC", 71 "name": "Ecuador" 72 }, 73 "neighborhood": { 74 "name": "El Carmen" 75 }, 76 "municipality": {}, 77 "geolocation": { 78 "geolocation_type": "GEOMETRIC_CENTER", 79 "latitude": -0.123456, 80 "longitude": -79.123456789 81 } 82 } 83 }, 84 "package": { 85 "items": [ 86 { 87 "item_id": "MEC656877602", 88 "description": "Lamp", 89 "quantity": 1 90 } 91 ], 92 "dimensions": { 93 "height": 13, 94 "width": 26, 95 "length": 37, 96 "weight": 1100 97 }, 98 "amount": 13.5 99 } 100 }, 101 "test": false, 102 "keyword": "3bc405c30cadb4e6eefdf0cff899abcf8234d761c9a3ea1b2f510601ae5fc504" 103}

Response

Successful Response (HTTP 200)

bash
1HTTP 200 OK 2--header 'Content-Type: application/json' 3{ 4 "id": "10101033319242", 5 "status":"AUTHORIZED", 6 "status_message":"OK", 7 "tracking_number": "ASDfgh123asd", 8 "authorization_information": { 9 "date": "2001-07-04T12:08:56.235-07:00", 10 "custom_data":{ 11 "ruta_1":"RUTA" 12 } 13 } 14}
Name
Data type
Description
Mandatory
statusStringAUTHORIZED (when successful)Mandatory
status_messageStringDescriptive messageMandatory
tracking_numberStringGenerated tracking numberMandatory
authorization_informationObjectAuthorization informationMandatory

Authorization information object

Name
Data type
Description
Mandatory
dateDate (ISO 8601)Authorization dateMandatory
custom_dataObjectCustom data agreed during integration for labelingMandatory

Failed Response (HTTP 400)

bash
1HTTP 400 Bad Request 2--header 'Content-Type: application/json' 3{ 4 "error_code": "invalid_user_information.buyer", 5 "status_message":"Missing receiver information", 6 "status": "FAILED" 7}

Error Response (HTTP 500)

bash
1HTTP 500 Internal Server Error 2--header 'Content-Type: application/json' 3{ 4 "status_message":"Internal server error", 5 "status": "ERROR" 6}

HTTP Status Codes & Errors

HTTP
Status
Description
200AUTHORIZEDAuthentication with success.
400FAILEDWhenever the request is invalid.
500ERRORAny authentication server issue.