Skip to Content
The AKIN Travel developer platform is in beta — APIs may change. Get started →
ErrorsOverview

Error handling

Every error returned by the AKIN Travel API is a GraphQL error  with two stable extension fields:

  • extensions.code — machine-readable identifier. Branch on this.
  • extensions.translationKey — i18n key your client can map to localised copy.

The message field is a human-readable English fallback. Copy may change between releases. Do not pattern-match on messages.

The shape

{ "errors": [ { "message": "Authentication required", "extensions": { "code": "AUTH_REQUIRED", "translationKey": "errors.authRequired" } } ], "data": null }

Read the first error’s extensions.code and switch on it. The same logic applies in any language:

function handle(code: string) { switch (code) { case 'AUTH_REQUIRED': case 'TOKEN_EXPIRED': return redirectToSignIn(); case 'ACCESS_DENIED': return showAccessDeniedToast(); case 'RATE_LIMITED': return scheduleRetry(); // honour the Retry-After header default: return reportToTelemetry(code); } } // Raw fetch (any stack) const body = await res.json(); const code = body.errors?.[0]?.extensions?.code; if (code) handle(code);

On React with the SDK, the same code lives on ApolloError:

import { ApolloError } from '@apollo/client'; if (err instanceof ApolloError) handle(err.graphQLErrors[0]?.extensions?.code as string);

Partner Reporting API refusals

The Partner Reporting API refuses with three codes. The message says which check failed; branch on the code.

CodeMessage starts withCauseWhat to do
ACCESS_DENIEDThe Partner Reporting API is not availableThe API is switched offTry again later, or ask your AKIN Travel contact
ACCESS_DENIEDUnauthorized: Valid partner API key requiredNo key, or a key that is not validSend a valid key in x-partner-api-key
ACCESS_DENIEDForbidden: this is a publishable (browser-safe) partner API keyA publishable keyUse a secret key, from your server
ACCESS_DENIEDForbidden: partner API key is missing required scope "reporting:read"The key does not hold the scope. A publishable key never holds itAdd reporting:read to a secret key in the dashboard
ACCESS_DENIEDForbidden: this partner has no Partner Reporting API grantYour partner does not hold the grantAsk AKIN to turn it on
ACCESS_DENIEDProperty is not accessible with this partner API keypropertyId is not one of your propertiesUse one of your own property ids
RATE_LIMITEDPartner Reporting API rate limit exceededMore than 60 reporting calls a minute on this key (HTTP 429)Wait until extensions.resetsAt (Rate limits)
VALIDATION_ERROR(names the rule)A date, window or cursor outside the rules. A page size is never refused: it is read as 1 to 500Fix the argument named in extensions.context.field

Reference

The full list of error codes is in Error codes — generated from the API source, so it cannot drift.

Last updated on