Branches

Get Branches (POST)

Same endpoint as Get Branches, with a JSON body. Use it to filter by packages, or for live carrier lookup: send carrierId for a carrier that has the return_branches_by_address action and Envia asks the carrier for points near the address instead of reading the branch catalog. See the Live carrier lookup section of the Get Branches guide.

post/branches/{carrier}/{country_code}

Request

  • Base URL
    https://queries.test.envia.com
  • URL
    https://queries.test.envia.com/branches/{carrier}/{country_code}
  • Auth
    HTTP bearer

Path parameters

carrierstring required
Example:estafeta

Carrier name.

country_codestring required
Example:MX

Two-digit country code.

Request body

carrierIdinteger

Carrier id from GET /carrier (id). Switches on live lookup when that carrier has the return_branches_by_address action (check it with GET /carrier-action/{carrier_id}). Without it, or on carriers without that action, the catalog search runs.

zipcodestring

Postal code. Required for live lookup.

addressstring

Street address. Required for live lookup.

localitystring

Locality or city. Required for live lookup.

serviceNamestring

Carrier service name. Required for live lookup.

type1 | 2 | 3

Capability: 1 origin (admission), 2 destination (delivery), 3 both. Required for live lookup. On the catalog search it defaults to 1.

shipmentTypeinteger

Shipment type, 0 to 9. Required for live lookup.

statestring

State filter. Optional.

latitudenumber float

Latitude. Optional; some carriers require coordinates.

longitudenumber float

Longitude. Optional; some carriers require coordinates.

branchTypestring

Catalog search only. Comma-separated branch categories: 1 Post Office, 2 Warehouse, 3 Third Party, 4 Lockers.

limitBranchesnumber

Maximum number of branches returned (catalog search).

allBranchboolean

Catalog search only. Ignored by live lookup.

Example request

{
  "carrierId": 172,
  "zipcode": "45311",
  "address": "Plaza De La Iglesia 2",
  "locality": "Dos Barrios",
  "serviceName": "<service_name>",
  "type": 2,
  "shipmentType": 1,
  "packages": [
    {
      "weight": 1,
      "length": 10,
      "height": 10,
      "width": 10,
      "amount": 1,
      "package_type": 1
    }
  ],
  "state": "Toledo",
  "latitude": 39.88293,
  "longitude": -3.480571,
  "branchType": "1,4",
  "limitBranches": 10
}

Response

Successful response. A JSON array of branches (not wrapped in data). [] when nothing matches.

branch_idstring
branch_codestring
branch_typeinteger
referencestring

Example response

[
  {
    "branch_id": "LNT",
    "branch_code": "LNT",
    "branch_type": 1,
    "reference": "RMX - DR GALVEZ",
    "address": {
      "city": "Alvaro Obregon",
      "state": "CX",
      "number": "2357",
      "street": "Av. Insurgentes Sur",
      "country": "MX",
      "delivery": true,
      "latitude": "19.34265",
      "locality": "Alvaro Obregon",
      "admission": true,
      "longitude": "-99.189674",
      "postalCode": "01000",
      "address": "Av. Insurgentes Sur 2357, Alvaro Obregon, 01000, CDMX"
    }
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.