Overview

The booking API for Haramain High-Speed Railway, for Online Travel Agencies

View as Markdown

The HHR Ticketing System OTA API lets Online Travel Agencies search, book, pay for, and cancel journeys on Saudi Arabia Railway’s Haramain High-Speed Railway (HHR). It follows the OpenTravel Alliance (OTA) standard, adapted to JSON.

You reach the railway through WorldTicket (GO7). Indra EBKS is the core booking system, GO7 is the OTA-standard layer on top of it, and you integrate with GO7. Everything in this reference is live in production.

The GO7 documentation is the production source of truth. For anything this site does not cover, follow the GO7 OTA API docs.

How the API is shaped

Every operation is a single HTTP POST to one OTA endpoint. You choose the operation with the local-name header. The request and response bodies change per operation, but the URL and the method never do.

$curl -X POST https://api.sar.worldticket.cloud/ota/v2015b/OTA \
> -H "x-api-key: YOUR_API_KEY" \
> -H "local-name: OTA_AirLowFareSearchRQ" \
> -H "Content-Type: application/json" \
> -d '{ ... }'

The operations

Operation (local-name)What it does
OTA_AirLowFareSearchRQSearch trains and fares, one way or round trip.
OTA_AirBookRQCreate an individual booking with full passenger data.
OTA_AirPriceRQHold seats for a group with passenger counts only.
OTA_AirBookModifyRQAdd or change passenger details on a booking.
OTA_AirDemandTicketRQPay from the wallet and issue tickets.
OTA_ReadRQRead a booking by its W1 record locator.
OTA_AirSeatMapRQGet the seat map for a segment.
OTA_CancelRQCancel a whole booking.

The ticket documents also live on their own services: resend the confirmation emails and download the ticket PDFs. See Ticket documents.

A typical journey runs in order: search for a train, create the booking, pay and issue the tickets. See Booking flows for the full sequence and Booking models to choose between individual and group. When a call fails, Errors explains what came back.

Environments

ProductionTest
OTA APIhttps://api.sar.worldticket.cloud/ota/v2015b/OTAhttps://test-api.worldticket.net/ota/v2015b/OTA
Authhttps://api.sar.worldticket.cloud/authhttps://test-auth.worldticket.net/auth

Build against Test first, then switch the base URL for Production. See Authentication for how to get a key or a token.

Stations

StationCode
King Abdulaziz International AirportJED
Al-SulimaniyahJXD
King Abdullah Economic CityKCX
MakkahMKX
MadinahDMX

Codes you will use

Booking class. Y is Economy (HHR class T). C is Business (HHR class P).

Passenger type. ADT, CHD, and INF map to HHR codes 1, 2, and 3.

Document type. 2 is a passport. 5 is a national ID.

Record locators

A booking carries two locators. The W1 locator is the WorldTicket PNR, and you use it in every API call. The HHR locator is the railway’s own reference. Read either one back from the booking.