Listar endereços do usuário:

Endereços do usuário podem ser listados do seguinte modo:

Endpoint GET /api/v2/me/addresses

Exemplo com cURL:

$ curl -X GET \
  'https://www.melhorenvio.com.br/api/v2/me/addresses' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjNjYmQzNTBjYzI0YmI5NzdjMDRkNTRmYzg1NThhOTE4ZjNkZDBmMDBkMTFhYzg2ZmI0OTViMDBiNzQxODEwZDlhMWM2ZWVlNTRkMTdhZDkxIn0.eyJhdWQiOiIxIiwianRpIjoiM2NiZDM1MGNjMjRiYjk3N2MwNGQ1NGZjODU1OGE5MThmM2RkMGYwMGQxMWFjODZmYjQ5NWIwMGI3NDE4MTBkOWExYzZlZWU1NGQxN2FkOTEiLCJpYXQiOjE1MDY1MjMzODYsIm5iZiI6MTUwNjUyMzM4NiwiZXhwIjoxNTM4MDU5Mzg2LCJzdWIiOiIxNmIyMWVhNS00NmVjLTQ0Y2MtYjdmNS1hMDJmZmY3YjljMjgiLCJzY29wZXMiOlsiY2FydC1yZWFkIiwiY2FydC13cml0ZSIsImNvbXBhbmllcy1yZWFkIiwiY29tcGFuaWVzLXdyaXRlIiwiY291cG9ucy1yZWFkIiwibm90aWZpY2F0aW9ucy1yZWFkIiwiY291cG9ucy13cml0ZSIsIm9yZGVycy1yZWFkIiwicHVyY2hhc2VzLXJlYWQiLCJzaGlwcGluZy1jYWxjdWxhdGUiLCJzaGlwcGluZy1jYW5jZWwiLCJzaGlwcGluZy1jaGVja291dCIsInNoaXBwaW5nLWNvbXBhbmllcyIsInNoaXBwaW5nLWdlbmVyYXRlIiwic2hpcHBpbmctcHJldmlldyIsInNoaXBwaW5nLXByaW50Iiwic2hpcHBpbmctdHJhY2tpbmciLCJ3ZWJob29rcy1yZWFkIiwid2ViaG9va3Mtd3JpdGUiLCJ0cmFuc2FjdGlvbnMtcmVhZCIsInVzZXJzLXJlYWQiLCJ1c2Vycy13cml0ZSJdfQ.GpVYhn4ZLjvtBsNq_sLullUV5E-zb3t009IuKkeRHgDGiDlnt_Lslv7elg6ou2nD_t0u2REIv3umZsLhYxUhHak732DSek84YJ14ehF4OCwFDYY8j1qOHB91YpXIUe6BzrDSD58IC3sknmoV7Cln2oLWwsooHTmowVFceCW5BNzavoT-wawUGxfOKb-el0exgtfx9gs-ppEdfSYfRvRvvfGMDqcbqaoIZxOE1hf9LK1qIbuOjLUO0lPwXCmhIe8q-fKfb-DvGXhz9aTCZ2K4khaseDGkjXOQyB_abOqfzktcFOfqcXuInv53-UoPQNZhzfTPqu2ATe73AlVsbS9Y1w_F40cVgHfhlOujcqccpQiErM6mZvDkx7EIIcEXM7wmX4kDZzWBm5ZEf1Y4WX0lSR-zOK0jm-rOZ6MWKeko5-GcQaeqho9Q3I4o-RViVznBCBW1OnGy7K2jNlB0juL6ZL2YKgKhjxmhe-_dNSQ7BMvJpzhQsKcOkJXS70RBJvx17Dl0vHMuCbW-K1KT1HrPasMVB3psHNNE1wtPI1IeAogcd9eTtvD2Easy7hS0YUqf7KCXk7h2qJdGHpgbjwALGq4U6JvpDeyqWHmS5_d8v92dtJ5Lz4wFc-JYsueNU5tqJiz03ORnRCZCkYZu52pc5kiW7-fo-UVfxSDdizf76Fk' \
  -H 'content-type: application/json'

Nota: O Parâmetro pretty pode ser passado para imprimir o JSON de modo que se possa visualizar a informação na fase de desenvolvimento, não sendo recomendado para produção por aumentar o tamanho da resposta enviada ao cliente.

Resposta:

{
  "current_page": 1,
  "data": [
    {
      "id": 260,
      "label": "teste",
      "postal_code": "1002001",
      "address": "Rua Direita",
      "number": "26",
      "complement": null,
      "district": "Sé",
      "latitude": 0,
      "longitude": 0,
      "created_at": "2017-09-13 13:59:55",
      "updated_at": "2017-09-13 13:59:55",
      "city": {
        "id": 5269,
        "city": "São Paulo",
        "state": {
          "id": 25,
          "state": "São Paulo",
          "state_abbr": "SP",
          "country": {
            "id": "BR",
            "country": "Brazil"
          }
        }
      }
    },
    {
      "id": 239,
      "label": "Pelotas Parque Tecnológico",
      "postal_code": "96085470",
      "address": "Av. Domingos de Almeida",
      "number": "1785",
      "complement": null,
      "district": "Areal",
      "latitude": -31.7552206,
      "longitude": -52.3156841,
      "created_at": "2017-09-10 18:02:40",
      "updated_at": "2017-09-10 18:02:40",
      "city": {
        "id": 4159,
        "city": "Pelotas",
        "state": {
          "id": 21,
          "state": "Rio Grande do Sul",
          "state_abbr": "RS",
          "country": {
            "id": "BR",
            "country": "Brazil"
          }
        }
      }
    }
  ],
  "first_page_url": "https://www.melhorenvio.com.br/api/v2/me/addresses?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "http://www.melhorenvio.com.br/api/v2/me/addresses?page=1",
  "next_page_url": null,
  "path": "http://www.melhorenvio.com.br/api/v2/me/addresses",
  "per_page": 10,
  "prev_page_url": null,
  "to": 2,
  "total": 2
}

results matching ""

    No results matching ""