Intro

Welcome to the Offers API.

Offers API provides endpoints for generating and retrieving offers for a combination of origin and destination.

The Offers API provide four endpoints:

  • Search for offers with a trip pattern generated from Journey Planner
  • Search for offers with zones from National Stop Register (NSR)
  • Search for offers with stop places from National Stop Register (NSR)
  • Search for offers with your authority id

The services enrich the request with information about the journey requested, inventory and seating before identifying all possible offers and calculating price. Before the response is returned, the services filter unavailable offers and groups offers into recommendations.

Offers caching
Offers API is caching the produced offers for 30 minutes. After this time, the offer can no longer be used in the regular sales api.

Authentication

The client should authenticate with the Offers API by providing an OAuth2 bearer token in the request header. The token should be issued by Entur and have the necessary scopes to access the API. In addition, a header for a specific distribution channel must be provided in the request when searching for offers. Only distribution channels that have been registered with Entur and have been linked with your client will be accepted.

In order to issue a valid token you must have a client_id and client_secret.

curl--request POST \
--url 'https://<type_of_token>.<environment>.entur.org/oauth/token' \
--header 'content-type: application/json' \
--data '{"grant_type":"client_credentials","client_id": "<clientid>","client_secret": "<clientsecret>","audience": "https://api.<environment>.entur.io"}

Headers

All requests will have a correlation id which is pertained with a request as it propagates through the system.This value will show which request is being processed as it flows through the system.If no correlation id is provided in the request, one will be generated.

DescriptionHeader keyExample value
Distribution ChannelEntur-Distribution-ChannelENT:DistributionChannel:app
Correlation IdX-Correlation-Id7c9786df-cadf-4a70-9487-541607ade1b4
AuthorizationAuthorizationBearer xxxxxxx.yyyyyyyy.zzzzzzzzz

Currency

The Offers API has a standardised way of representing value of products. Firstly, a currency code is always specified for a given product (e.g. "NOK", "USD", etc.). Secondly, the amount for the given currency is represented as a numeric string with two decimal points (e.g. "100.00").