Documentation Mercado Libre
Check out all the necessary information about APIs Mercado Libre.
Documentation
Shopping cart orders
With the current JSON structure of orders, shipping information is not available, only the identification will be. In this way, you can get additional information in the Shipments API.
To work with the last JSON, when you request GET, send the "x-format-new: true" parameter. The rest of the resource structure will work with some updates that you have consider.
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/orders/order_id
Exemplo:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/orders/2053577644
Response:
{
"id": 2053577644,
"date_created": "2019-06-13T09:20:02.000-04:00",
"date_closed": "2019-06-13T09:20:08.000-04:00",
"last_updated": "2019-06-13T09:20:08.000-04:00",
"manufacturing_ending_date": null,
"feedback": {
"sale": null,
"purchase": null
},
"mediations": [],
"comments": null,
"pack_id": 2000000101334825,
"pickup_id": null,
"order_request": {
"return": null,
"change": null
},
"fulfilled": null,
"total_amount": 9.99,
"paid_amount": 9.99,
"coupon": {
"id": null,
"amount": 0
},
"expiration_date": "2019-07-11T09:20:08.000-04:00",
"order_items": [
"item": {
"id": "MLB1226730704",
"title": "Produto Teste - Não Ofertar",
"category_id": "MLB11742",
"variation_id": null,
"seller_custom_field": null,
"variation_attributes": [],
"warranty": "12 months",
"condition": "new",
"seller_sku": null
},
"quantity": 1,
"unit_price": 9.99,
"full_unit_price": 9.99,
"currency_id": "BRL",
"manufacturing_days": null
],
"currency_id": "BRL",
"payments": [
"id": 4863317779,
"order_id": 2053577644,
"payer_id": 419067349,
"collector": {
"id": 419059118
},
"card_id": null,
"site_id": "MLB",
"reason": "Produto Teste - Não Ofertar",
"payment_method_id": "account_money",
"currency_id": "BRL",
"installments": 1,
"issuer_id": null,
"atm_transfer_reference": {
"company_id": null,
"transaction_id": null
},
"coupon_id": null,
"activation_uri": null,
"operation_type": "regular_payment",
"payment_type": "account_money",
"available_actions": [
"refund"
],
"status": "approved",
"status_code": null,
"status_detail": "accredited",
"transaction_amount": 9.99,
"taxes_amount": 0,
"shipping_cost": 0,
"coupon_amount": 0,
"overpaid_amount": 0,
"total_paid_amount": 9.99,
"installment_amount": null,
"deferred_period": null,
"date_approved": "2019-06-13T09:20:07.000-04:00",
"authorization_code": null,
"transaction_order_id": null,
"date_created": "2019-06-13T09:20:07.000-04:00",
"date_last_modified": "2019-06-13T09:20:07.000-04:00"
],
"shipping": {
"id": 27987243797
},
"status": "paid",
"status_detail": null,
"tags": [
"test_order",
"pack_order",
"paid"
],
"buyer": {
"id": 419067349,
"nickname": "TT763866",
"email": "ttest.6hqmq6+2-ogiydkmzvg43tmobx@mail.mercadolivre.com", },
"first_name": "Test",
"last_name": "Test",
"billing_info": {
"doc_type": "CPF",
"doc_number": "78525276200"
},
"seller": {
"id": 419059118,
"nickname": "TETE8288849",
"email": "ttest.hpz2z6q+2-ogiydkmzvg43tmobs@mail.mercadolivre.com",
"phone": {
"area_code": "01",
"extension": "",
"number": "1111-1111",
"verified": false
},
"alternative_phone": {
"area_code": "",
"extension": "",
"number": ""
},
"first_name": "Test",
"last_name": "Test"
},
"taxes": {
"amount": null,
"currency_id": null
}
The response do not return the total_amount_with_shipping field that have to be calculated. To understand the meaning of each parameter, make this request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/orders/order_id?options
Total_amount_with_shipping calculation
Request to calculate total amount with shipping.
Considerations
- The pack_order tag is automatically created to determine if the order is associated to a shopping cart, and neither the buyer nor the seller an delete it.
- The pack_id field shows the shopping cart number associated with the order.
- If the order is not associated to a Shopping Cart and the transaction modality is “to be agreed with the seller,” you will no longer receive a status to be agreed, since the shipping ID will be directly null. This means that you should contact the buyer to agree on the shipment method.
- You will only have the shipping ID to look for information in the new Shipping resources.
- Despite the existing order, shipment creation may be delayed. In such case, the ID will be null until shipment creation. If this happens you will be notified.
- The “delivered/not delivered” tags will no longer be automatically added. They will be marked only if the integrator makes a PUT with the defined tag.
- If the payment is rejected or returned, orders with paid status will be cancelled. In this case, you will receive a notification to learn about the order status change.
Next: Shipment.