Making a Request
  • 23 May 2024
  • 1 Minute to read
  • Dark
    Light

Making a Request

  • Dark
    Light

Article summary

Authorization

The API requires an Access Token to be supplied in the Authorization HTTP header.
image.png

Obtaining Access Tokens

Obtaining a token can be done using the client credentials flow. A client ID and client secret will be provided per environment. All access tokens will expire after 1 hour. Do not request an access token per API request, it is recommended to request a new access token slightly before the previous token is scheduled to expire.

curl --location '{{server_url}}/oauth2/token' \\
--header 'Content-Type: application/json' \\
--data '{
    "grantType": "client_credentials",
    "clientId": "{{client_id}}",
    "clientSecret": "{{client_secret}}"
}'

Using a Token

The access token obtained by calling the authorization server must be used in API calls by using the Authorization: Bearer {{token}} HTTP header.

curl --location '{{server_url}}/v1/orders/bulk?dryRun=true' \\
--header 'Content-Type: application/json' \\
--header 'Authorization: Bearer {{token}}' \\
--data '{{body}}'

Error Codes

An order is not guaranteed an offer - in this case error codes are provided to explain why the order is ineligible. Multiple error codes for an order are possible.

Error CodeDescription
INVALID_AIR_RESERVATIONThe provided air reservation(s) is invalid. Common reasons include: arrival or departure APC is on the configured blocklist, arrival or departure APC is not on the configured allowlist, or international reservations are not configured
INVALID_BILLING_CONTACTThe provided billing contact information is invalid.
INVALID_COUNTRYThe provided localization country is invalid or not supported by the integration.
INVALID_CURRENCYThe provided localization currency is invalid or not supported by the integration.
INVALID_LOCALEThe provided localization locale is invalid or not supported by the integration.
MAX_BOOKING_WINDOWThe provided departure dates are beyond the maximum booking window.
MAX_PRICEThe provided total order amount exceeds the maximum allowed price.
MIN_BOOKING_WINDOWThe provided departure dates are beyond the minimum booking window.
MIN_PRICEThe provided total order amount exceeds the minimum allowed price.
MISSING_PRODUCTAt least one order item must be provided. Relevant only for non-travel integrations.
MISSING_TRAVEL_RESERVATIONAt least one reservation must be provided. Relevant only for travel integrations.
NO_OFFERSNo offers could be otherwise be generated for the provided order. This is extremely rare.

Marketing Content

Each offer in the response will contain marketing content per relevant locale.

  • en-CA and fr-CA for CA orders
  • en-US for US orders

The copy in the marketing content uses the following formatting:


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.