Testes com Carrinho de Compras

Agora que você já conhece quais serão as mudanças que se aproximam te convidamos para provar e aplicar em seu desenvolvimento.
Neste guia mostraremos exemplos (mocks) de quais serão os impactos tanto com uma ordem ou duas.
Antes de começar, sugerimos que tenha em conta a seguinte lista de IDs para que possa fazer todas os testes necessários:

IDs utilizados para orders

  • 1289297748
  • 1289342698
  • 1289343330

IDs utilizados para envíos

  • 25943308796
  • 25943399274

IDs utilizados para pagamentos

  • 2574435135
  • 2574244195
  • 2574469258
  • 2574470906
  • 2574470882

Conteúdos

Gerenciamento de orders

Assim como mencionamos na documentação de Gerenciamento de orders, haverá mudanças na estrutura do JSON já que a informação do envio não estará mais aqui.

Caso de utilização com uma order

Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/orders/{order_id}?access_token=

Resposta:

{
    "id": 1289297748,
    "date_created": "2017-06-27T16:15:53-04:00",
    "date_closed": "2017-06-27T16:15:53-04:00",
    "last_updated": "2017-06-27T16:15:53-04:00",
    "feedback": {
        "sale": null,
        "purchase": null
    },
    "mediations": [],
    "comments": null,
    "order_request": {
        "return": null,
        "change": null
    },
    "fulfilled": null,
    "shipping": {
        "id": 25943399274
    },
    "expiration_date": "2017-06-29T16:15:53-04:00",
    "status": "paid",
    "status_detail": null,
    "order_items": [
        {
            "item": {
                "id": "MLB573965343",
                "title": "Item De Teste, Por Favor Não Ofertar. ",
                "category_id": "MLB1915",
                "variation_id": null,
                "seller_custom_field": null,
                "variation_attributes": [],
                "warranty": null,
                "condition": "new"
            },
            "quantity": 1,
            "unit_price": 200,
            "currency_id": "BRL"
        }
    ],
    "currency_id": "BRL",
    "buyer": {
        "id": 1234567890,
        "nickname": "BUYER_NICKNAME",
        "email": "buyermail@mail.mercadolivre.com",
        "phone": {
            "area_code": "01",
            "number": "1111-1111",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "",
            "number": "",
            "extension": ""
        },
        "first_name": "Buyer",
        "last_name": "Buyer",
        "billing_info": {
            "doc_type": null,
            "doc_number": null
        }
    },
    "seller": {
        "id": 44696990,
        "nickname": "LEOBERTA",
        "email": "leandrobertalot@hotmail.com",
        "phone": {
            "area_code": "",
            "number": "3515297390",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "3571",
            "number": "498059",
            "extension": ""
        },
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot"
    },
    "payments": [
        {
            "id": 2574244195,
            "order_id": 1289297748,
            "payer_id": 238954822,
            "collector": {
                "id": 44696990
            },
            "card_id": null,
            "site_id": "MLB",
            "reason": "Item De Teste, Por Favor Não Ofertar.",
            "payment_method_id": "account_money",
            "currency_id": "BRL",
            "installments": null,
            "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": [],
            "status": "approved",
            "status_code": null,
            "status_detail": "accredited",
            "shipping_cost": 0,
            "coupon_amount": 0,
            "overpaid_amount": 0,
            "total_paid_amount": 200,
            "installment_amount": null,
            "deferred_period": null,
            "date_approved": "2017-06-28T10:15:53-04:00",
            "authorization_code": null,
            "transaction_order_id": null,
            "date_created": "2017-06-28T10:15:53-04:00",
            "date_last_modified": "2017-06-28T10:15:53-04:00"
        }
    ],
    "coupon": {
        "id": null,
        "amount": 0
    },
    "tags": [
        "paid",
        "pack_order"
    ],
    "total_amount": 200,
    "paid_amount": 200
}

Caso de uso com duas orders

Order 1:
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/orders/1289342698?access_token=

Resposta:

{
    "id": 1289342698,
    "date_created": "2017-06-27T16:13:10-04:00",
    "date_closed": "2017-06-27T16:13:10-04:00",
    "last_updated": "2017-06-27T16:13:10-04:00",
    "feedback": {
        "sale": null,
        "purchase": null
    },
    "mediations": [],
    "comments": null,
    "order_request": {
        "return": null,
        "change": null
    },
    "fulfilled": null,
    "shipping": {
        "id": 25943308796
    },
    "expiration_date": "2017-06-29T16:13:10-04:00",
    "status": "paid",
    "status_detail": null,
    "order_items": [
        {
            "item": {
                "id": "MLB573965343",
                "title": "Item De Testeo, Por Favor No Ofertar",
                "category_id": "MLB1915",
                "variation_id": null,
                "seller_custom_field": null,
                "variation_attributes": [],
                "warranty": null,
                "condition": "new"
            },
            "quantity": 1,
            "unit_price": 200,
            "currency_id": "BRL"
        }
    ],
    "currency_id": "BRL",
    "buyer": {
        "id": 1234567890,
        "nickname": "BUYER_NICKNAME",
        "email": "buyermail@mail.mercadolivre.com",
        "phone": {
            "area_code": "01",
            "number": "1111-1111",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "",
            "number": "",
            "extension": ""
        },
        "first_name": "Buyer",
        "last_name": "Buyer",
        "billing_info": {
            "doc_type": null,
            "doc_number": null
        }
    },
    "seller": {
        "id": 44696990,
        "nickname": "LEOBERTA",
        "email": "leandrobertalot@hotmail.com",
        "phone": {
            "area_code": "",
            "number": "3515297390",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "3571",
            "number": "498059",
            "extension": ""
        },
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot"
    },
    "payments": [
        {
            "id": 2574469258,
            "order_id": 1289342698,
            "payer_id": 238954822,
            "collector": {
                "id": 44696990
            },
            "card_id": null,
            "site_id": "MLB",
            "reason": "Item De Teste, Por Favor Não Ofertar.",
            "payment_method_id": "account_money",
            "currency_id": "BRL",
            "installments": null,
            "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": [],
            "status": "approved",
            "status_code": null,
            "status_detail": "accredited",
            "shipping_cost": 0,
            "coupon_amount": 0,
            "overpaid_amount": 0,
            "total_paid_amount": 200,
            "installment_amount": null,
            "deferred_period": null,
            "date_approved": "2017-06-28T10:13:10-04:00",
            "authorization_code": null,
            "transaction_order_id": null,
            "date_created": "2017-06-28T10:13:10-04:00",
            "date_last_modified": "2017-06-28T10:13:10-04:00"
        }
    ],
    "coupon": {
        "id": null,
        "amount": 0
    },
    "tags": [
        "paid",
        "pack_order"
    ],
    "total_amount": 200,
    "paid_amount": 200
}

Order 2:
Chamada:

curl -H "x-format-new:true" https://api.mercadolibre.com/carrito_mocks/orders/1289343330?access_token=

Resposta:

{
    "id": 1289343330,
    "date_created": "2017-06-27T16:09:33-04:00",
    "date_closed": "2017-06-27T16:09:33-04:00",
    "last_updated": "2017-06-27T16:09:33-04:00",
    "feedback": {
        "sale": null,
        "purchase": null
    },
    "mediations": [],
    "comments": null,
    "order_request": {
        "return": null,
        "change": null
    },
    "fulfilled": null,
    "shipping": {
        "id": 25943308796
    },
    "expiration_date": "2017-06-29T16:09:33-04:00",
    "status": "paid",
    "status_detail": null,
    "order_items": [
        {
            "item": {
                "id": "MLB573981104",
                "title": "Item De Teste, Por Favor Não Ofertar.",
                "category_id": "MLB113790",
                "variation_id": 14465627367,
                "seller_custom_field": null,
                "variation_attributes": [
                    {
                        "id": "10000",
                        "name": "Tamanho",
                        "value_id": "cadbd3c",
                        "value_name": "S"
                    },
                    {
                        "id": "11000",
                        "name": "Cor Primários",
                        "value_id": "11000-Vermelho",
                        "value_name": "Vermelho"
                    }
                ],
                "warranty": null,
                "condition": "not_specified"
            },
            "quantity": 3,
            "unit_price": 100,
            "currency_id": "MXN"
        }
    ],
    "currency_id": "MXN",
    "buyer": {
        "id": 1234567890,
        "nickname": "BUYER_NICKNAME",
        "email": "buyermail@mail.mercadolivre.com",
        "phone": {
            "area_code": "01",
            "number": "1111-1111",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "",
            "number": "",
            "extension": ""
        },
        "first_name": "Buyer",
        "last_name": "Buyer",
        "billing_info": {
            "doc_type": null,
            "doc_number": null
        }
    },
    "seller": {
        "id": 44696990,
        "nickname": "LEOBERTA",
        "email": "leandrobertalot@hotmail.com",
        "phone": {
            "area_code": "",
            "number": "3515297390",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "3571",
            "number": "498059",
            "extension": ""
        },
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot"
    },
    "payments": [
        {
            "id": 2574470906,
            "order_id": 1289343330,
            "payer_id": 238954822,
            "collector": {
                "id": 44696990
            },
            "card_id": null,
            "site_id": "MLB",
            "reason": "Item De Teste, Por Favor Não Ofertar.",
            "payment_method_id": "account_money",
            "currency_id": "MXN",
            "installments": null,
            "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": [],
            "status": "approved",
            "status_code": null,
            "status_detail": "accredited",
            "shipping_cost": 0,
            "coupon_amount": 0,
            "overpaid_amount": 0,
            "total_paid_amount": 300,
            "installment_amount": null,
            "deferred_period": null,
            "date_approved": "2017-06-28T10:09:33-04:00",
            "authorization_code": null,
            "transaction_order_id": null,
            "date_created": "2017-06-28T10:09:33-04:00",
            "date_last_modified": "2017-06-28T10:09:33-04:00"
        }
    ],
    "coupon": {
        "id": null,
        "amount": 0
    },
    "tags": [
        "paid",
        "pack_order"
    ],
    "total_amount": 300,
    "paid_amount": 300
}

Gerenciamento de envíos

Segundo o que foi detalhado na documentação de Gerenciamento de Envío, com esta nova funcionalidade poderá obter toda a informação para concluir a transacção.

Caso de uso com uma order

Shipments
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}?access_token=

Resposta:

{
    "id": 25943308796,
    "external_reference": "1000000000036026",
    "status": "ready_to_ship",
    "substatus": "ready_to_print",
    "date_created": "2017-06-27T16:07:58-04:00",
    "last_updated": "2017-06-27T16:07:58-04:00",
    "declared_value": 500,
    "dimensions": {
        "height": 60,
        "width": 60,
        "length": 30,
        "weight": 7200
    },
    "logistic": {
        "direction": "forward",
        "mode": "me2",
        "type": null
    },
    "source": {
        "site_id": "MLB",
        "market_place": "MELI",
        "application_id": null
    },
    "tracking_number": "123456ABC",
    "origin": {
        "type": "selling_address",
        "sender_id": 44696990,
        "shipping_address": {
            "address_id": 155672923,
            "address_line": "Test addresss line 7000",
            "street_name": "Test addresss line",
            "street_number": "7000",
            "comment": "Test comment",
            "zip_code": "45010",
            "city": {
                "id": "TUxBQ0NBUGNiZGQx",
                "name": "Test city"
            },
            "state": {
                "id": "BR-X",
                "name": "Test state"
            },
            "country": {
                "id": "BR",
                "name": "Brasil"
            },
            "neighborhood": {
                "id": null,
                "name": ""
            },
            "municipality": {
                "id": null,
                "name": ""
            },
            "types": [
                "billing",
                "default_buying_address",
                "default_selling_address",
                "shipping"
            ],
            "agency": {
                "agency_id": null,
                "carrier_id": null,
                "description": null,
                "open_hours": null,
                "phone": null
            },
            "latitude": -31.3361801,
            "longitude": -64.2043665,
            "geolocation_type": "GEOMETRIC_CENTER",
            "is_valid_for_carrier": null
        }
    },
    "destination": {
        "type": "buying_address",
        "receiver_id": 238954822,
        "receiver_name": null,
        "receiver_phone": null,
        "shipping_address": {
            "address_id": 211540565,
            "address_line": "Testing Street 1450",
            "street_name": "Testing Street",
            "street_number": "1450",
            "comment": "",
            "zip_code": "45010",
            "city": {
                "id": "TUxNQ1pBUDM4NzE",
                "name": "Test City"
            },
            "state": {
                "id": "MX-JAL",
                "name": "Test State"
            },
            "country": {
                "id": "BR",
                "name": "Brasil"
            },
            "neighborhood": {
                "id": null,
                "name": "The Neighborhood"
            },
            "municipality": {
                "id": null,
                "name": ""
            },
            "types": [
                "default_selling_address",
                "shipping",
                "billing"
            ],
            "agency": {
                "agency_id": null,
                "carrier_id": null,
                "description": null,
                "open_hours": null,
                "phone": null
            },
            "latitude": 20.67,
            "longitude": -103.42,
            "geolocation_type": "APPROXIMATE",
            "is_valid_for_carrier": null
        }
    },
    "lead_time": {
        "option_id": 111111111,
        "shipping_method": {
            "id": 501245,
            "name": "Estándar",
            "type": "standard"
        },
        "currency_id": "BRL",
        "cost": 20,
        "cost_type": "charged",
        "service_id": 181,
        "estimated_delivery_time": {
            "type": "known",
            "date": "2017-07-03T00:00:00-04:00",
            "shipping": 96,
            "handling": 24,
            "unit": "hour",
            "offset": {
                "date": "2017-07-05T00:00:00-04:00",
                "shipping": 48
            },
            "time_frame": {
                "from": "2017-07-05T09:00:00-04:00",
                "to": "2017-07-05T18:00:00-04:00"
            },
            "pay_before": null
        }
    },
    "tags": []
}

Shipment items
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/items?access_token=

Resposta:

[
    {
        "item_id": "MLB573965343",
        "variation_id": null,
        "description": "Item De Teste, Por Favor Não Ofertar.",
        "quantity": 1,
        "dimensions": {
            "height": 30,
            "width": 30,
            "length": 30,
            "weight": 1800
        },
        "order_id": "1289342698",
        "sender_id": 44696990
    },
    {
        "item_id": "MLB573981104",
        "variation_id": "14465627367",
        "description": "Item De Teste, Por Favor Não Ofertar.",
        "quantity": 3,
        "dimensions": {
            "height": 30,
            "width": 30,
            "length": 30,
            "weight": 1800
        },
        "order_id": "1289343330",
        "sender_id": 44696990
    }
]

Shipment costs
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/costs?access_token=

Resposta:

{
    "receiver": {
        "user_id": 238954822,
        "cost": 50,
        "discount": {
            "rate": 0.5,
            "type": "loyal",
            "promoted_amount": 0
        },
        "compensation": 0,
        "save": 20
    },
    "senders": [
        {
            "user_id": 44696990,
            "cost": 0,
            "discount": {
                "rate": 0,
                "rate_type": null,
                "promoted_amount": 0
            },
            "compensation": 0,
            "save": 0
        }
    ]
}

Shipment lead time
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{shipment_ID}/lead_time?access_token=

Resposta:

{
    "option_id": 111111111,
    "shipping_method": {
        "id": 501245,
        "name": "Estándar",
        "type": "standard"
    },
    "currency_id": "BRL",
    "cost": 50,
    "cost_type": "charged",
    "service_id": 181,
    "estimated_delivery_time": {
        "type": "known",
        "date": "2017-07-03T00:00:00-04:00",
        "shipping": 96,
        "handling": 24,
        "unit": "hour",
        "offset": {
            "date": "2017-07-05T00:00:00-04:00",
            "shipping": 48
        },
        "time_frame": {
            "from": "2017-07-05T09:00:00-04:00",
            "to": "2017-07-05T18:00:00-04:00"
        },
        "pay_before": null
    },
    "estimated_handling_limit": {
        "date": "2017-06-29T00:00:00-04:00"
    },
    "estimated_delivery_extended": {
        "date": "2017-07-08T00:00:00-04:00"
    },
    "estimated_delivery_limit": {
        "date": "2017-07-18T00:00:00-04:00"
    },
    "estimated_delivery_final": {
        "date": "2017-07-28T00:00:00-04:00"
    },
    "delay": []
}

Shipment history
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/history?access_token=

Resposta:

[
    {
        "status": "pending",
        "substatus": "shipment_paid",
        "date": "2017-06-27T16:25:05-04:00"
    },
    {
        "status": "handling",
        "substatus": null,
        "date": "2017-06-27T16:30:05-04:00"
    },
    {
        "status": "ready_to_ship",
        "substatus": "ready_to_print",
        "date": "2017-06-27T16:35:05-04:00"
    },
    {
        "status": "ready_to_ship",
        "substatus": "printed",
        "date": "2017-06-27T16:40:05-04:00"
    },
    {
        "status": "shipped",
        "substatus": null,
        "date": "2017-06-28T16:40:05-04:00"
    },
    {
        "status": "delivered",
        "substatus": null,
        "date": "2017-06-30T16:40:05-04:00"
    }
]

Shipment payments
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/payments?access_token=

Resposta:

[
    {
        "payment_id": 2574470882,
        "amount": 50,
        "status": "approved"
    }
]

Caso de uso com duas orders

Shipment
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}?access_token=

Resposta:

{
    "id": 25943399274,
    "external_reference": "1000000000036021",
    "status": "ready_to_ship",
    "substatus": "ready_to_print",
    "date_created": "2017-06-27T16:26:23-04:00",
    "last_updated": "2017-06-27T16:26:23-04:00",
    "declared_value": 200,
    "dimensions": {
        "height": 30,
        "width": 30,
        "length": 30,
        "weight": 1800
    },
    "logistic": {
        "direction": "forward",
        "mode": "me2",
        "type": null
    },
    "source": {
        "site_id": "MLB",
        "market_place": "MELI",
        "application_id": null
    },
    "tracking_number": "12345",
    "origin": {
        "type": "selling_address",
        "sender_id": 44696990,
        "shipping_address": {
            "address_id": 155672923,
            "address_line": "Av La Voz del Interior 7000",
            "street_name": "Av La Voz del Interior",
            "street_number": "7000",
            "comment": "Edificio Miragolf PB (ciudad empresaria)",
            "zip_code": "5000",
            "city": {
                "id": "TUxBQ0NBUGNiZGQx",
                "name": "Córdoba"
            },
            "state": {
                "id": "AR-X",
                "name": "Córdoba"
            },
            "country": {
                "id": "AR",
                "name": "Argentina"
            },
            "neighborhood": {
                "id": null,
                "name": ""
            },
            "municipality": {
                "id": null,
                "name": ""
            },
            "types": [
                "billing",
                "default_buying_address",
                "default_selling_address",
                "shipping"
            ],
            "agency": null,
            "latitude": -31.3361801,
            "longitude": -64.2043665,
            "geolocation_type": "GEOMETRIC_CENTER",
            "is_valid_for_carrier": null
        }
    },
    "destination": {
        "type": "buying_address",
        "receiver_id": 238954822,
        "receiver_name": null,
        "receiver_phone": null,
        "shipping_address": {
            "address_id": 211540565,
            "address_line": "Test Avenue 1444",
            "street_name": "Test Avenue",
            "street_number": "1444",
            "comment": "",
            "zip_code": "45010",
            "city": {
                "id": "TUxNQ1pBUDM4NzE",
                "name": "Zapopan"
            },
            "state": {
                "id": "MX-JAL",
                "name": "Jalisco"
            },
            "country": {
                "id": "BR",
                "name": "Brásil"
            },
            "neighborhood": {
                "id": null,
                "name": "The Neighborhood"
            },
            "municipality": {
                "id": null,
                "name": ""
            },
            "types": [
                "default_selling_address",
                "shipping",
                "billing"
            ],
            "agency": null,
            "latitude": 20.67,
            "longitude": -103.42,
            "geolocation_type": "APPROXIMATE",
            "is_valid_for_carrier": null
        }
    },
    "lead_time": {
        "option_id": 111111111,
        "shipping_method": {
            "id": 501245,
            "name": "Estándar",
            "type": "standard"
        },
        "currency_id": "BRL",
        "cost": 20,
        "cost_type": "charged",
        "service_id": 181,
        "estimated_delivery_time": {
            "type": "known",
            "date": "2017-07-03T00:00:00-04:00",
            "shipping": 96,
            "handling": 24,
            "unit": "hour",
            "offset": {
                "date": "2017-07-05T00:00:00-04:00",
                "shipping": 48
            },
            "time_frame": {
                "from": "2017-07-05T09:00:00-04:00",
                "to": "2017-07-05T18:00:00-04:00"
            },
            "pay_before": null
        }
    },
    "tags": []
}

Shipment items
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/items?access_token=

Resposta:

[
    {
        "item_id": "MLB573965343",
        "variation_id": null,
        "description": "Item De Teste, Por Favor Não Ofertar.",
        "quantity": 1,
        "dimensions": {
            "height": 30,
            "width": 30,
            "length": 30,
            "weight": 1800
        },
        "order_id": "1289297748",
        "sender_id": 44696990
    }
]

Shipment costs
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/costs?access_token=

Resposta:

{
    "receiver": {
        "user_id": 1234567890,
        "cost": 20,
        "discount": {
            "rate": 0.5,
            "type": "loyal",
            "promoted_amount": 0
        },
        "compensation": 0,
        "save": 0
    },
    "senders": [
        {
            "user_id": 44696990,
            "cost": 0,
            "discount": {
                "rate": 0,
                "rate_type": null,
                "promoted_amount": 0
            },
            "compensation": 0,
            "save": 0
        }
    ]
}

Shipment lead time
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/lead_time?access_token=

Resposta:

{
    "option_id": 111111111,
    "shipping_method": {
        "id": 501245,
        "name": "Estándar",
        "type": "standard"
    },
    "currency_id": "BRL",
    "cost": 20,
    "cost_type": "charged",
    "service_id": 181,
    "estimated_delivery_time": {
        "type": "known",
        "date": "2017-07-03T00:00:00-04:00",
        "shipping": 96,
        "handling": 24,
        "unit": "hour",
        "offset": {
            "date": "2017-07-05T00:00:00-04:00",
            "shipping": 48
        },
        "time_frame": {
            "from": "2017-07-05T09:00:00-04:00",
            "to": "2017-07-05T18:00:00-04:00"
        },
        "pay_before": null
    },
    "estimated_handling_limit": {
        "date": "2017-06-29T00:00:00-04:00"
    },
    "estimated_delivery_extended": {
        "date": "2017-07-08T00:00:00-04:00"
    },
    "estimated_delivery_limit": {
        "date": "2017-07-18T00:00:00-04:00"
    },
    "estimated_delivery_final": {
        "date": "2017-07-28T00:00:00-04:00"
    },
    "delay": []
}

Shipment history
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/history?access_token=

Resposta:

[
    {
        "status": "pending",
        "substatus": "shipment_paid",
        "date": "2017-06-27T16:31:19-04:00"
    },
    {
        "status": "handling",
        "substatus": null,
        "date": "2017-06-27T16:36:19-04:00"
    },
    {
        "status": "ready_to_ship",
        "substatus": "ready_to_print",
        "date": "2017-06-27T16:41:19-04:00"
    },
    {
        "status": "ready_to_ship",
        "substatus": "printed",
        "date": "2017-06-27T16:46:19-04:00"
    },
    {
        "status": "shipped",
        "substatus": null,
        "date": "2017-06-28T16:46:19-04:00"
    },
    {
        "status": "delivered",
        "substatus": null,
        "date": "2017-06-30T16:46:19-04:00"
    }
]

Shipment payments
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/shipments/{Shipment_ID}/payments?access_token=

Resposta:

[
    {
        "payment_id": 2574435135,
        "amount": 20,
        "status": "approved"
    }
]

Gerenciamento de pagamentos

Por último, também deverá ter em conta a mudança no Gerenciamento de Pagamentos.

Caso de uso com uma order

Payment (Pagamento do shipment)
Chamada:

curl -H "x-format-new:true" https://api.mercadolibre.com/carrito_mocks/payments/2574435135?access_token=

Resposta:

{
    "id": 2574435135,
    "site_id": "MLB",
    "date_created": "2017-06-28T16:22:05-04:00",
    "date_approved": "2017-06-28T16:22:05-04:00",
    "money_release_date": "2017-06-28T16:22:05-04:00",
    "last_modified": "2017-06-28T16:22:05-04:00",
    "sponsor_id": null,
    "collector_id": 44696990,
    "payer": {
        "id": 222113214,
        "email": "test_user_64693035@testuser.com",
        "phone": {
            "area_code": "01",
            "number": "1111-1111",
            "extension": "",
            "verified": false
        },
        "identification": {
            "type": "IFE",
            "number": "11111111111"
        }
    },
    "order_id": "25943399274",
    "external_reference": "25943399274",
    "merchant_order_id": null,
    "reason": "marketplace_shipment",
    "currency_id": "BRL",
    "transaction_amount": 20,
    "mercadopago_fee": 0,
    "net_received_amount": 20,
    "total_paid_amount": 20,
    "shipping_cost": 0,
    "coupon_amount": 0,
    "coupon_fee": 0,
    "finance_fee": 0,
    "discount_fee": 0,
    "coupon_id": null,
    "status": "approved",
    "status_detail": "accredited",
    "status_code": null,
    "issuer_id": null,
    "installment_amount": 0,
    "deferred_period": null,
    "account_money_amount": 0,
    "payment_type": "account_money",
    "payment_method_id": "account_money",
    "marketplace": "MELI",
    "operation_type": "regular_payment",
    "marketplace_fee": 0,
    "released": "no",
    "deduction_schema": null,
    "tags": [],
    "refunds": [],
    "amount_refunded": 0,
    "client_id": "6492251534497263",
    "created_from": "6492251534497263",
    "notification_url": null,
    "concept_id": null,
    "concept_amount": 0,
    "internal_metadata": {
        "rule_id": "50006",
        "concept": "marketplace_shipment",
        "type": "outbound_payment",
        "splitter_id": "74066",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    }
}

Payment (Pagamento da order)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/payments/2574244195?access_token=

Resposta:

{
    "id": 2574244195,
    "site_id": "MLB",
    "date_created": "2017-06-28T16:25:11-04:00",
    "date_approved": "2017-06-28T16:25:11-04:00",
    "money_release_date": "2017-06-28T16:25:11-04:00",
    "last_modified": "2017-06-28T16:25:11-04:00",
    "sponsor_id": null,
    "collector_id": 44696990,
    "payer": {
        "id": 238954822,
        "email": "test_user_64693035@testuser.com",
        "phone": {
            "area_code": "01",
            "number": "1111-1111",
            "extension": "",
            "verified": false
        },
        "identification": {
            "type": "IFE",
            "number": "11111111111"
        }
    },
    "order_id": "1289297748",
    "external_reference": "1289297748",
    "merchant_order_id": null,
    "reason": "Item De Teste, Por Favor Não Ofertar.",
    "currency_id": "BRL",
    "transaction_amount": 200,
    "mercadopago_fee": 0,
    "net_received_amount": 174,
    "total_paid_amount": 200,
    "shipping_cost": 0,
    "coupon_amount": 0,
    "coupon_fee": 0,
    "finance_fee": 0,
    "discount_fee": 0,
    "coupon_id": null,
    "status": "approved",
    "status_detail": "accredited",
    "status_code": null,
    "issuer_id": null,
    "installment_amount": 0,
    "deferred_period": null,
    "account_money_amount": 0,
    "payment_type": "account_money",
    "payment_method_id": "account_money",
    "marketplace": "MELI",
    "operation_type": "regular_payment",
    "marketplace_fee": 26,
    "released": "no",
    "deduction_schema": null,
    "tags": [],
    "refunds": [],
    "amount_refunded": 0,
    "client_id": "6492251534497263",
    "created_from": "6492251534497263",
    "notification_url": null,
    "concept_id": null,
    "concept_amount": 0,
    "internal_metadata": {
        "rule_id": "50005",
        "concept": "marketplace_order",
        "type": "outbound_payment",
        "splitter_id": "74066",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    }
}

Payment (Versão 1 Pagamento da order)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/collections/2574244195?access_token=

Resposta:

{
    "id": 2574244195,
    "statement_descriptor": null,
    "captured": true,
    "date_created": "2017-06-28T16:27:04-04:00",
    "date_last_updated": "2017-06-28T16:27:04-04:00",
    "date_approved": "2017-06-28T16:27:04-04:00",
    "payer_id": 222113214,
    "issuer_id": null,
    "description": "Item De Teste, Por Favor Não Ofertar.",
    "transaction_amount": 200,
    "card": {},
    "transaction_details": {
        "total_paid_amount": 200,
        "payment_method_reference_id": null,
        "net_received_amount": 174,
        "financial_institution": null,
        "installment_amount": 0,
        "external_resource_url": null,
        "overpaid_amount": 0
    },
    "coupon_amount": 0,
    "metadata": {},
    "collector_id": 44696990,
    "status": "approved",
    "status_detail": "accredited",
    "transaction_id": null,
    "installments": 1,
    "internal_metadata": {
        "rule_id": "50005",
        "concept": "marketplace_order",
        "type": "outbound_payment",
        "splitter_id": "74066",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    },
    "refunds": [],
    "payment_type_id": "account_money",
    "profile_id": null,
    "payer_tags": [],
    "coupon_id": null,
    "fee_details": [
        {
            "amount": 26,
            "fee_payer": "collector",
            "type": "application_fee"
        }
    ],
    "collector": {
        "id": 44696990,
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot",
        "phone": {
            "extension": "",
            "area_code": "",
            "number": "3515297390"
        },
        "email": "leandrobertalot@hotmail.com",
        "identification": {
            "number": "29933632",
            "type": "DNI"
        }
    },
    "money_release_days": 0,
    "order": {},
    "external_reference": "1289297748",
    "available_actions": [],
    "application_id": 6492251534497263,
    "marketplace": "MELI",
    "risk_execution_id": 13960639183,
    "call_for_authorize_id": null,
    "api_version": "2",
    "currency_id": "BRL",
    "sponsor_id": null,
    "payment_method_id": "account_money",
    "deduction_schema": null,
    "site_id": "MLB",
    "operation_type": "regular_payment",
    "binary_mode": false,
    "money_release_date": "2017-06-28T16:27:04-04:00",
    "differential_pricing_id": null,
    "payer": {
        "id": "222113214",
        "first_name": "Test",
        "last_name": "Teste",
        "phone": {
            "extension": null,
            "area_code": "01",
            "number": "1111-1111"
        },
        "email": "test_user_64693035@testuser.com",
        "identification": {
            "number": "11111111111",
            "type": "IFE"
        },
        "entity_type": null,
        "type": "registred"
    },
    "notification_url": null,
    "transaction_amount_refunded": 0,
    "authorization_code": null,
    "live_mode": true
}

Payment (Versão 1 Pagamento do shipment)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/collections/2574435135?access_token=

Resposta:

{
    "id": 2574435135,
    "statement_descriptor": null,
    "captured": true,
    "date_created": "2017-06-28T16:45:38-04:00",
    "date_last_updated": "2017-06-28T16:45:38-04:00",
    "date_approved": "2017-06-28T16:45:38-04:00",
    "payer_id": 222113214,
    "issuer_id": null,
    "description": "marketplace_shipment",
    "transaction_amount": 20,
    "card": {},
    "transaction_details": {
        "total_paid_amount": 20,
        "payment_method_reference_id": null,
        "net_received_amount": 20,
        "financial_institution": null,
        "installment_amount": 0,
        "external_resource_url": null,
        "overpaid_amount": 0
    },
    "coupon_amount": 0,
    "metadata": {},
    "collector_id": 44696990,
    "status": "approved",
    "status_detail": "accredited",
    "transaction_id": null,
    "installments": 1,
    "internal_metadata": {
        "rule_id": "50006",
        "concept": "marketplace_shipment",
        "type": "outbound_payment",
        "splitter_id": "74066",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    },
    "refunds": [],
    "payment_type_id": "account_money",
    "profile_id": null,
    "payer_tags": [],
    "coupon_id": null,
    "fee_details": [],
    "collector": {
        "id": 44696990,
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot",
        "phone": {
            "extension": "",
            "area_code": "",
            "number": "3515297390"
        },
        "email": "leandrobertalot@hotmail.com",
        "identification": {
            "number": "29933632",
            "type": "DNI"
        }
    },
    "money_release_days": 0,
    "order": {},
    "external_reference": "25943399274",
    "available_actions": [],
    "application_id": 6492251534497263,
    "marketplace": "MELI",
    "risk_execution_id": 13962524282,
    "call_for_authorize_id": null,
    "api_version": "2",
    "currency_id": "BRL",
    "sponsor_id": null,
    "payment_method_id": "account_money",
    "deduction_schema": null,
    "site_id": "MLB",
    "operation_type": "regular_payment",
    "binary_mode": false,
    "money_release_date": "2017-06-28T16:45:38-04:00",
    "differential_pricing_id": null,
    "payer": {
        "id": "222113214",
        "first_name": "Test",
        "last_name": "Test",
        "phone": {
            "extension": null,
            "area_code": "01",
            "number": "1111-1111"
        },
        "email": "test_user_64693035@testuser.com",
        "identification": {
            "number": "11111111111",
            "type": "IFE"
        },
        "entity_type": null,
        "type": "registred"
    },
    "notification_url": null,
    "transaction_amount_refunded": 0,
    "authorization_code": null,
    "live_mode": true
}

Caso de uso com duas orders

Payment (Pagamento da order 1)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/payments/2574469258?access_token=

Resposta:

{
    "id": 2574469258,
    "site_id": "MLB",
    "date_created": "2017-06-28T17:45:24-04:00",
    "date_approved": "2017-06-28T17:45:24-04:00",
    "money_release_date": "2017-06-28T17:45:24-04:00",
    "last_modified": "2017-06-28T17:45:24-04:00",
    "sponsor_id": null,
    "collector_id": 44696990,
    "payer": {
        "id": 240490047,
        "email": "test_user_9968521@testuser.com",
        "phone": {
            "area_code": "null",
            "number": "null",
            "extension": "",
            "verified": false
        },
        "identification": {
            "type": "",
            "number": ""
        }
    },
    "order_id": "1289342697",
    "external_reference": "1289342697",
    "merchant_order_id": null,
    "reason": "Item De Testeo, Por Favor No Ofertar",
    "currency_id": "BRL",
    "transaction_amount": 200,
    "mercadopago_fee": 0,
    "net_received_amount": 200,
    "total_paid_amount": 200,
    "shipping_cost": 0,
    "coupon_amount": 0,
    "coupon_fee": 0,
    "finance_fee": 0,
    "discount_fee": 0,
    "coupon_id": null,
    "status": "approved",
    "status_detail": "accredited",
    "status_code": null,
    "issuer_id": null,
    "installment_amount": 0,
    "deferred_period": null,
    "account_money_amount": 0,
    "payment_type": "account_money",
    "payment_method_id": "account_money",
    "marketplace": "MELI",
    "operation_type": "regular_payment",
    "marketplace_fee": 0,
    "released": "no",
    "deduction_schema": null,
    "tags": [
        "new"
    ],
    "refunds": [],
    "amount_refunded": 0,
    "client_id": "6492251534497263",
    "created_from": "6492251534497263",
    "notification_url": null,
    "concept_id": null,
    "concept_amount": 0,
    "internal_metadata": {
        "rule_id": "50005",
        "concept": "marketplace_order",
        "type": "outbound_payment",
        "splitter_id": "74066",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    }
}

Payment (Pagamento da order 2)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/payments/2574470906?access_token=

Resposta:

{
    "id": 2574470906,
    "site_id": "MLB",
    "date_created": "2017-06-28T17:46:51-04:00",
    "date_approved": "2017-06-28T17:46:51-04:00",
    "money_release_date": "2017-06-28T17:46:51-04:00",
    "last_modified": "2017-06-28T17:46:51-04:00",
    "sponsor_id": null,
    "collector_id": 44696990,
    "payer": {
        "id": 240490047,
        "email": "test_user_9968521@testuser.com",
        "phone": {
            "area_code": "null",
            "number": "null",
            "extension": "",
            "verified": false
        },
        "identification": {
            "type": "",
            "number": ""
        }
    },
    "order_id": "1289343330",
    "external_reference": "1289343330",
    "merchant_order_id": null,
    "reason": "Item De Teste, Por Favor Não Ofertar.",
    "currency_id": "BRL",
    "transaction_amount": 300,
    "mercadopago_fee": 0,
    "net_received_amount": 300,
    "total_paid_amount": 300,
    "shipping_cost": 0,
    "coupon_amount": 0,
    "coupon_fee": 0,
    "finance_fee": 0,
    "discount_fee": 0,
    "coupon_id": null,
    "status": "approved",
    "status_detail": "accredited",
    "status_code": null,
    "issuer_id": null,
    "installment_amount": 0,
    "deferred_period": null,
    "account_money_amount": 0,
    "payment_type": "account_money",
    "payment_method_id": "account_money",
    "marketplace": "MELI",
    "operation_type": "regular_payment",
    "marketplace_fee": 0,
    "released": "no",
    "deduction_schema": null,
    "tags": [
        "new"
    ],
    "refunds": [],
    "amount_refunded": 0,
    "client_id": "6492251534497263",
    "created_from": "6492251534497263",
    "notification_url": null,
    "concept_id": null,
    "concept_amount": 0,
    "internal_metadata": {
        "rule_id": "50005",
        "concept": "marketplace_order",
        "type": "outbound_payment",
        "splitter_id": "74066",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    }
}

Payment (Pagamento do shipment)
Chamada:

curl -H "x-format-new:true" https://api.mercadolibre.com/carrito_mocks/payments/2574470882?access_token=

Resposta:

{
    "id": 2574470882,
    "site_id": "MLB",
    "date_created": "2017-06-28T17:52:20-04:00",
    "date_approved": "2017-06-28T17:52:20-04:00",
    "money_release_date": "2017-06-28T17:52:20-04:00",
    "last_modified": "2017-06-28T17:52:20-04:00",
    "sponsor_id": null,
    "collector_id": 44696990,
    "payer": {
        "id": 222113214,
        "email": "test_user_64693035@testuser.com",
        "phone": {
            "area_code": "01",
            "number": "1111-1111",
            "extension": "",
            "verified": false
        },
        "identification": {
            "type": "IFE",
            "number": "11111111111"
        }
    },
    "order_id": "25943308796",
    "external_reference": "25943308796",
    "merchant_order_id": null,
    "reason": "marketplace_shipment",
    "currency_id": "BRL",
    "transaction_amount": 50,
    "mercadopago_fee": 0,
    "net_received_amount": 50,
    "total_paid_amount": 50,
    "shipping_cost": 0,
    "coupon_amount": 0,
    "coupon_fee": 0,
    "finance_fee": 0,
    "discount_fee": 0,
    "coupon_id": null,
    "status": "approved",
    "status_detail": "accredited",
    "status_code": null,
    "issuer_id": null,
    "installment_amount": 0,
    "deferred_period": null,
    "account_money_amount": 0,
    "payment_type": "account_money",
    "payment_method_id": "account_money",
    "marketplace": "MELI",
    "operation_type": "regular_payment",
    "marketplace_fee": 0,
    "released": "no",
    "deduction_schema": null,
    "tags": [],
    "refunds": [],
    "amount_refunded": 0,
    "client_id": "6492251534497263",
    "created_from": "6492251534497263",
    "notification_url": null,
    "concept_id": null,
    "concept_amount": 0,
    "internal_metadata": {
        "rule_id": "52004",
        "concept": "marketplace_shipment",
        "type": "outbound_payment",
        "splitter_id": "76063",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    }
}

Payment (Versão 1 Pagamento da order)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/collections/2574469258?access_token=

Resposta:

{
    "id": 2574469258,
    "statement_descriptor": null,
    "captured": true,
    "date_created": "2017-06-28T17:54:17-04:00",
    "date_last_updated": "2017-06-28T17:54:17-04:00",
    "date_approved": "2017-06-28T17:54:17-04:00",
    "payer_id": 222113214,
    "issuer_id": null,
    "description": "Item De Teste, Por Favor Não Ofertar.",
    "transaction_amount": 200,
    "card": {},
    "transaction_details": {
        "total_paid_amount": 200,
        "payment_method_reference_id": null,
        "net_received_amount": 174,
        "financial_institution": null,
        "installment_amount": 0,
        "external_resource_url": null,
        "overpaid_amount": 0
    },
    "coupon_amount": 0,
    "metadata": {},
    "collector_id": 44696990,
    "status": "approved",
    "status_detail": "accredited",
    "transaction_id": null,
    "installments": 1,
    "internal_metadata": {
        "rule_id": "52001",
        "concept": "marketplace_order",
        "type": "outbound_payment",
        "splitter_id": "76062",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    },
    "refunds": [],
    "payment_type_id": "account_money",
    "profile_id": null,
    "payer_tags": [],
    "coupon_id": null,
    "fee_details": [
        {
            "amount": 26,
            "fee_payer": "collector",
            "type": "application_fee"
        }
    ],
    "collector": {
        "id": 44696990,
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot",
        "phone": {
            "extension": "",
            "area_code": "",
            "number": "3515297390"
        },
        "email": "leandrobertalot@hotmail.com",
        "identification": {
            "number": "29933632",
            "type": "DNI"
        }
    },
    "money_release_days": 0,
    "order": {},
    "external_reference": "1289342698",
    "available_actions": [],
    "application_id": 6492251534497263,
    "marketplace": "MELI",
    "risk_execution_id": 13962540810,
    "call_for_authorize_id": null,
    "api_version": "2",
    "currency_id": "BRL",
    "sponsor_id": null,
    "payment_method_id": "account_money",
    "deduction_schema": null,
    "site_id": "MLB",
    "operation_type": "regular_payment",
    "binary_mode": false,
    "money_release_date": "2017-06-28T17:54:17-04:00",
    "differential_pricing_id": null,
    "payer": {
        "id": "222113214",
        "first_name": "Test",
        "last_name": "Test",
        "phone": {
            "extension": null,
            "area_code": "01",
            "number": "1111-1111"
        },
        "email": "test_user_64693035@testuser.com",
        "identification": {
            "number": "11111111111",
            "type": "IFE"
        },
        "entity_type": null,
        "type": "registred"
    },
    "notification_url": null,
    "transaction_amount_refunded": 0,
    "authorization_code": null,
    "live_mode": true
}

Payment (Versão 1 Pagamento da order 2)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/collections/2574470906?access_token=

Resposta:

{
    "id": 2574470906,
    "statement_descriptor": null,
    "captured": true,
    "date_created": "2017-06-28T17:56:30-04:00",
    "date_last_updated": "2017-06-28T17:56:30-04:00",
    "date_approved": "2017-06-28T17:56:30-04:00",
    "payer_id": 222113214,
    "issuer_id": null,
    "description": "Item De Teste, Por Favor Não Ofertar.",
    "transaction_amount": 300,
    "card": {},
    "transaction_details": {
        "total_paid_amount": 300,
        "payment_method_reference_id": null,
        "net_received_amount": 261,
        "financial_institution": null,
        "installment_amount": 0,
        "external_resource_url": null,
        "overpaid_amount": 0
    },
    "coupon_amount": 0,
    "metadata": {},
    "collector_id": 44696990,
    "status": "approved",
    "status_detail": "accredited",
    "transaction_id": null,
    "installments": 1,
    "internal_metadata": {
        "rule_id": "52003",
        "concept": "marketplace_order",
        "type": "outbound_payment",
        "splitter_id": "76063",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    },
    "refunds": [],
    "payment_type_id": "account_money",
    "profile_id": null,
    "payer_tags": [],
    "coupon_id": null,
    "fee_details": [
        {
            "amount": 39,
            "fee_payer": "collector",
            "type": "application_fee"
        }
    ],
    "collector": {
        "id": 44696990,
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot",
        "phone": {
            "extension": "",
            "area_code": "",
            "number": "3515297390"
        },
        "email": "leandrobertalot@hotmail.com",
        "identification": {
            "number": "29933632",
            "type": "DNI"
        }
    },
    "money_release_days": 0,
    "order": {},
    "external_reference": "1289343330",
    "available_actions": [],
    "application_id": 6492251534497263,
    "marketplace": "MELI",
    "risk_execution_id": 13962541637,
    "call_for_authorize_id": null,
    "api_version": "2",
    "currency_id": "BRL",
    "sponsor_id": null,
    "payment_method_id": "account_money",
    "deduction_schema": null,
    "site_id": "MLB",
    "operation_type": "regular_payment",
    "binary_mode": false,
    "money_release_date": "2017-06-28T17:56:30-04:00",
    "differential_pricing_id": null,
    "payer": {
        "id": "222113214",
        "first_name": "Test",
        "last_name": "Test",
        "phone": {
            "extension": null,
            "area_code": "01",
            "number": "1111-1111"
        },
        "email": "test_user_64693035@testuser.com",
        "identification": {
            "number": "11111111111",
            "type": "IFE"
        },
        "entity_type": null,
        "type": "registred"
    },
    "notification_url": null,
    "transaction_amount_refunded": 0,
    "authorization_code": null,
    "live_mode": true
}

Payment (Versão 1 Pagamento do shipment)
Chamada:

curl -H "x-format-new:true" 'https://api.mercadolibre.com/carrito_mocks/collections/2574470882?access_token=

Resposta:

{
    "id": 2574470882,
    "statement_descriptor": null,
    "captured": true,
    "date_created": "2017-06-28T18:01:46-04:00",
    "date_last_updated": "2017-06-28T18:01:46-04:00",
    "date_approved": "2017-06-28T18:01:46-04:00",
    "payer_id": 222113214,
    "issuer_id": null,
    "description": "marketplace_shipment",
    "transaction_amount": 50,
    "card": {},
    "transaction_details": {
        "total_paid_amount": 50,
        "payment_method_reference_id": null,
        "net_received_amount": 50,
        "financial_institution": null,
        "installment_amount": 0,
        "external_resource_url": null,
        "overpaid_amount": 0
    },
    "coupon_amount": 0,
    "metadata": {},
    "collector_id": 44696990,
    "status": "approved",
    "status_detail": "accredited",
    "transaction_id": null,
    "installments": 1,
    "internal_metadata": {
        "rule_id": "52004",
        "concept": "marketplace_shipment",
        "type": "outbound_payment",
        "splitter_id": "76063",
        "billing_infomation": {
            "buyer": {
                "id": 0,
                "identification": {
                    "type": "",
                    "number": ""
                }
            },
            "cardholder": {
                "name": "",
                "identification": {
                    "number": "",
                    "type": ""
                }
            }
        }
    },
    "refunds": [],
    "payment_type_id": "account_money",
    "profile_id": null,
    "payer_tags": [],
    "coupon_id": null,
    "fee_details": [],
    "collector": {
        "id": 44696990,
        "first_name": "Leandro Ronaldo",
        "last_name": "Bertalot",
        "phone": {
            "extension": "",
            "area_code": "",
            "number": "3515297390"
        },
        "email": "leandrobertalot@hotmail.com",
        "identification": {
            "number": "29933632",
            "type": "DNI"
        }
    },
    "money_release_days": 0,
    "order": {},
    "external_reference": "25943308796",
    "available_actions": [],
    "application_id": 6492251534497263,
    "marketplace": "MELI",
    "risk_execution_id": 13962541612,
    "call_for_authorize_id": null,
    "api_version": "2",
    "currency_id": "BRL",
    "sponsor_id": null,
    "payment_method_id": "account_money",
    "deduction_schema": null,
    "site_id": "MLB",
    "operation_type": "regular_payment",
    "binary_mode": false,
    "money_release_date": "2017-06-28T18:01:46-04:00",
    "differential_pricing_id": null,
    "payer": {
        "id": "222113214",
        "first_name": "Test",
        "last_name": "Test",
        "phone": {
            "extension": null,
            "area_code": "01",
            "number": "1111-1111"
        },
        "email": "test_user_64693035@testuser.com",
        "identification": {
            "number": "11111111111",
            "type": "IFE"
        },
        "entity_type": null,
        "type": "registred"
    },
    "notification_url": null,
    "transaction_amount_refunded": 0,
    "authorization_code": null,
    "live_mode": true
}

Please rate this

Gerenciamento de Pagamentos

Continuando com as mudanças que você deverá levar em conta com a chegada do Carrinho de Compras, vamos falar sobre como será o gerenciamento de pagamentos dentro desta nova funcionalidade.
Da mesma forma que acontece atualmente, o comprador poderá pagar a compra com qualquer meio de pagamento oferecido pelo Mercado Pago do Mercado Livre.
Esses pagamentos são chamados de Inbound Payments, pagamentos do comprador para uma conta interna do Mercado Pago.
Por outro lado, quando a compra é paga em sua totalidade, o dinheiro de Inbound Payments é distribuído em cada uma das ordens e envios, gerando, assim, um Outbound Payments.

Notas:

  • Os Outbound Payments são sempre pagamentos em dinheiro, realizados em contas do Mercado Pago.
  • O collector dos Outbound Payments é o vendedor do item, mas o payer é a conta interna do Mercado Pago acima mencionada.
  • Os pagamentos das ordens são notificados aos vendedores, os quais serão as únicas pessoas que terão acesso a eles.

Para obter os dados relacionados ao comprador dentro de Carrinho de Compras, um novo nó será adicionado, o qual será chamado de “internal_metadata” , contendo as informações de faturamento necessárias no nó “billing_information”.

Chamada:

https://api.mercadolibre.com/collections/{collection_id}?access_token=
{
  "id": 2910384756,
  "site_id": "MLM",
  "date_created": "2017-01-23T16:38:43.000-04:00",
  "date_approved": "2017-01-23T16:38:44.000-04:00",
  "last_modified": "2017-01-23T16:38:44.000-04:00",
  . . .
  "payer": {
    "id": 241760979,
    /*
   
    */
  }
  "internal_metadata": {
    "rule_id": "34004",
    "concept": "marketplace_order",
    "type": "outbound_payment",
    "splitter_id": "56020",
    "billing_information": {
      "buyer": {
        "id": 1029384756,
        "identification": {
          "type": "CURP",
          "number": "12345678"
        }
      },
      "cardholder": {
        "name": "Juan Carlos Test",
        "identification": {
          "number": "12345678",
          "type": "CURP"
        }
      }
    }
  }
}

Notas:

  • Os dados recebidos dentro de “payer” são da conta interna do Mercado Pago, não do comprador.
  • Para diferenciar um pagamento realizado dentro de Carrinho de Compras de outro feito de forma usual, só será necessário ler as informações recebidas dentro de “internal_metadata”.
    Caso o nó esteja vazio, o pagamento será por compras comuns.

Se você quiser mais informações sobre como deve utilizar os recursos “payments” e “collections”, revise a documentação disponível de Gerencie Vendas.

Lembre que, na primeira versão, só haverá um meio de pagamento disponível, mas em versões posteriores haverá 2 ou mais possibilidades de combinação.

Seguinte: Testes com Carrinho de Compras.

Please rate this

Gerenciamento de Envios

A chegada do Carrinho de Compras traz mudanças nos principais recursos da nossa API. Uma delas, o recurso de Shipments, contém todas as informações relacionadas ao envio que deve ser realizado para finalizar a transação.

Nota: Lembre que, para trabalhar com o JSON de shipments, ao fazer o GET, você deverá enviar o parâmetro “x-format-new: true”.

Conteúdo:

É importante lembrar que o novo JSON de Orders não vai mais conter os dados de Shipping, como tem sido até agora.
O recurso /shipments/shipment_id/ continuará tendo sua estrutura, mostrando as informações básicas para a realização do envio.
Introduzimos algumas mudanças na estrutura do JSON, que você pode ver abaixo:

GET https://api.mercadolibre.com/shipments/shipment_id?access_token=token
{
  "id": 0,
  "external_reference": "string",
   "status": "string",
  "substatus": "string",
  "date_created": "string",
  "last_updated": "string",
  "declared_value": 0,
  "dimensions": {
    "height": 0,
    "width": 0,
    "length": 0,
    "weight": 0
  },
  "logistic": {
    "direction": "forward",
    "mode": "me2",
    "type": "drop_off"
  },
  "source": {
    "site_id": "MLM",
    "market_place": "MELI",
    "application_id": null
  },
  "tracking_number": "string",
  "origin": {
    "type": "selling_address",
    "sender_id": 0,
    "shipping_address": {
      "id": 0,
      "address_id": 0,
      "address_line": "string",
      "street_name": "string",
      "street_number": 0,
      "comment": "string",
      "zip_code": "string",
      "city": {
        "id": "string",
        "name": "string"
      },
      "state": {
        "id": "string",
        "name": "string"
      },
      "country": {
        "id": "string",
        "name": "string"
      },
      "neighborhood": {
        "id": "string",
        "name": "string"
      },
      "municipality": {
        "id": "string",
        "name": "string"
      },
      "types": {
        "default_buying_address": 0
      },
      "agency": {
        "carrier_id": 0,
        "agency_id": "string",
        "description": "string",
        "phone": "string",
        "open_hours": "string"
      },
      "latitude": 0,
      "longitude": 0,
      "geolocation_type": "string",
      "is_valid_for_carrier": true
    }
  },
  "destination": {
    "type": "buying_address",
    "receiver_id": 0,
    "receiver_name": "string",
    "receiver_phone": "string",
    "comments": "string",
    "shipping_address": {
      "id": 0,
      "address_id": 0,
      "address_line": "string",
      "street_name": "string",
      "street_number": 0,
      "comment": "string",
      "zip_code": "string",
      "city": {
        "id": "string",
        "name": "string"
      },
      "state": {
        "id": "string",
        "name": "string"
      },
      "country": {
        "id": "string",
        "name": "string"
      },
      "neighborhood": {
        "id": "string",
        "name": "string"
      },
      "municipality": {
        "id": "string",
        "name": "string"
      },
      "types": {
        "default_buying_address": 0
      },
      "agency": {
        "carrier_id": 0,
        "agency_id": "string",
        "description": "string",
        "phone": "string",
        "open_hours": "string"
      },
      "latitude": 0,
      "longitude": 0,
      "geolocation_type": "string",
      "is_valid_for_carrier": true
    }
  },
  "lead_time": {
    "option_id": 0,
    "shipping_method": {
      "id": 0,
      "type": "standard",
      "name": "string",
      "deliver_to": "address"
    },
    "currency_id": "string",
    "cost": 0,
    "cost_type": "charged",
    "service_id": 0,
    "estimated_delivery_time": {
      "type": "known",
      "date": "string",
      "shipping": 0,
      "handling": 0,
      "unit": "string",
      "offset": {
        "date": "string",
        "shipping": 0
      },
      "time_frame": {
        "from": 0,
        "to": 0
      },
      "pay_before": "string"
    }
  },
  "tags": [
    "string"
  ]
}

Para entender a que refere cada um dos parâmetros, faça a seguinte chamada:

GET https://api.mercadolibre.com/shipments/shipment_id?options&access_token=token

Novos recursos

Com a nova versão do recurso Shipments, há novos recursos complementares que trarão informações detalhadas para poder trabalhar de maneira mais eficiente. A seguir, ampliamos cada um deles.
Ver api docs de recursos existentes.

Itens

O recurso /shipments/shipment_id/items retorna os itens associados a um shipment. Caso o item contenha variações (Por exemplo, tamanho ou cor em vestuário), você também poderá ver qual corresponde à ordem dentro do envio. À medida que envios com mais de um item forem sendo habilitados, a lista passará a conter cada um deles.
Nota: Cada vendedor só visualizará seus próprios produtos.

GET https://api.mercadolibre.com/shipments/shipment_id/items

[
  {
    "item_id": "string",
    "description": "string",
    "quantity": 0,
    "variation_id": 0,
    "dimensions": {
      "height": 0,
      "width": 0,
      "length": 0,
      "weight": 0
    },
    "order_id": 0,
    "sender_id": 0
  }
]

Costs

O recurso /shipments/shipment_id/costs retorna os custos do envio a serem pagos pelo usuário.
Também poderá ser visualizada a economia atingida pelo envio de mais de um produto na mesma caixa (quando esta funcionalidade estiver habilitada), através do parâmetro “save”, caso exista.

GET https://api.mercadolibre.com/shipments/shipment_id/costs
{
    "receiver": {
    "user_id": 123,
    "cost": 100,
    "discount": {
      "rate": 0,
      "type": "string",
      "promoted_amount": 0
    },
    "compensation": 0,
    "save": 0
  },
  "senders": [
    {
      "user_id": 321,
      "cost": 0,
      "discount": {
        "rate": 0,
        "type": "string",
        "promoted_amount": 0
      },
      "compensation": 0,
      "save": 0
    }
  ]
}

Lead Time

O recurso /shipments/shipment_id/lead_time retorna tudo o referido a prazos de entrega de um envio e tipo de serviço, adicionando datas-limite de encaminhamento e entrega.
Embora o recurso de shipment já contenha informações úteis para fazer essas estimativas, aqui você poderá visualizá-lo de forma mais detalhada, ajudando a oferecer uma melhor experiência ao usuário.

GET https://api.mercadolibre.com/shipments/shipment_id/lead_time
{
  "option_id": 0,
  "shipping_method": {
    "id": 0,
    "type": "standard",
    "name": "string",
    "deliver_to": "address"
  },
  "currency_id": "string",
  "cost": 0,
  "cost_type": "charged",
  "service_id": 0,
  "estimated_delivery_time": {
    "type": "known",
    "date": "string",
    "shipping": 0,
    "handling": 0,
    "unit": "string",
    "offset": {
      "date": "string",
      "shipping": 0
    },
    "time_frame": {
      "from": 0,
      "to": 0
    },
    "pay_before": "string"
  },
  "estimated_handling_limit": {
    "date":  "2016-12-30T12:32:35.000Z"
  },
  "estimated_delivery_extended": {
    "date":  "2016-12-30T12:32:35.000Z"
  },
  "estimated_delivery_limit": {
    "date":  "2016-12-30T12:32:35.000Z"
  },
  "estimated_delivery_final": {
    "date":  "2016-12-30T12:32:35.000Z"
  },
  "delay": [
    "shipping_delayed",
  ]
}

Nota: lembre que o campo cost_type pode ser “free”, “charged” ou “partially_free”.

Descrição dos tempos de estimativa

São as datas-limite para o envio ser encaminhado e enviado.

estimated_handling_limit: Data-limite para o vendedor encaminhar. Considere que apenas é levada em conta a data, pois a hora é informada somente para manter uma estrutura. Isto é, você tem todo o dia informado no campo para realizar o envio antes de este ser marcado como demorado para o dia seguinte.

estimated_delivery_extended: Segunda promessa de entrega, caso a primeira não tenha sido atendida.

estimated_delivery_limit: Data-limite para o comprador cancelar a compra e pedir a devolução de dinheiro, desde que o envio ainda não tenha chegado.

estimated_delivery_final: Data final para a chegada do envio e para determinação do status final, que pode ser delivered ou, caso haja alguma reclamação, not_delivered.

Ver mais informações sobre tipos de promessa de entrega.

History

O recurso /shipments/shipment_id/history retorna o histórico de status e substatus associados ao ciclo de vida do shipment.

GET https://api.mercadolibre.com/shipments/shipment_id/history

[
  {
    "status": "string",
    "substatus": "string",
    "date": "2016-12-30T12:32:35.000Z"
  }
]

Exemplo:

https://api.mercadolibre.com/shipments/1234567899/history

[
  {
    "status": "ready_to_ship",
    "substatus": "printed",
    "date":  "2016-12-30T12:32:35.000Z"
  },
  {
    "status": "handling",
    "substatus": "waiting_for_label_generation",
    "date":  "2016-12-30T12:32:35.000Z"
  },

]

Ver informações sobre status e substatus pelos que um envio pode passar.

Payments

O recurso /shipments/shipment_id/payments retorna os payments associados ao envio.
Lembre que agora o pagamento do envio será discriminado e você poderá, a partir deste recurso, consumir informações básicas sobre ele. O payment_id funciona da mesma forma que o de uma ordem.

GET https://api.mercadolibre.com/shipments/shipment_id/payments
[
  {
    "payment_id": 0,
    "amount": 0,
    "status": "string"
  }
]

Parâmetros disponíveis

A seguir, mostramos os valores disponíveis para cada parâmetro:
logistic.direction: forward, return
logistic.mode: me2, me1, custom
logistic.type: default, drop_off, xd_drop_off, cross_docking, fulfillment


source.site_id: sites
source.market_place: Mercado Livre, OFF


lead_time.shipping_method.type: next_day, express, standard, same_day
lead_time.shipping_method.deliver_to: address, agency


lead_time.currency_id: currencies
lead_time.cost_type: free, partially_free, charged


lead_time.delay: handling_delayed, shipping_delayed, shipping_delayed_extended


destination/origin.type: agency, buying_address, selling_address


discount.type: loyal, special

Itens não combináveis (nova funcionalidade)

No caso em que você tenha um problema no momento de agrupar diferentes produtos em um mesmo pacote (seja porque estão em depósitos diferentes, ou são frágeis, ou não entram em uma mesma caixa, etc) você pode utilizar o recurso que te permite gerar pacotes adicionais para poder despachar todos os produtos.

Exemplo:

POST https://api.mercadolibre.com/shipments/shipment_id/split?access_token=token

JSON:

	{
  "shipments": [
    {
      "reason": "text",
                   “description”: “text”
      "orders": [
        {
          "id": "order_id",

        }
      ]
    }
  ]
}

Tenha em conta que esse recurso é para evitar problemas na hora de empacotar os produtos mas não deve ser usada em todos os casos. Somente em casos de extrema necessidade. Mais pra frente estaremos melhorando esse processo.

Valores possíveis no campo “reason”

  • different_warehouse
  • fragile
  • shape
  • other_reason

Notas:

  • O “order_ID” acima se refere ao produto a ser retirado do “Shipping” original.
  • Um novo shipping será gerado contendo o order ID acima.
  • A API não irá devolver nenhuma resposta após esta chamada somente o status 201.
  • Deve-se escutar via notificações se existe algum novo shipping e fazer o GET deste novo.



Seguinte: Gerenciamento de Pagamentos.

Please rate this

Gerenciamento de Ordens

Com a chegada desta nova funcionalidade, haverá uma mudança na estrutura do JSON no recurso Orders. A diferença principal será que as informações de envio não estarão mais disponíveis dentro dele, só estará disponível o ID associado, para depois procurar as informações complementares no recurso /shipments.

Nota: Lembre que, para trabalhar com o JSON atualizado, ao fazer o GET, você deverá enviar o parâmetro “x-format-new: true”.
O restante da estrutura do recurso continuará funcionando da mesma forma, com algumas alterações que você deverá levar em conta.

curl -X GET -H x-format-new: true https://api.mercadolibre.com/orders/order_id?access_token=ACCESS_TOKEN

JSON prévio

{
    "id": 1014059850,
    "date_created": "2015-10-23T16:51:28.000-04:00",
    "date_closed": "2015-10-23T16:53:23.000-04:00",
    "last_updated": "2017-01-11T10:10:01.000-04:00",
    "feedback": {
        "purchase": {
            "id": 9040293414049,
            "date_created": null,
            "fulfilled": null,
            "rating": null,
            "status": "inactive"
        },
        "sale": {
            "id": 9040293397904,
            "date_created": "2015-10-27T19:02:38.000-04:00",
            "fulfilled": true,
            "rating": "positive",
            "status": "active"
        }
    },
    "mediations": [
        
    ],
    "comments": null,
    "order_request": {
        "return": null,
        "change": null
    },
    "fulfilled": true,
    "shipping": {
        "id": 21491526998,
        "site_id": "MLM",
        "shipment_type": "shipping",
        "mode": "me2",
        "shipping_mode": "me2",
        "status": "delivered",
        "shipping_items": [
            {
                "id": "MLM688179011",
                "description": "Item de Test",
                "quantity": 1,
                "dimensions": "5.0x11.0x25.0,100.0"
            }
        ],
        "shipping_option": {
            "id": 100184113,
            "shipping_method_id": 111,
            "name": "Testing Method",
            "currency_id": "MXN",
            "list_cost": 7.89,
            "cost": 0,
            "estimated_handling_limit": {
                "date": "2015-10-26T00:00:00.000-02:00"
            },
            "estimated_delivery_final": {
                "date": "2015-11-26T00:00:00.000-02:00"
            },
            "estimated_delivery_limit": {
                "date": "2015-11-19T00:00:00.000-02:00"
            },
            "estimated_delivery_extended": {
                "date": "2015-11-03T00:00:00.000-02:00"
            },
            "estimated_delivery_time": {
                "type": "known_frame",
                "date": "2015-10-27T00:00:00.000-02:00",
                "shipping": 24,
                "handling": 24,
                "unit": "hour",
                "offset": {
                    "date": "2015-10-28T00:00:00.000-02:00",
                    "shipping": 24
                },
                "time_frame": {
                    "from": null,
                    "to": null
                },
                "pay_before": null
            }
        },
        "currency_id": "MXN",
        "receiver_address": {
            "id": 167418200,
            "address_line": "Test Street 123",
            "street_name": "Test Street",
            "street_number": "123",
            "comment": "apartamento 2",
            "zip_code": "343435",
            "city": {
                "id": "TUxNQ1RPTDc0Mzc",
                "name": "Toluca"
            },
            "state": {
                "id": "MX-MEX",
                "name": "Estado de Mexico"
            },
            "country": {
                "id": "MX",
                "name": "Mexico"
            },
            "neighborhood": {
                "id": null,
                "name": "Test"
            },
            "municipality": {
                "id": null,
                "name": null
            },
            "types": [
                "default_buying_address",
                "billing"
            ],
            "latitude": -19.88,
            "longitude": -43.96,
            "geolocation_type": "ROOFTOP",
            "agency": null,
            "is_valid_for_carrier": true,
            "receiver_name": "Juan Garcia",
            "receiver_phone": "3131313131"
        },
        "sender_address": {
            "id": 73125800,
            "address_line": "Calle Sin Nombre 1234",
            "street_name": "Calle Sin Nombre",
            "street_number": "1234",
            "comment": "  ",
            "zip_code": "454545",
            "city": {
                "id": "TUxNQ1RPTDc0Mzc",
                "name": "Toluca"
            },
            "state": {
                "id": "MX-MEX",
                "name": "Estado de Mexico"
            },
            "country": {
                "id": "MX",
                "name": "Mexico"
            },
            "neighborhood": {
                "id": null,
                "name": "Test"
            },
            "municipality": {
                "id": null,
                "name": null
            },
            "types": [
                "billing",
                "default_buying_address",
                "shipping",
                "default_selling_address"
            ],
            "latitude": -19.87,
            "longitude": -43.95,
            "geolocation_type": "RANGE_INTERPOLATED",
            "agency": null,
            "is_valid_for_carrier": true
        },
        "picking_type": null,
        "cost": 0,
        "substatus": null,
        "date_created": "2015-10-23T16:53:13.000-04:00",
        "date_first_printed": "2015-10-26T09:26:31.000-04:00",
        "service_id": 23,
        "receiver_id": 121212121,
        "sender_id": 3434343434,
        "cost_components": {
            "special_discount": 0,
            "loyal_discount": 0,
            "compensation": 0
        }
    },
    "expiration_date": "2015-11-13T16:53:23.000-04:00",
    "status": "paid",
    "status_detail": null,
    "order_items": [
        {
            "item": {
                "id": "MLB688179011",
                "title": "Paleta Naked 2 - Urban Decay !!! Frete Grátis !!!",
                "category_id": "MLB182078",
                "variation_id": null,
                "seller_custom_field": null,
                "variation_attributes": [
                    
                ],
                "warranty": null,
                "condition": null
            },
            "quantity": 1,
            "unit_price": 79.99,
            "currency_id": "BRL"
        }
    ],
    "currency_id": "BRL",
    "buyer": {
        "id": 121212121,
        "nickname": "TESTMEX",
        "email": "testing+email@mercadolibre.com",
        "phone": {
            "area_code": null,
            "number": "011111111",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "",
            "number": "",
            "extension": ""
        },
        "first_name": "Juan",
        "last_name": "Garcia",
        "billing_info": {
            "doc_type": "RFC",
            "doc_number": "ROHA944443AT5"
        }
    },
    "seller": {
        "id": 3434343434,
        "nickname": "TESTSELLER",
        "email": "seller+testing12@mercadolibre.com",
        "phone": {
            "area_code": null,
            "number": "( 54) 3456799",
            "extension": "",
            "verified": false
        },
        "alternative_phone": {
            "area_code": "",
            "number": "",
            "extension": ""
        },
        "first_name": "Raúl",
        "last_name": "Perez"
    },
    "payments": [
        {
            "id": 1347347348,
            "order_id": 1014059850,
            "payer_id": 3434343434,
            "collector": {
                "id": 67170474
            },
            "card_id": 157057223,
            "site_id": "MLM",
            "reason": "Item de Test",
            "payment_method_id": "test",
            "currency_id": "MXN",
            "installments": 6,
            "issuer_id": "24",
            "atm_transfer_reference": {
                "company_id": null,
                "transaction_id": null
            },
            "coupon_id": null,
            "activation_uri": null,
            "operation_type": "regular_payment",
            "payment_type": "credit_card",
            "available_actions": [
                
            ],
            "status": "approved",
            "status_code": "00",
            "status_detail": "accredited",
            "transaction_amount": 79.99,
            "shipping_cost": 0,
            "coupon_amount": 0,
            "overpaid_amount": 0,
            "total_paid_amount": 79.99,
            "installment_amount": 13.33,
            "deferred_period": null,
            "date_approved": "2015-10-23T16:53:21.000-04:00",
            "authorization_code": "631964",
            "transaction_order_id": "10617272430002CB367A",
            "date_created": "2015-10-23T16:53:22.000-04:00",
            "date_last_modified": "2017-01-11T10:10:14.000-04:00"
        }
    ],
    "coupon": {
        "id": null,
        "amount": 0
    },
    "tags": [
        "not_delivered",
        "paid"
    ],
    "total_amount": 79.99,
    "total_amount_with_shipping": 79.99,
    "paid_amount": 79.99
}

JSON novo

{
  "id": 1252867227,
  "date_created": "2016-12-29T11:14:00.000-04:00",
  "date_closed": "2016-12-29T11:17:07.000-04:00",
  "last_updated": "2016-12-29T11:37:59.000-04:00",
  "feedback": {
    "sale": null,
    "purchase": null
  },
  "mediations": [],
  "comments": null,
  "order_request": {
    "return": null,
    "change": null
  },
  "fulfilled": null,
  "shipping": {
    "id": 25851291671
  },
  "expiration_date": "2017-01-19T11:17:07.000-04:00",
  "status": "confirmed",
  "status_detail": null,
  "order_items": [
    {
      "item": {
        "id": "MLM571544424",
        "title": "Item De Testeo Por Favor No Ofertar",
        "category_id": "MLM1915",
        "variation_id": null,
        "seller_custom_field": null,
        "variation_attributes": [],
        "warranty": null,
        "condition": "used"
      },
      "quantity": 1,
      "unit_price": 100,
      "currency_id": "MXN"
    }
  ],
  "currency_id": "MXN",
  "buyer": {
    "id": 226104627,
    "nickname": "TETE582019",
    "email": "ttest.f1d92q3+2-ogezdkmrygy3tenjx@mail.mercadolibre.com.mx",
    "phone": {
      "area_code": "01",
      "number": "1111-1111",
      "extension": "",
      "verified": false
    },
    "alternative_phone": {
      "area_code": "",
      "number": "",
      "extension": ""
    },
    "first_name": "Test",
    "last_name": "Test",
    "billing_info": {
      "doc_type": null,
      "doc_number": null
    }
  },
  "seller": {
    "id": 226080093,
    "nickname": "TETE8781491",
    "email": "ttest.zxwryc+2-ogezdkmrygy3tenjx@mail.mercadolibre.com.mx",
    "phone": {
      "area_code": "01",
      "number": "1111-1111",
      "extension": "",
      "verified": false
    },
    "alternative_phone": {
      "area_code": "",
      "number": "",
      "extension": ""
    },
    "first_name": "Test",
    "last_name": "Test"
  },
  "payments": [
    {
      "id": 2515202115,
      "order_id": 1252867227,
      "payer_id": 226104627,
      "collector": {
        "id": 226080093
      },
      "card_id": null,
      "site_id": "MLM",
      "reason": "Item De Testeo Por Favor No Ofertar",
      "payment_method_id": "account_money",
      "currency_id": "MXN",
      "installments": null,
      "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": [],
      "status": "refunded",
      "status_code": null,
      "status_detail": "bpp_covered",
      "transaction_amount": 100,
      "shipping_cost": 0,
      "coupon_amount": 0,
      "overpaid_amount": 0,
      "total_paid_amount": 100,
      "installment_amount": null,
      "deferred_period": null,
      "date_approved": "2016-12-29T11:17:05.000-04:00",
      "authorization_code": null,
      "transaction_order_id": null,
      "date_created": "2016-12-29T11:17:05.000-04:00",
      "date_last_modified": "2016-12-29T11:37:59.000-04:00"
    }
  ],
  "coupon": {
    "id": null,
    "amount": 0
  },
  "tags": [
    "pack_order",
    "not_paid"
  ],
  "total_amount": 100,
  "total_amount_with_shipping": 100,
  "paid_amount": 0
}


Para entender a que refere cada um dos parâmetros, faça a seguinte chamada:

GET https://api.mercadolibre.com/orders/order_id?options&access_token=token

Revise a documentação de Recurso de Ordens para ver mais informações.

Considerações:

  • A tag “pack_order” é gerada automaticamente para poder discriminar se a ordem é associada a um carrinho e não poderá ser removida pelo comprador nem pelo vendedor.
  • Caso a ordem não esteja associada a um Carrinho de Compras e a transação seja sob a modalidade “combinar com o vendedor”, você não receberá mais o status to be agreed, mas o shipping ID virá diretamente como nule. Isso indicará que você deve entrar em contato com o comprador para combinar a forma de envio.
  • Você só terá a ID do envio, e terá que procurar as informações nos novos recursos de Shipping.
  • Existe a possibilidade de que, ainda existindo uma ordem, o envio demore a ser criado. Nesses casos, a ID será nula até sua criação. Quando isso acontecer, você será notificado.
  • O custo do envio, visível no campo “shipping_cost”, de uma ordem associada a um carrinho será sempre 0, pois a ordem não será associada, mas o pacote contendo todos os itens.
    Portanto, o “total_amount_with_shipping” será idêntico ao “total_amount”.
  • As tags “delivered/not delivered” não serão mais adicionadas automaticamente. Somente existirá a marca caso o integrador realize um PUT com a tag definida.
  • As ordens em status paid serão canceladas se o pagamento for rejeitado ou devolvido. Caso isso aconteça, você receberá uma notificação para poder conhecer a alteração no status da ordem.


Seguinte: Gerenciamento de Envios.

Please rate this

Guia para Carrinho de Compras

Durante o ano 2017, iremos trabalhando paulatinamente na implantação de “Carrinho de Compras” dentro do Mercado Livre.
Com essa nova funcionalidade, visamos melhorar a experiência de compra dos usuários, unificar o processo de Check Out de vários produtos e poder fazer um único envio para diminuir tempos de entrega e economizar custos.
Embora nosso objetivo seja que todos os países contem com essa opção, será primeiramente implantado no Mercado Libre México, onde trabalharemos com etapas de testing e release.

Como será o funcionamento?

O usuário terá acesso ao anúncio do item e escolherá os produtos desejados com o botão “Adicionar ao Carrinho”.
Dentro do carrinho, poderá revisar a compra múltipla, tendo a opção de remover itens, modificar quantidades, comprar individualmente ou salvar.
Tomada a decisão de concretizar sua compra, o usuário poderá pagar todos os itens através de um único processo de Check Out e escolher as opções de envio mais convenientes.
Por último, desde sua conta, ele poderá controlar o status de suas compras, pois elas estarão dentro do ecossistema do Mercado Livre.

Nota: A “compra imediata” se manterá como existe atualmente e o usuário terá ambas as opções.

Este lançamento terá um impacto positivo tanto nos nossos compradores quanto nos vendedores, e o desenvolvimento dos integradores terá um papel muito importante nesta nova modalidade de operação dentro do Ecossistema do Mercado Livre.
Por isso, estaremos trabalhando com a seguinte metodologia:

Primeira fase (Beta testing)

Mesmo existindo novos recursos que deverão começar a ser implantados, nesta fase, todas as APIs serão retrocompatíveis e permitirão trabalhar nessas alterações, garantindo não gerar um impacto negativo nos usuários.
Além disso, o uso dentro da plataforma será como apresentado abaixo:

  • Todos os itens que ofereçam Mercado Pago e Mercado Envios poderão participar desta nova funcionalidade.
  • Um grupo de compradores será selecionado como tester, tendo a opção de adicionar produtos de diferentes vendedores ao Carrinho de Compras, desde que esses itens atendam às condições acima mencionadas. Depois, eles poderão modificar, salvar ou remover produtos do Carrinho e, quando a compra for confirmada, realizar um único pagamento por todos os produtos.

Nota: Nesta fase, cada produto comprado será enviado separadamente, como acontece atualmente, embora vários produtos sejam comprados do mesmo vendedor.

Segunda fase (Release no MLB)

Nesta fase, tudo o trabalhado na primeira etapa deverá ser implantado em produção de maneira definitiva, já tendo sido aplicados os testes pertinentes.

Importante: Lembre que, nesta fase, não haverá mais retrocompatibilidade e os recursos serão definitivos.

Seguinte: Retrocompatibilidade e novas notificações.

Please rate this

Instância de retrocompatibilidade e novas notificações

Iniciado o trabalho da primeira fase de implantação da nova funcionalidade de Carrinho de Compras, haverá uma instância de retrocompatibilidade que permitirá usar os novos recursos e também os já existentes.
Isto permitirá implantar as mudanças de maneira progressiva sem gerar interrupções nem afetar a disponibilidade da integração.
Leve em conta que os novos recursos não só serão aplicáveis para Carrinho de Compras, mas também serão a nova modalidade para orders e shipments em geral. Isso quer dizer que, caso você trabalhe com outros sites que não tenham essa modalidade, também perceberá o impacto.

Conteúdo:

Funcionamento de retrocompatibilidade

Como na fase de Beta Testing existirá a possibilidade de trabalhar simultaneamente com todos os recursos disponíveis, você deverá implementar o seguinte header cada vez que fizer uma request para a API, a fim de poder consumir os novos recursos adaptados ao Carrinho de Compras:

curl -H "x-format-new:true" https://api.mercadolibre.com/orders/{Order_id}?access_token=ACCESS_TOKEN

Nota: Caso você queira obter o formato anterior, não terá que enviar a linha “x-format-new: true”.

Novas notificações

Com a nova funcionalidade de Carrinho de Compras, será possível trabalhar com duas notificações novas, que você deverá ativar dentro do Application Manager:
orders_v2: Você receberá a novidade quando uma nova ordem for criada ou quando o json for alterado em uma ordem já existente.
shipments: Você receberá a novidade quando um novo envio for criado ou houver uma atualização em um já existente.

Nota: Lembre que se você decidir trabalhar com “orders_v2” sem anular os anteriores “created_orders” e/ou “orders”, começará a receber a mesma novidade de uma ordem replicada em cada um deles. Sugerimos que, ao começar a ouvir os novos topics, descarte os velhos relacionados a ordens, a fim de simplificar o processo.
Se quiser saber mais sobre o funcionamento de todos os topics disponíveis, pode consultar este tutorial.

Acesse os detalhes

Após receber uma notificação sobre um topic, você deverá realizar a request para o recurso respectivo para acessar os detalhes e conferir se é uma operação nova ou tem que atualizar uma já existente no seu sistema.

orders_v2

Notification response:

{
    "resource": "/orders/139876",
    "user_id": 1234,
    "topic": "orders_v2",
    "received": "2011-10-19T16:38:34.425Z",
    "sent" : "2011-10-19T16:40:34.425Z",
}

Com essas informações, você poderá realizar um GET para o recurso de orders:

curl -H "x-format-new:true" https://api.mercadolibre.com/orders/{Order_id}?access_token=ACCESS_TOKEN

shipments

Notification response:

{
    "resource": "/shipments/139876",
    "user_id": 1234,
    "topic": "shipments",
    "received": "2011-10-19T16:38:34.425Z",
    "sent" : "2011-10-19T16:40:34.425Z",
}

Com essas informações, você poderá realizar um GET para o recurso de shipments:

curl -H "x-format-new:true" https://api.mercadolibre.com/shipments/{shipment_id}?access_token=ACCESS_TOKEN

Nota: Para trabalhar com as novas notificações, você terá que desativar as que usava anteriormente para orders. Lembre que se você quer ouvir todas as notificações, em alguns casos, vai recebê-las mais de uma vez.

Seguinte: Gerenciamento de Ordens.

Please rate this