API

Locations

Create, list, update, and delete canonical location records in your organization. Locations are environment-scoped (test vs live) based on your API key. Supports idempotency via the Idempotency-Key header.

POST/v1/locations

Authorizations

Authorizationstringheaderrequired

Bearer token. Use a test key from the dashboard. The header is Authorization: Bearer <token>.

"Bearer trq_test_…"

Body

{
  "name": "Warehouse A",
  "coordinates": { "latitude": 24.7136, "longitude": 46.6753 },
  "address": {
    "formatted": "Al Olaya St, Riyadh",
    "city": "Riyadh",
    "country_code": "SA"
  },
  "tags": ["warehouse"],
  "external_reference": "WH-001"
}

Response

200 · application/json

Errors

CodeHTTPWhen
UNAUTHORIZED401Missing or invalid API key or session token.
FORBIDDEN403The credential is valid but lacks permission for this action.
INVALID_INPUT400The request body failed validation.
INVALID_COORDINATES400Latitude or longitude is out of range.
NOT_FOUND404The location does not exist in your organization.
CONFLICT409Idempotency key reused with a different payload.
RATE_LIMITED429Too many requests.