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
- Production: https://api.entur.io/bifrost/osdm
- Staging: https://api.staging.entur.io/bifrost/osdm
Credentials
The API uses OAuth2 client credentials. Your organisation needs access to Entur Partner, where you create the clients yourself.
- Go to Entur Partner for the environment you want to use:
- Create a new client.
- Add role:
Klientrolle - Sales channel - OSDM. - 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:
Code
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
Code
Supported functionality
| Resource | Action | Path |
|---|---|---|
| Offers | POST | /offers |
| Bookings | POST | /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 | |
| Fulfillments | POST | /bookings/{bookingId}/fulfillments |
| Refunds | POST | /bookings/{bookingId}/refund-offers |
| GET | /bookings/{bookingId}/refund-offers/{refundOfferId} | |
| PATCH | /bookings/{bookingId}/refund-offers/{refundOfferId} | |
| DELETE | /bookings/{bookingId}/refund-offers/{refundOfferId} | |
| Master Data | GET | /reduction-cards |
Searching for offers
- Search by
tripSpecificationonly, we do not supporttripSearchCriteria - Reduction card (travel pass) is mandatory. e.g
ENT:EntitlementProduct:Intl-Class2 - Only supported field in
offerSearchCriteriais currency (either NOK or EUR) - Only supports
"embed": ["ALL"] - Returns offers without
admissionOfferParts, onlyreservationOfferParts
tripSpecifications[].legs[] must contain enough information so that we can get a match in Entur's journey-planner.
stopPlaceRefmust be an ID from National Stop Register (NSR) on the format:urn:<nsrRef>e.g.urn:NSR:StopPlace:548for BergentimetabledTimeof both departure and arrivalservice.vehicleNumbers[]must only contain one element: the ID of the service journeyservice.carriersis mandatory in the OSDM spec, but not used sincevehicleNumbers[]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.
Code
We can map tripPatterns[].legs[] to tripSpecifications[].legs[], and make a post request against /offers:
Code
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.firstNamedetail.lastNamedetail.contact.emaildetail.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_RESULTSorFULLY_BOOKED. - When an error is not severe enough to fail the request, we return
PARTIAL_SUCCESSwith a description of the error.
Troubleshooting
When contacting support, include the following where relevant:
- Environment
- The
traceparentortracestaterequest header, or theX-Correlation-Idresponse header - Date of the request or response
Logs are kept for 30 days.