Validate a route
Endpoint
Section titled “Endpoint”POST /api/locations/validate-routeValidates a route and returns, per courier, which rules apply and whether that courier can quote.
Authentication
Section titled “Authentication”Requires API key.
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
from | object | No | Origin location (postcode, suburb, state, country, type). |
to | object | No | Destination location (same fields). |
items | array | No | Items with weight/dimensions (cm) and packaging description. |
couriers | string[] | No | Limit validation to these string_ids; omit for all. |
Example
Section titled “Example”curl -X POST \ -H "Api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": { "postcode": "2000", "suburb": "SYDNEY", "state": "NSW", "country": "AU", "type": "business" }, "to": { "postcode": "3000", "suburb": "MELBOURNE", "state": "VIC", "country": "AU", "type": "residential" }, "items": [ { "description": "Carton", "weight": 5, "length": 40, "width": 30, "height": 20, "quantity": 1 } ] }' \ https://www.transdirect.com.au/api/locations/validate-routeResponse
Section titled “Response”{ "couriers": { "allied": { "rules": [], "can_quote": true }, "couriers_please": { "rules": [ { "code": "residential_surcharge", "severity": "surcharge", "msg": "Residential delivery surcharge applies" } ], "can_quote": true } }}| Field | Description |
|---|---|
couriers | Map of string_id → { rules, can_quote } |
rules[].severity | "block", "surcharge", or "prompt" |
can_quote | false when a blocking rule applies |
Use this to warn users before they start a full quote.