-
Notifications
You must be signed in to change notification settings - Fork 0
API EN
curl 'http://example.com/api/search?from=BKK&to=BOM&date1=2017-09-25&date2=2017-10-01&adults=2&children=1&infants=1&cabin=Y&partner=jtrdr&password=pass&locale=en¤cy=usd&market=us'
- from - IATA code of departure city/airport.
- to - IATA code of arrival city/airport.
- date1 - YYYY-MM-DD date of departure.
- date2 - YYYY-MM-DD date of departure for a roundtrip journey. Sould be omitted for oneway searches.
- adults - "1" if omitted!
- children - "0" by default.
- infants - "0" by default.
- cabin - preferred booking class. "Y" for economy, "C" for business, "F" for first/premium. Empty by default (no preference).
- partner - partner company identificator. We will send 'aviasales' value.
- password - password of current partner.
-
locale - User locale (
en
by default). -
currency - User currency (
usd
by default). -
market - Market where integration launches (
us
by default).
<?xml version='1.0' encoding='utf-8' ?>
<variants>
<variant>
<price>2664</price>
<currency>usd</currency>
<url>BOOKING_PAGE_DEEPLINK</url>
<seats>6</seats>
<isCharter>false</isCharter>
<commission>0.045</commission>
<segment>
<flight>
<operatingCarrier>UN</operatingCarrier>
<marketingCarrier>SU</marketingCarrier>
<number>3</number>
<departure>BKK</departure>
<departureDate>2012-09-25</departureDate>
<departureTime>09:55</departureTime>
<arrival>BOM</arrival>
<arrivalDate>2012-09-25</arrivalDate>
<arrivalTime>11:10</arrivalTime>
<equipment>735</equipment>
<cabin>Y</cabin>
<baggage>1PC23</baggage>
<handbags>1PC5</handbags>
<fareCode>WOW1</fareCode>
<isBus>false</isBus>
<isTrain>false</isTrain>
<technicalStop>
<airportCode>AER</airportCode>
</technicalStop>
<technicalStop>
<airportCode>AAQ</airportCode>
</technicalStop>
</flight>
</segment>
</variant>
<variant>
...more variants...
</variants>
- Server should respond in 30 seconds or less.
- All non HTTP 200 responses are errors. Response should contain text description of error.
- All HTTP 200 responses are successful responses.
-
BOOKING_PAGE_DEEPLINK
string is an URL to booking page. Booking page language and currency must match the language and currency provided in the request.
<?xml version='1.0' encoding='utf-8' ?>
<variants></variants>
- /variants - root element containing ticket variants.
- //variant - full flight variant
- price (mandatory) - total price for all the passengers.
- currency (mandatory) - currency code used in price. For example RUB.
- url (mandatory) - deeplink to variant page for booking.
-
seats (optional) – seats available for booking by current fare.
0..9
number.0
for no tickets available and9
for more than 9 tickets available. -
isCharter (optional) - qualifies itinerary as charter
true|false
- commission (optional) - commission rate for a specific proposal
- segment - 1 element for one way, 2 for roundtrip
- segment/flight - 1..n, more than one if there're connecting points in the requested leg
-
//flight - one hop flight information
- operatingCarrier (mandatory) - airline IATA code (2 latin letters) aircraft belongs to this airline
-
marketingCarrier (optional) - airline IATA code (2 latin letters) of code sharing airline. Should be specified if differs with
operatingCarrier
- number (mandatory) - 2..4 digits, full flight number is (operatingCarrier + number)
- departure (mandatory) - departure airport IATA code (3 latin letters)
- departureDate (mandatory) - departure date, 'YYYY-MM-DD', local
- departureTime (mandatory) - departure time, 'HH:MM', local
- arrival (mandatory) - arrival airport IATA code (3 latin letters)
- arrivalDate (mandatory) - arrival date, 'YYYY-MM-DD', local
- arrivalTime (mandatory) - arrival time, 'HH:MM', local
- equipment (optional) - IATA (or russian domestic) aircraft/bus/train equipment type code. several letters/digits
- cabin (optional) - cabin class. could be 'F' for 'first', 'C' for 'business', 'Y' for 'economy/couch'
-
baggage (optional) — baggage string code in format {N}PC{WW} where
N
is a number of bags permitted by current fare andWW
is a max weight of every bag. Please pass an empty string if no baggage information available, and0PC
value for hand baggage only fares. -
handbags (optional) — handbags string code in format {N}PC{WW} where
N
is a number of bags permitted by current fare andWW
is a max weight of every bag. Please pass an empty string if no handbags information available. - fareCode (optional) – fare code or fare basis for current variant.
-
isBus (optional)/isTrain(optional) — qualifies segment as part of multimodal itinerary carried by bus/train
true|false
. -
//technicalStop — List of Technical Stops
- airportCode — IATA-code of the airport
Client redirects user browser to the url from variant/url tag. Client is also able to add tracking marker (also called sub-id) string to variant/url URL to track customers. Full deeplink booking URL built as follows:
- Parse Deeplink URL
- Add
marker=<marker_value>
to query params section (make sure the request parameters of the original deep link URL comply with the RFC 3986 standard) - Encode query params section
marker_value is a string containing 256 characters or less. Markers should be returned as a part of booking information in statistics.
curl 'http://example.ru/api/search?from=MOW&to=LED&date1=2017-09-25&from2=LED&to2=IKT&date2=2017-10-01&from3=IKT&to3=VVO&date3=2017-10-03&adults=2&children=1&infants=1&cabin=Y&partner=avsl&password=pass&locale=ru¤cy=rub'
<?xml version='1.0' encoding='utf-8' ?>
<variants>
<variant>
<price>2664</price>
<currency>rub</currency>
<url>BOOKING_PAGE_DEEPLINK</url>
<seats>3</seats>
<isCharter>false</isCharter>
<commission>0.0493</commission>
<segment>
<flight>
<operatingCarrier>UN</operatingCarrier>
<marketingCarrier>SU</marketingCarrier>
<number>3</number>
<departure>DME</departure>
<departureDate>2017-09-25</departureDate>
<departureTime>09:55</departureTime>
<arrival>LED</arrival>
<arrivalDate>2017-09-25</arrivalDate>
<arrivalTime>11:10</arrivalTime>
<equipment>735</equipment>
<cabin>Y</cabin>
<baggage>1PC23</baggage>
<handbags>1PC5</handbags>
<fareCode>WOW1</fareCode>
<isBus>false</isBus>
<isTrain>false</isTrain>
</flight>
</segment>
<segment>
<flight>
<operatingCarrier>UN</operatingCarrier>
<marketingCarrier>SU</marketingCarrier>
<number>3</number>
<departure>LED</departure>
<departureDate>2017-10-01</departureDate>
<departureTime>09:55</departureTime>
<arrival>IKT</arrival>
<arrivalDate>2017-10-01</arrivalDate>
<arrivalTime>11:10</arrivalTime>
<equipment>736</equipment>
<cabin>Y</cabin>
<baggage>1PC23</baggage>
<handbags>1PC5</handbags>
<fareCode>WOW1</fareCode>
<isBus>false</isBus>
<isTrain>false</isTrain>
<technicalStop>
<airportCode>AER</airportCode>
</technicalStop>
<technicalStop>
<airportCode>AAQ</airportCode>
</technicalStop>
</flight>
</segment>
<segment>
<flight>
<operatingCarrier>SU</operatingCarrier>
<marketingCarrier>SU</marketingCarrier>
<number>3</number>
<departure>IKT</departure>
<departureDate>2017-10-03</departureDate>
<departureTime>10:55</departureTime>
<arrival>VVO</arrival>
<arrivalDate>2017-10-03</arrivalDate>
<arrivalTime>15:00</arrivalTime>
<equipment>736</equipment>
<cabin>Y</cabin>
<baggage>1PC23</baggage>
<handbags>1PC5</handbags>
<fareCode>WOW1</fareCode>
<isBus>false</isBus>
<isTrain>false</isTrain>
</flight>
</segment>
</variant>
<variant>
...more variants...
</variant>
</variants>
curl 'http://example.com/api/statistics?date1=2016-05-01&date2=2016-06-01&partner=aviasales&password=secret'
- date1 - YYYY-MM-DD date.
- date2 - YYYY-MM-DD date.
- partner - partner identifier.
- password - password of current partner.
Response should contain all bookings created between date1 and date2.
<bookings>
<booking>
<id>JHKHVR</id>
<PNR>AEFE3S</PNR>
<created_at>2012-05-02 00:02:01</created_at>
<marker>1232:1222.t</marker>
<price>1199</price>
<profit>200</profit>
<currency>RUB</currency>
<state>PAID</state>
<segment>
<flight>
<operatingCarrier>UN</operatingCarrier>
<number>3</number>
<departure>DME</departure>
<departureDate>2012-09-25</departureDate>
<departureTime>09:55</departureTime>
<arrival>LED</arrival>
<arrivalDate>2012-09-25</arrivalDate>
<arrivalTime>11:10</arrivalTime>
<equipment>735</equipment>
<cabin>Y</cabin>
</flight>
</segment>
<adults>1</adults>
<children>0</children>
<infants>0</infants>
</booking>
...more bookings...
</bookings>
- /bookings - root element containgin all bookings.
- //booking - information on one booking.
- id - unique identifier of booking.
- PNR - PNR of booking.
- created_at - YYYY-MM-DD HH:MM date and time of booking in UTC time.
- marker - marker sent to booking deeplink in GET parameter marker.
- from - origin IATA.
- to - destination IATA.
- price - prices of tickets.
- profit - metasearch agency profit for this booking.
- currency - currency for fields price and profit.
- state - state of booking. Possible values PROCESSING/PAID/CANCELLED.
- segment - same as in search results.
-
//flight - one hop flight information
- operatingCarrier - airline IATA code (2 latin letters) aircraft belongs to this airline
- number - 2..4 digits, full flight number is (operatingCarrier + number)
- departure - departure airport IATA code (3 latin letters)
- departureDate - departure date, 'YYYY-MM-DD', local
- departureTime - departure time, 'HH:MM', local
- arrival - arrival airport IATA code (3 latin letters)
- arrivalDate - arrival date, 'YYYY-MM-DD', local
- arrivalTime - arrival time, 'HH:MM', local
- equipment - IATA (or russian domestic) aircraft/bus/train equipment type code. several letters/digits
- cabin - cabin class. could be 'F' for 'first', 'C' for 'business', 'Y' for 'economy/couch'
- adults - Adults.
- children - Children.
- infants - Infants.
Please use this online tool to validate your implementation of gate API: https://aviasales-gate-tester.herokuapp.com/
curl 'http://example.ru/api/supported_directions?partner=aviasales&password=secret'
LON,PAR
PAR,LON
...
NYC,MOW
MOW,NYC
We expect to receive in response a pair of IATA codes of departure and arrival cities.