Skip to content
ApiqDevelopers
API v1.64.0Open console
API referenceenrichment

Get route estimates

POST/v1/enrichment/route-estimates
Accepts X-Api-Key · oauthClientCredentials · bearer

Door-to-door time and distance per leg, or an origins × destinations matrix

Request body

  • legsarray of objectOptional
    The legs to estimate, at most 25.
    3 child attributes
    • legRefstringOptional
      Your own id for the leg, returned on its estimate.
    • originPlaceRefRequired
      One way to name a place, used by every intent that takes a location (ground waypoints, experiences pickup, lounge and airport-service stations, weather).Show moreOne way to name a place, used by every intent that takes a location (ground waypoints, experiences pickup, lounge and airport-service stations, weather). Send exactly one of placeId, iata (an airport or rail station code) or geo; text is free text the platform resolves and is never a booking input on its own (a transfer supplier).
      6 child attributes
      • timeZonestringOptional
        IANA time zone of the place (e.g. America/Sao_Paulo) — planned; lookups carry it as attributes.timezone today
      • placeIdstringOptional
        A place id from the lookup calls, or a map provider's place id passed through as it is.
      • iatastringOptional
        An airport or rail station code.
      • geoGeoPointOptional
        A point on the map, in decimal degrees.
        2 child attributes
        • latnumberRequired
          Latitude, -90 to 90.
        • lonnumberRequired
          Longitude, -180 to 180.
      • textstringOptional
        Free text the platform resolves; never enough on its own to book.
      • countryCodestringOptional
        The country, as its ISO 3166-1 alpha-2 code, to narrow the match.
    • destinationPlaceRefRequired
      One way to name a place, used by every intent that takes a location (ground waypoints, experiences pickup, lounge and airport-service stations, weather).Show moreOne way to name a place, used by every intent that takes a location (ground waypoints, experiences pickup, lounge and airport-service stations, weather). Send exactly one of placeId, iata (an airport or rail station code) or geo; text is free text the platform resolves and is never a booking input on its own (a transfer supplier).
      6 child attributes
      • timeZonestringOptional
        IANA time zone of the place (e.g. America/Sao_Paulo) — planned; lookups carry it as attributes.timezone today
      • placeIdstringOptional
        A place id from the lookup calls, or a map provider's place id passed through as it is.
      • iatastringOptional
        An airport or rail station code.
      • geoGeoPointOptional
        A point on the map, in decimal degrees.
        2 child attributes
        • latnumberRequired
          Latitude, -90 to 90.
        • lonnumberRequired
          Longitude, -180 to 180.
      • textstringOptional
        Free text the platform resolves; never enough on its own to book.
      • countryCodestringOptional
        The country, as its ISO 3166-1 alpha-2 code, to narrow the match.
  • originsarray of PlaceRefOptional
    6 child attributes
    • timeZonestringOptional
      IANA time zone of the place (e.g. America/Sao_Paulo) — planned; lookups carry it as attributes.timezone today
    • placeIdstringOptional
      A place id from the lookup calls, or a map provider's place id passed through as it is.
    • iatastringOptional
      An airport or rail station code.
    • geoGeoPointOptional
      A point on the map, in decimal degrees.
      2 child attributes
      • latnumberRequired
        Latitude, -90 to 90.
      • lonnumberRequired
        Longitude, -180 to 180.
    • textstringOptional
      Free text the platform resolves; never enough on its own to book.
    • countryCodestringOptional
      The country, as its ISO 3166-1 alpha-2 code, to narrow the match.
  • destinationsarray of PlaceRefOptional
    6 child attributes
    • timeZonestringOptional
      IANA time zone of the place (e.g. America/Sao_Paulo) — planned; lookups carry it as attributes.timezone today
    • placeIdstringOptional
      A place id from the lookup calls, or a map provider's place id passed through as it is.
    • iatastringOptional
      An airport or rail station code.
    • geoGeoPointOptional
      A point on the map, in decimal degrees.
      2 child attributes
      • latnumberRequired
        Latitude, -90 to 90.
      • lonnumberRequired
        Longitude, -180 to 180.
    • textstringOptional
      Free text the platform resolves; never enough on its own to book.
    • countryCodestringOptional
      The country, as its ISO 3166-1 alpha-2 code, to narrow the match.
  • modesarray of stringOptional
    How the traveller moves, for example CAR.
  • departAtstring · date-timeOptional
    When the traveller sets off, for travel times that depend on traffic.
  • trafficstringOptional
    LIVE | HISTORICAL | NONE

Responses

  • 200data is RouteEstimate[] for legs, RouteMatrix for origins × destinationsRouteEstimatesResponse
  • 400VALIDATION or UNKNOWN_DOMAINApiErrorResponse
  • 401
    UNAUTHENTICATED — missing or expired token.Show moreUNAUTHENTICATED — missing or expired token. Declared on every operation because `security` is declared globally at the document root: every route is authenticated, so every route can answer 401.
    ApiErrorResponse
  • 403
    AGENT_TIER_INSUFFICIENT, also 403, is a request whose agent tier does not allow the tool class; it carries nextAction verify_agent and details.tier, details.required, details.toolClass and…Show moreAGENT_TIER_INSUFFICIENT, also 403, is a request whose agent tier does not allow the tool class; it carries nextAction verify_agent and details.tier, details.required, details.toolClass and details.operationId. A ceiling only narrows an unverified caller and never widens a scope.
    ApiErrorResponse
  • 405
    VALIDATION — the public edge serves GET, POST, PUT, PATCH and DELETE only; any other method is refused before the platform sees it (details.reason METHOD_NOT_ALLOWED, details.source edge).Show moreVALIDATION — the public edge serves GET, POST, PUT, PATCH and DELETE only; any other method is refused before the platform sees it (details.reason METHOD_NOT_ALLOWED, details.source edge). Not retryable as sent.
    ApiErrorResponse
  • 413
    VALIDATION — the request body is larger than the surface's limit.Show moreVALIDATION — the request body is larger than the surface's limit. Not retryable as sent: shrink the body. Declared on every operation that takes a request body. details carries exactly one key, maxBodyBytes (integer): the limit that applies to this surface, in bytes.
    ApiErrorResponse
  • 414
    VALIDATION — the request URI (path and query string) is longer than 8 KiB; the public edge refuses it before the platform sees it (details.reason URI_TOO_LONG, details.source edge).Show moreVALIDATION — the request URI (path and query string) is longer than 8 KiB; the public edge refuses it before the platform sees it (details.reason URI_TOO_LONG, details.source edge). Not retryable as sent: send long input in the body of a POST.
    ApiErrorResponse
  • 415
    VALIDATION — a request body that is not JSON (application/json or application/*+json; a form body only on the OAuth token routes).Show moreVALIDATION — a request body that is not JSON (application/json or application/*+json; a form body only on the OAuth token routes). The public edge refuses it before the platform sees it (details.reason UNSUPPORTED_MEDIA_TYPE, details.source edge). Not retryable as sent: send Content-Type application/json. Declared on every operation that takes a JSON request body.
    ApiErrorResponse
  • 429
    RATE_LIMITED — the API key or its tenant is over a rate limit; wait for Retry-After, then retry.Show moreRATE_LIMITED — the API key or its tenant is over a rate limit; wait for Retry-After, then retry. Every routed request is counted against two token buckets, the key's and the tenant's (all its keys together): 50 requests a second with a burst of 100 on the standard plan. Every travel verb except polling a search also spends from a supplier budget, per key and per tenant: 10 requests a second with a burst of 20, and a plan may add a daily quota of supplier calls. Answers carry the IETF RateLimit header fields for the tightest bucket consulted (RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, RateLimit-Policy); a refusal adds Retry-After and details.scope (KEY or TENANT), details.budget (PLATFORM or SUPPLIER), details.reason (RATE or DAILY_QUOTA), details.tier and details.retryAfterMs. A sandbox may run with the limiter off, in which case none of these headers is sent. A search that is still warming is a different answer with a different meaning (keep polling). with the key-velocity check on, also details.reason VELOCITY_LIMIT, a soft breach of the API key's own scope (components/responses/VelocityLimited), nextAction slow_down.
    ApiErrorResponse
  • 500INTERNAL — a bug, and traceId is the support handle.ApiErrorResponse

Errors you should handle

Branch on code and honour retryable — never on the HTTP status alone.

400VALIDATION
message.intent.checkOut must be after message.intent.checkIn
not retryable
400UNKNOWN_DOMAIN
Unknown domain 'HOTELS'. Did you mean HTL?
not retryable
401UNAUTHENTICATED
The bearer token is expired. Re-authenticate and retry.
not retryable
403PERMISSION_DENIED
Role lacks the required scope: booking:write
not retryable
403TAB_DISABLED
Tenant acme-travel is not entitled to sell CRU
not retryable
403OUT_OF_SCOPE
The token's scope ladder does not reach this customer subtree
not retryable
403TENANT_MISMATCH
orderRef MO-8KD-2FQ-9XT does not belong to tenant acme-travel
not retryable
405VALIDATION
This method is not served.
not retryable
413VALIDATION
The request body is larger than this API accepts (262144 bytes).
not retryable
414VALIDATION
The request URI is longer than 8 KiB.
not retryable
415VALIDATION
Send application/json.
not retryable
429RATE_LIMITED
Too many requests for this key on the supplier budget. Wait for the Retry-After interval before trying again.
retryable
500INTERNAL
An unexpected error occurred. Quote the traceId to support.
retryable