Table of Contents

Getting Started

The HX Partner API provides access to HX booking, availability, pricing and content describing HX's offerings, ships, cabins, excursions and ports.

Environments

We maintain a staging environment which you can use to test, play, and develop against. The staging environment behaves identically to the production environment, so when you're ready to make the switch, you need only switch the base URL.

Staging: https://partner.staging.travelhx.com/api/v2

Production: https://partner.travelhx.com/api/v2

Authentication

Note

If you have a valid user_key for the V1 API, you can use it here as your agencyId.

As part of your onboarding to the API, you will have been provisioned a clientId, a clientSecret and an agencyId.

You use these credentials to obtain a bearer token, which lets you access the Partner API.

And one of the following values for audience:

curl --request POST \
  --url https://b2b-portal-staging.eu.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET","agency_id":"YOUR_AGENCY_ID","audience":"https://staging.partner.hurtigruten.com/api","grant_type":"client_credentials"}'

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "scope": "application:Partner.WebApi",
  "expires_in": 86400,
  "token_type": "Bearer"
}

The bearer token is valid for a set amount of time as indicated by expires_in (in seconds) and should be cached for re-use. You then attach your bearer token in the header of your requests to the Partner API

curl --location 'https://partner.staging.travelhx.com/api/v2/example-endpoint' \
--header 'Authorization: Bearer "YOUR_BEARER_TOKEN"'

Inventory API

With the HX Inventory API you can:

  • Get package data files
  • Get reference data files