Skip to content

Authentication (Token)

POST {base_url}/connect/token

Generate a Bearer JWT used to authorize all subsequent calls. Uses OAuth 2.0 client_credentials flow.

Header Value
Content-Type application/x-www-form-urlencoded
Accept-Encoding gzip, deflate, br
Param Required Value
client_id Yes Provided by PT
client_secret Yes Provided by PT
grant_type Yes client_credentials
scopes Yes admin_api
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "admin_api"
}

Add to every other request:

Authorization: Bearer <access_token>
Code HTTP Message Cause / Fix
1003 400 invalid_client Credentials rejected. Same response whether the id or the secret is wrong, or the credentials are not active. If yours are correct, contact PriceTravel — the response does not distinguish the cases.
1004 400 invalid_client_id_for_env_<environment> Using Integration credentials in Production or vice versa
1005 400 invalid_client_secret Wrong secret — verify it has not been rotated
900 401 The authorization header is invalid Missing Bearer prefix or malformed header
902 401 The authorization token is invalid Token corrupted or signed by another tenant
903 401 The authorization token has expired Token TTL elapsed — generate a new one
1001 401 No authorization token provided No Authorization header sent
1003 401 The channel id <X> is not enabled to be used in <env> Channel exists but is not provisioned in this environment. Returned by the endpoints called after the token, not by the token itself. The token can be issued and these calls still fail.
  • invalid_client does not tell you which of the three causes applies. If your credentials are correct and unchanged, contact PriceTravel: the check happens on the PriceTravel side and cannot be resolved from the integration.
  • Credentials issued for one environment are not valid in another.
  • If you can get a token but downstream calls return 401 → check Bearer prefix, whitespace, encoding.
  • If token works for some endpoints but not others → check scope; only admin_api is supported.
  • Tokens expire after expires_in seconds (typically 1 hour).
  • Cache the token; do not request a new one on every call.
  • Refresh proactively at ~80% of TTL to avoid edge-of-expiry failures.