- 23 May 2024
- 1 Minute to read
- DarkLight
Making a Request
- Updated on 23 May 2024
- 1 Minute to read
- DarkLight
Authorization
The API requires an Access Token to be supplied in the Authorization HTTP header.
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 Code | Description |
---|---|
INVALID_AIR_RESERVATION | The 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_CONTACT | The provided billing contact information is invalid. |
INVALID_COUNTRY | The provided localization country is invalid or not supported by the integration. |
INVALID_CURRENCY | The provided localization currency is invalid or not supported by the integration. |
INVALID_LOCALE | The provided localization locale is invalid or not supported by the integration. |
MAX_BOOKING_WINDOW | The provided departure dates are beyond the maximum booking window. |
MAX_PRICE | The provided total order amount exceeds the maximum allowed price. |
MIN_BOOKING_WINDOW | The provided departure dates are beyond the minimum booking window. |
MIN_PRICE | The provided total order amount exceeds the minimum allowed price. |
MISSING_PRODUCT | At least one order item must be provided. Relevant only for non-travel integrations. |
MISSING_TRAVEL_RESERVATION | At least one reservation must be provided. Relevant only for travel integrations. |
NO_OFFERS | No 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: