Novo logistic_type

16 maio 2017

Logistic_type surge devido à ampliação das opções de envio portanto se faz necessário organizar a estrutura de dados.

Hoje esta implementação se encontra em estado de retrocompatibilidade mas, a partir do 15 de junho não estará mais disponível.

Por tanto, caso estiver obtendo shipping:mode dos recursos user, categories, items ou shipments te aconselhamos realizar a mudança em sua integração da forma que mostraremos a seguir para não ter erros.

Revise como está atualmente em cada um dos recursos nesta etapa de compatibilidade e como será depois.

Onde se implementará este sub modo?

shipping preferences
user

curl -X GET 'https://api.mercadolibre.com/users/{userID}/shipping_preferences'
JSON actualJSON nuevo
{
...
  local_pick_up: false, 
  modes: [
    "custom", 
    "not_specified", 
    "me2"
  ], 
  logistic: [
    {
      mode: "me2", 
      types: [
       {
          type:"cross_docking", 
          carrier_pickup: [ ], 
          services: [
            291, 
            292, 
            293
          ], 
          default: true
        }


      ]
    }, 
    {
     mode: "custom", 
     types: [
    {
          type: "custom", 
          carrier_pickup: [ ], 
          services: null, 
          default: true
        }
      ]
    }, 
    {
      mode: "not_specified", 
      types: [
        {
          type: "not_specified", 
          carrier_pickup: [ ], 
          services: null, 
          default: true
        }
      ]
, 
  services: [
    291, 
    292,
   293
  ]
…
}
{
...
  "local_pick_up": false, 
  logistics: [
    {
      mode: "me2", 
      types: [
        {
          type: "cross_docking", 
          carrier_pickup: [ ], 
          services: [
            291, 
            292, 
            293
          ], 
          default: true
        }
      ]
    }, 
    {
      mode: "custom", 
      types: [
        {
          type: "custom", 
          carrier_pickup: [ ], 
          services: null, 
          default: true
        }
      ]
    }, 
    {
      mode: "not_specified", 
      types: [
        {
          type: "not_specified", 
          carrier_pickup: [ ], 
          services: null, 
          default: true
        }
      ]
    }
  ]
…
}

categories

curl -X GET 'https://api.mercadolibre.com/categories/{categoryID}/shipping_preferences'
JSON actualJSON nuevo
{
  "id": "MLA1055",
  "name": "Celulares y Smartphones",
  ...
    "fragile": false,
    "shipping_modes": [
      "not_specified",
      "custom",
      "me2",
      "me1"
    ],
    "shipping_options": [
      "carrier",
      "custom"
    ],
    ...
}
{
  "category_id": "MLA1055",
  "dimensions": {
    "weight": 650,
    "height": 10,
    "width": 10,
    "length": 15
  },
  "logistics": [
    {
      "types": [
        "default"
      ],
      "mode": "me1"
    },
    {
      "types": [
        "drop_off",
        "xd_drop_off",
        "cross_docking",
        "fulfillment"
      ],
      "mode": "me2"
    },
    {
      "types": [
        "not_specified"
      ],
      "mode": "not_specified"
    },
    {
      "types": [
        "custom"
      ],
      "mode": "custom"
    }
  ],
  "restricted": false
}

shipping_modes
user

curl -X GET 'https://api.mercadolibre.com/users/{userID}/shipping_modes?category_id={categoryID}'
JSON actualJSON nuevo
[
  {
    "mode": "me2", 
shipping_attributes:{
    "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional"
        }
}    
"logistic_types": [
      {
        "type": "drop_off", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional"
        }
      }, 
      {
        "type": "fulfillment", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false, 
        }
      }, 
      {
        "type": "crossdocking", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false
        }
      }
    ]
  }, 
  {
    "mode": "custom", 
    "logistic_types": [
      {
        "type": "default", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false
        }
      }
    ]
  }, 
  {
    "mode": "not_specified", 
    "logistic_types": [
      {
        "type": "default", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false
        }
      }
    ]
  }
]
[
  {
    "mode": "me2", 
"logistic_types": [
      {
        "type": "drop_off", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional"
        }
      }, 
      {
        "type": "fulfillment", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false, 
          "exceptions_by_strategy": {
            "fulfillment": {
              "local_pick_up": "not_allowed"
            }
          }
        }
      }, 
      {
        "type": "crossdocking", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false
        }
      }
    ]
  }, 
  {
    "mode": "custom", 
    "logistic_types": [
      {
        "type": "default", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false
        }
      }
    ]
  }, 
  {
    "mode": "not_specified", 
    "logistic_types": [
      {
        "type": "default", 
        "attributes": {
          "dimensions": "optional", 
          "costs": "not_allowed", 
          "free": {
            "methods": "optional", 
            "accepted_methods": [
              501245
            ], 
            "rules": [
              {
                "default": true, 
                "free_mode": "country", 
                "value": null, 
                "free_shipping_flag": true
              }
            ], 
            "flat": true
          }, 
          "local_pick_up": "optional", 
          "mandatory_for_user": false
        }
      }
    ]
  }
]

items

curl -X GET 'https://api.mercadolibre.com/items/{Item_id}'
JSON actualJSON nuevo
{
...
    shipping: {
        mode: "me2",
        local_pick_up: false, 
        free_shipping: false, 
        methods: null, 
        dimensions: null, 
        tags: [
            "me2_available"
        ]
    }
...
}
{
...
    shipping: {
        mode: "me2", 
       logistic_type: "fulfillment",  
        local_pick_up: false, 
        free_shipping: false, 
        methods: null, 
        dimensions: null, 
        tags: [
            "me2_available"
        ]
    }
...
}

shipments

curl -X GET 'https://api.mercadolibre.com/shipments/26186642113?access_token={access_token}'
JSON actualJSON nuevo
{
...
        mode: "me2",
       logistic_type: "fulfillment",  
       picking_type: "fulfillment",  
...
}
{
...
        mode: "me2", 
       logistic_type: "fulfillment",  
    }
...
}

Importante: Durante este ano trabalharemos na implementação de Fulfillment no Mercado Livre e por este motivo vamos fazer várias mudanças.
Fique atento aos nossos e-mails e redes sociais para estar atualizado de tudo.

Quer saber mais a respeito desta mudança?
Veja o seguinte video tutorial: