Seat Map frontend integration for XML API User
1. Service domain
Seatmap service is available under https://seatmap.ypsilon.net/
2. Two access modes:
It is possible to open seatmap in two different ways.
First possibility is to use it as standalone seatmap. It can be called only if flight booking is already finished and filekey is known.
Example call for standalone seatmap:
https://seatmap.ypsilon.net/?aid=AGENCY_ID&conso=CONSO_ID&filekey=XX123456&paxname=SURNAME&accessmode=b2c
Second way is to call seatmap embedded when filekey is not known (before booking). It is necessary to provide full information about number of passengers, flight locations, dates etc. Embedded map should be placed in iframe with service domain set as it's src attribute (see more in section 3. Parameters)
3. Parameters
Parameter | Description | Default | (m)andatory/(o)ptional |
filekey | Flight reservation number provided by carrier | – | m (standalone) |
aid | Your B2C Ypsilon.NET User | – | m |
conso | Your Ypsilon.NET ConsoID | – | m |
sid | XML API session id string | – | m (embedded) |
paxname | Surname of one of the passengers in the PNR. | – | m (standalone) |
flights | Number of segments of the flight. Each segment is specified later in legs parameter. | – | m (embedded) |
pax | Total number of passengers | – | m (embedded) |
adt | Number of adults (12+ yrs) | – | m (embedded) |
chd | Number of children (2+ to 12 yrs) * note that children under 2 years are consider to be infants without possibility to book a seat | – | m (embedded) |
legs | List of all segments of flight, numerating from 0. Contains full information about each leg. Format: [departure airport],[destination airport],[flight number],[flight datetime],[carrier 2 letter code],[class of service] example: legs[0]=FRA,CLT,4086,2018-07-10 09:20:00,AY,O | – | m (embedded) |
fbase | List of fare base codes for each passenger for each segment. Numeration starts from 0. format: fbase[segment][pax number] example: fbase[0][0]=T37FLX2A (first segment, first passenger) * note: in case of lowcost fare fbase is ‘LOWCOST’ | – | m (embedded) |
passengers | Comma separated list of passengers (firstname, lastname). Displayed to customer as proposition to select seats. If not given “Passenger X” is used for reference, where X is order number of each next pax. | Passenger 1, Passenger 2, Passenger 3... | o (embedded) |
low_cr | 2 letter LOWCOST carrier code example: low_cr=4U *note: this should be sent only if carrier is LOWCOST and it's before booking (no filekey available) | – | m (embedded and lowcost carrier) |
b2b_agent | B2B Username, this switches seatmap into b2b mode which will get additional params related to b2b configuration | – | o |
4. Information about selected seats from embedded seatmap
Embedded seatmap uses postMessage API (https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to return information about selected seats in JSON format.
In order to get selected seats postMessage event listener must be implemented.
Example of postMessage receiver:
window.addEventListener("message", receiveSeatsMessage, false);
function receiveSeatsMessage(e){
var origin = e.origin || e.originalEvent.origin;
// it's important to make sure, that message comes from allowed hostname
if(parseURL(origin).hostname !== parseURL(seatmap_host).hostname){
return;
}
if(e.data){
// apply code to handle data, seats inside
}
}
Example postMessage response:
xmlapi_book_possible { true, false } - it is possible to book seats directly through XML API if this flag is set to true. Otherwise it's necessary to communicate with Seatmap Daemon Backend.
{ "xmlapi_book_possible":false,"seats":{"FRAJFKSQ26":{"passengers":{"0":{"name":"Passenger 1","price":"","price_agent":"","price_orig":"","price_agent_orig":"","seatid":"50A","currency":"","currency_agent":"","seat":"50A","row":50,"col":"A"},"1":{"name":"Passenger 3","price":"","price_agent":"","price_orig":"","price_agent_orig":"","seatid":"50B","currency":"","currency_agent":"","seat":"50B","row":50,"col":"B"},"2":{"name":"Passenger 2","price":"","price_agent":"","price_orig":"","price_agent_orig":"","seatid":"51G","currency":"","currency_agent":"","seat":"51G","row":51,"col":"G"}},"curr_pax_nr":3,"leg_no":0}}}