Entur Developer

OSDM

Entur offers a subset of the OSDM specification, version 3.7.1. As of now, only seat reservation for travellers with a travel pass is supported.

Calling the API

Base URLs

Credentials

The API uses OAuth2 client credentials. Your organisation needs access to Entur Partner, where you create the clients yourself.

  1. Go to Entur Partner for the environment you want to use:
  2. Create a new client.
  3. Add role: Klientrolle - Sales channel - OSDM.
  4. Open the client's details page to find Client ID and Client secret.

To get an access token, see Authentication.

Headers

Authorization: Bearer <ACCESS_TOKEN>

Accept-Language: ISO 639-1 language code. Supported: nb (Norwegian) and en (English). Defaults to English if no header is provided.

Requestor: Mandatory header to identify the calling application. We will assign you a "point of sale" and "distribution channel". The header must be a base64 encoded string that contains the following:

JSONCode
{ "entur-pos": "YourPointOfSale", "entur-distribution-channel": "YourDisturbutionChannel" }

ET-Client-Name: Not part of OSDM, but mandatory by Entur on all requests, both open and authenticated. Requests without this header may be rate limited or blocked. Use a value that uniquely identifies your company and application, on the format: company-application (lowercase, no spaces).

Request example

TerminalCode
curl 'https://api.staging.entur.io/bifrost/osdm/reduction-cards' \ -H 'Accept: application/json' \ -H 'Accept-Language: en' \ -H 'Requestor: <REQUESTOR_HEADER>' \ -H 'ET-Client-Name: <CLIENT_NAME>' \ -H 'Authorization: Bearer <ACCESS_TOKEN>'

Supported functionality

ResourceActionPath
OffersPOST/offers
BookingsPOST/bookings
GET/bookings/{bookingId}
GET/bookings/{bookingId}/passengers
GET/bookings/{bookingId}/passengers/{passengerId}
PATCH/bookings/{bookingId}/passengers/{passengerId}
GET/bookings/{bookingId}/purchaser
PATCH/bookings/{bookingId}/purchaser
POST/bookings/{bookingId}/cleanup
FulfillmentsPOST/bookings/{bookingId}/fulfillments
RefundsPOST/bookings/{bookingId}/refund-offers
GET/bookings/{bookingId}/refund-offers/{refundOfferId}
PATCH/bookings/{bookingId}/refund-offers/{refundOfferId}
DELETE/bookings/{bookingId}/refund-offers/{refundOfferId}
Master DataGET/reduction-cards

Searching for offers

  • Search by tripSpecification only, we do not support tripSearchCriteria
  • Reduction card (travel pass) is mandatory. e.g ENT:EntitlementProduct:Intl-Class2
  • Only supported field in offerSearchCriteria is currency (either NOK or EUR)
  • Only supports "embed": ["ALL"]
  • Returns offers without admissionOfferParts, only reservationOfferParts

tripSpecifications[].legs[] must contain enough information so that we can get a match in Entur's journey-planner.

  • stopPlaceRef must be an ID from National Stop Register (NSR) on the format: urn:<nsrRef> e.g. urn:NSR:StopPlace:548 for Bergen
  • timetabledTime of both departure and arrival
  • service.vehicleNumbers[] must only contain one element: the ID of the service journey
  • service.carriers is mandatory in the OSDM spec, but not used since vehicleNumbers[] is a service journey ID. Use an empty array

Search example

We can find stop places from NSR, and use Journey Planner to find trips between them: e.g. query for Bergen stasjon - Oslo S The output will give us serviceJourneyId and timeTabledTime.

JSONCode
{ "tripPatterns": [ { "legs": [ { "serviceJourney": { "id": "VYG:ServiceJourney:64-BRG_444368-R", "expectedStartTime": "2026-09-14T15:38:00+02:00", "expectedEndTime": "2026-09-14T22:27:00+02:00" }, "fromPlace": { "name": "Bergen stasjon" }, "toPlace": { "name": "Oslo S" } } ] } ] }

We can map tripPatterns[].legs[] to tripSpecifications[].legs[], and make a post request against /offers:

JSONCode
{ "tripSpecifications": [ { "legs": [ { "externalRef": "ext-leg-ref-1", "timedLeg": { "start": { "stopPlaceRef": { "objectType": "StopPlaceRef", "stopPlaceRef": "urn:NSR:StopPlace:548" }, "serviceDeparture": { "timetabledTime": "2026-09-14T15:38:00+02:00" } }, "end": { "stopPlaceRef": { "objectType": "StopPlaceRef", "stopPlaceRef": "urn:NSR:StopPlace:337" }, "serviceArrival": { "timetabledTime": "2026-09-14T22:27:00+02:00" } }, "service": { "vehicleNumbers": [ "VYG:ServiceJourney:64-BRG_444368-R" ], "carriers": [] } } } ], "externalRef": "ext-trip-ref-1" } ], "anonymousPassengerSpecifications": [ { "externalRef": "A1", "type": "PERSON", "cards": [ { "code": "ENT:EntitlementProduct:Intl-Class2", "type": "TRAVEL_PASS" } ] } ], "offerSearchCriteria": { "currency": "EUR" } }

Bookings

Purchaser and passenger externalRef is restricted to 39 characters due to limitations in legacy systems. This applies to POST /bookings, PATCH /bookings/{bookingId}/passengers/{passengerId} and PATCH /bookings/{bookingId}/purchaser. This restriction may be lifted in the future. For other elements, externalRef has no length restriction.

For purchaser and passenger, we support these fields:

  • detail.firstName
  • detail.lastName
  • detail.contact.email
  • detail.contact.phoneNumber

Other fields are ignored. Price depends on age, so we use the age submitted in the offer search.

In PATCH requests for passenger and purchaser, null values are ignored because we cannot distinguish them from absent values. To clear a field, send an empty string.

Contact information is optional. To let operators notify travellers of disruptions or changes, submit at least a purchaser with contact information. We delete contact information 6 months after the journey's arrival.

Fulfillments

Fulfillment is asynchronous. POST /bookings/{bookingId}/fulfillments confirms the booking and finalizes the payment, and returns 202 Accepted with fulfillments[].status=CONFIRMED. To get the documents, fetch the booking. When the documents are ready, fulfillments[].status is FULFILLED.

Refunds

Subsequent POST requests to /bookings/{bookingId}/refund-offers will always generate new refund offers. Previous offers are still valid, and unused offers don't need to be deleted. The booking will never reflect any proposed refunds, and booking.refundOffers only contains confirmed refund offers.

Errors and problems

We follow the OSDM error handling principles. Client and server errors return 4xx or 5xx with the OSDM problem structure.

200 responses may include problems[]:

  • When no offers are returned, we return a problem explaining why, for example NO_RESULTS or FULLY_BOOKED.
  • When an error is not severe enough to fail the request, we return PARTIAL_SUCCESS with a description of the error.

Troubleshooting

When contacting support, include the following where relevant:

  • Environment
  • The traceparent or tracestate request header, or the X-Correlation-Id response header
  • Date of the request or response

Logs are kept for 30 days.

Last modified on
Did you find what you were looking for?