Saved Addresses

Save your origin and return addresses, and reuse them on every shipment.

These are your addresses: the warehouses you ship from, your return address, and any destination you use often enough to keep.

The operations — list, create, set a default, bulk import — are in Saved Addresses.

Saved addresses or customers?
Saved addresses are where you ship from (and your own return points).
Customers & Recipients are who you ship to.
If you are looking for where to store a client's delivery address, that is the other one.

Before you start

  • Base URL: https://queries.envia.com · Sandbox: https://queries.test.envia.com
  • Auth: Authorization: Bearer <your_token> — the same token as the Shipping API.
  • Check the country's requirements first. Address requirements by country tells you which fields the carrier will demand. In Mexico some carriers refuse a label without the colonia in district, Brazil needs a CPF or CNPJ in identificationNumber, and Colombia takes the DANE code in city.

Create an address

API reference → Create saved address

The fields go at the root of the body. There is no nested address object.

curl -X POST https://queries.test.envia.com/user-address \
  -H "Authorization: Bearer $ENVIA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Bodega Monterrey",
    "phone": "8181234567",
    "phone_code": "52",
    "street": "Av. Constitución",
    "number": "1450",
    "district": "Centro",
    "city": "Monterrey",
    "state": "NL",
    "country": "MX",
    "postal_code": "64000",
    "type": 1,
    "alias": "Bodega MTY"
  }'
Required on createWhy it trips people up
nameMinimum 2 characters
phone8 to 15 digits. Required on create, optional on update
street
cityMaximum 60 characters
stateThe code, not the name. NL, not Nuevo León. Maximum 4 characters
countryISO 3166-1 alpha-2: MX, CO, BR

type decides what the address is for: 1 origin (you ship from here), 2 destination.

Update one

API reference → Update saved address

Same flat shape. Here phone becomes optional, but name, street, city, state and country are still required — send them even if they did not change.

curl -X PUT https://queries.test.envia.com/user-address/8891 \
  -H "Authorization: Bearer $ENVIA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Bodega Monterrey Norte",
    "street": "Av. Constitución",
    "city": "Monterrey",
    "state": "NL",
    "country": "MX",
    "postal_code": "64000"
  }'

Find them

API reference → List saved addresses by type · List saved addresses

# All of them
curl -G https://queries.test.envia.com/all-addresses \
  -H "Authorization: Bearer $ENVIA_TOKEN" -d limit=50

# Only origins, searching by name
curl -G https://queries.test.envia.com/all-addresses/origin \
  -H "Authorization: Bearer $ENVIA_TOKEN" \
  -d search=Monterrey -d sort_by=name -d sort_direction=asc

GET /all-addresses/{type} takes origin or destination, and is the one with search, country and carrier filters. The plain list has only pagination.

Deleting can be refused

API reference → Delete saved address

curl -X DELETE https://queries.test.envia.com/user-address/8891 \
  -H "Authorization: Bearer $ENVIA_TOKEN"

The service checks first that the address is not in use — as a favourite, or as the default of a connected shop. If it is, the delete is rejected. Reassign the default first, or unmark the favourite with Toggle favourite, then delete.

Importing many at once

Two steps, and the order matters:

  1. Download the template for the country you are importing — GET /user-address/bulk/template?country_code=MX. The columns change per country, because the required fields change.
  2. Upload the filled-in .xlsx to POST /user-address/bulk/import, with the same country_code and the address_type you want.

If the columns do not match the template, the whole import fails — not just the bad rows.

Endpoints

Next steps


Did this page help you?