NAV Navbar
shell

Introduction

Welcome to the Kyte API documentation. Everything to search and book a flight end to end can be found here. If you have any issues please email support@gokyte.com.

Getting Started

Sandbox & Live

We give full sandbox access as soon as anyone signs up to our platform. Our sandbox environment allows you to test bookings end to end with various different airlines.

To acquire live access you must apply through your app page, we aim to provide provide all live keys within 3 days of applying.

Getting your api key

You will need to email sales@gokyte.com to get a key. We are happy to provide keys to our sandbox environment to anyone that requests them.

Booking Flow

There are 3 calls required to make a flight booking end to end:

  1. Search - This is used to find offers (prices for flights) based on a given set of destinations. Each offer as an offerId this is used when creating the booking.

  2. Create Booking - This method does not book the flight it creates the booking in the airline system and is used to check the price of an offer to make sure it hasn't changed since search. This will give you a bookingId which can be used to make the final booking.

  3. Submit Booking - This method books and pays for the flight. It will return a booking reference that should always be shown to the user as this is how they access their flight with the airline. The airline will also send a confimation email to the email address given with the payment information.

Airports

List

Gets a list of all commercial airports in the world.

Request:

curl "https://sandbox.api.gokyte.com/api/info/airport"

Response:

{
    "code":"LHR",
    "name":"Heathrow",
    "country_code":"GB",
    "icao":"EGLL",
    "city_code":"LON",
    "lat":51.469604,
    "lng":-0.453566,
    "alternatenames":"London Heathrow,Heathrow,Heathrow,Heathrow,Londres-Heathrow,Хитроу,สนามบินลอนดอนฮีทโธรว์,Heathrow,伦敦希思罗机场",
    "timezone":"Europe/London",
    "gmt":0,
    "is_rail_road":0,
    "is_bus_station":0,
    "tch_code":"ЛХР",
    "popularity":229,
    "phone":"0844 335 1801",
    "website":"http://www.heathrowairport.com/",
    "geoname_id":2647216,
    "routes":42,
    "type":"airport"
}

Response

Parameter Description
code The official IATA airport code
name The name of the airport
country_code The airports country code
icao The official ICAO airport code
city_code The code of the city the airport is located in
lat The latitute of the airport
lng The longitude of the airport
alternatenames Different names for the airport including names in different languages
timezone The name of the timezone the airport is located in
gmt The gmt offset of the airport
tch_code The airports official TCH code
popularity The airports popularity rating
phone The contact phone number of the airport
website The airports official website link
routes The amount of routes the airport flies

Search

Search for flights

Request:

curl "https://sandbox.api.gokyte.com/api/flights/search"
  -X POST
  -H "x-api-key: <your api-key>"
  --data @- << EOF
{
    "journeys": [
        {
            "departureAirport": "LHR",
            "arrivalAirport": "HKG",
            "departureDate": "2019-04-05",
            "ticketTypes": [
                "economy"
            ]
        },
        {
            "departureAirport": "HKG",
            "arrivalAirport": "LHR",
            "departureDate": "2019-04-10",
            "ticketTypes": [
                "economy"
            ]
        }
    ],
    "passengers": [
        {
            "type": "adult"
        },
        {
            "type": "adult"
        }
    ]
}
EOF

This endpoint retrieves all possible flights from all available airlines.

HTTP Request

POST https://sandbox.api.gokyte.com/api/flights/search

Query Parameters

Parameter Default Description
lang EN Returns a localised version of the flight information. Each airline supports different languages, if they do not support the given language it will default to EN (beta)
currency GBP Returns the pricing information in the selected currency (only GBP suported)

Request

Parameter Description Notes
journeys An array of journey objects that represent each destination for the trip
fareTypes (optional) Array of fares to search for (lowest: find the lowest fairs, flexible: fairs that have an open return date, leisure: Removes business travel specfic faires ) Only one element currently supported
passengers An array of passenger objects for the current search

Journey Object

Parameter Description Notes
departureDate Departure date of the flight
departureAirport Departure airport of the flight
arrivalAirport Arival airport of the flight
ticketTypes An array of different ticket types (economy, premium, business, first) Should be the same for all flights in the search

Passenger Object

Parameter Description Notes
anonymous Additional information required if false
type The passenger type (adult, child) All child tickets but have a birthday
birthDate The birthday of a child passenger Only required for child passenger type

Response

Response:

{
    "destinations": [
        {
            "code": "OD1",
            "departure": "LON",
            "arrival": "HKG",
            "flightIds": [
                "QkE6RmxpZ2h0MQ"
            ]
        },
        {
            "code": "OD2",
            "departure": "HKG",
            "arrival": "LON",
            "flightIds": [
                "QkE6RmxpZ2h0Ng"
            ]
        }
    ],
    "flights": [
        {
            "id": "QkE6RmxpZ2h0MQ",
            "flightsOrder": [
                "BA0031"
            ],
            "flightSegments": [
                {
                    "id": "BA0031",
                    "marketingCarrier": {
                        "airlineId": "BA",
                        "name": "British Airways"
                    },
                    "operatingCarrier": {
                        "airlineId": "BA",
                        "name": "British Airways"
                    },
                    "flightNumber": "0031",
                    "flightDuration": 715,
                    "departure": {
                        "airportCode": "LHR",
                        "airportName": "HEATHROW",
                        "terminal": "5",
                        "date": "2019-03-05",
                        "time": "18:25"
                    },
                    "aircraft": {
                        "code": "777",
                        "name": "Boeing 777 jet"
                    },
                    "arrival": {
                        "airportCode": "HKG",
                        "airportName": "HONG KONG",
                        "terminal": "1",
                        "changeOfDay": "1",
                        "date": "2019-03-06",
                        "time": "14:20"
                    }
                }
            ],
            "totalDuration": 715
        },
        {
            "id": "QkE6RmxpZ2h0Ng",
            "flightsOrder": [
                "BA0028"
            ],
            "flightSegments": [
                {
                    "id": "BA0028",
                    "marketingCarrier": {
                        "airlineId": "BA",
                        "name": "British Airways"
                    },
                    "operatingCarrier": {
                        "airlineId": "BA",
                        "name": "British Airways"
                    },
                    "flightNumber": "0028",
                    "flightDuration": 790,
                    "departure": {
                        "airportCode": "HKG",
                        "airportName": "HONG KONG",
                        "terminal": "1",
                        "date": "2019-03-10",
                        "time": "23:45"
                    },
                    "aircraft": {
                        "code": "388",
                        "name": "Airbus A380 Jet"
                    },
                    "arrival": {
                        "airportCode": "LHR",
                        "airportName": "HEATHROW",
                        "terminal": "5",
                        "changeOfDay": "1",
                        "date": "2019-03-11",
                        "time": "04:55"
                    }
                }
            ],
            "totalDuration": 790
        }
    ],
    "offers": [
        {
            "offerId": "YnJpdGlzaC1haXJ3YXlzOm9wMDgudHgtMDgtMDItMS03MDliMTA1MC0yYjE3LTRiMjEtYWNjMS1mMDQxMDE2NDVhYTY6T0YtMDkzMTEyNjktYmQ0Ny00YTllLWE2NTUtN2IwYjc4MTZlNmU0",
            "owner": "BA",
            "expiration": "2019-02-19T12:24:51.881Z",
            "journeys": [
                {
                    "destination": "OD1",
                    "flightId": "QkE6RmxpZ2h0MQ"
                },
                {
                    "destination": "OD2",
                    "flightId": "QkE6RmxpZ2h0Ng"
                }
            ],
            "passengers": [
                {
                    "passengerId": "SH1",
                    "type": "ADT",
                    "fares": [
                        {
                            "flightSegment": "BA0031",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE1ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLXC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        },
                        {
                            "flightSegment": "BA0028",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE2ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLWC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        }
                    ],
                    "baseAmount": 280.00,
                    "taxAmount": 346.12,
                    "totalAmount": 626.12
                },
                {
                    "passengerId": "SH2",
                    "type": "ADT",
                    "fares": [
                        {
                            "flightSegment": "BA0031",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE1ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLXC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        },
                        {
                            "flightSegment": "BA0028",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE2ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLWC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        }
                    ],
                    "baseAmount": 280.00,
                    "taxAmount": 346.12,
                    "totalAmount": 626.12
                }
            ],
            "totalPrice": {
                "amount": 1252.24,
                "currencyCode": "GBP"
            }
        },
        {
            "offerId": "YnJpdGlzaC1haXJ3YXlzOm9wMDgudHgtMDgtMDItMS03MDliMTA1MC0yYjE3LTRiMjEtYWNjMS1mMDQxMDE2NDVhYTY6T0YtNDk0YWNmMWItMjY1MC00NTE1LWE0MzItNmZlZGQ1ZmUzM2Ix",
            "owner": "BA",
            "expiration": "2019-02-19T12:24:51.881Z",
            "journeys": [
                {
                    "destination": "OD1",
                    "flightId": "QkE6RmxpZ2h0Mg"
                },
                {
                    "destination": "OD2",
                    "flightId": "QkE6RmxpZ2h0Ng"
                }
            ],
            "passengers": [
                {
                    "passengerId": "SH1",
                    "type": "ADT",
                    "fares": [
                        {
                            "flightSegment": "BA0027",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE1ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLXC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        },
                        {
                            "flightSegment": "BA0028",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE2ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLWC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        }
                    ],
                    "baseAmount": 280.00,
                    "taxAmount": 346.12,
                    "totalAmount": 626.12
                },
                {
                    "passengerId": "SH2",
                    "type": "ADT",
                    "fares": [
                        {
                            "flightSegment": "BA0027",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE1ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLXC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        },
                        {
                            "flightSegment": "BA0028",
                            "pcrId": "PCR_1",
                            "fareRefCode": [
                                "FBCODE2ADT"
                            ],
                            "fareCode": "70J",
                            "fareBasisCode": "NLWC00B7/Y",
                            "code": "N",
                            "availableSeats": "9",
                            "name": "BASIC"
                        }
                    ],
                    "baseAmount": 280.00,
                    "taxAmount": 346.12,
                    "totalAmount": 626.12
                }
            ],
            "totalPrice": {
                "amount": 1252.24,
                "currencyCode": "GBP"
            }
        }
    ]
}
Parameter Description Notes
offers Array of all offers from all airlines serving the selected routes and times. An offer contains the flights and prices for those flights.
expiration The time that the price for the offer expires.
flights List of all the flights from one destination to another (see destinations)
destinations List of all the destinations with directions

Offer Object

Parameter Description Notes
id Offer id used to get additional information
owner The airline's code providing the offer
journeys The journeys included in the offer
passengers All passengers included in the offer
totalPrice The total payable amount and currency for the offer

Passengers Object

Parameter Description Notes
passengerId Passenger reference id Used to identify the passenger between different steps
type Passenger type One of: adult, child, infant
fares Fares for each flight in the offer See fares object
baseAmount The base amount for all flights in the offer
taxAmount The tax amount for all flights in the offer
totalAmount The total amount for all flights in the offer

Book

Create a booking

Request:

curl "https://sandbox.api.gokyte.com/api/flights/offer"
  -X POST
  -H "x-api-key: <your api-key>"
    --data @- << EOF
{
    "offerId": "YnJpdGlzaC1haXJ3YXlzOm9wMDgudHgtMDgtMDItMS03MDliMTA1MC0yYjE3LTRiMjEtYWNjMS1mMDQxMDE2NDVhYTY6T0YtMDkzMTEyNjktYmQ0Ny00YTllLWE2NTUtN2IwYjc4MTZlNmU0"
}
EOF

This endpoint creates a booking request and give you the full booking information. The price is only valid until the value of priceGuaranteeExpiration.

This will give you back a bookingId which you can use to submit your final booking.

HTTP Request

POST https://sandbox.api.gokyte.com/api/flights/offer

Response:

{
    "bookingId": "YnJpdGlzaC1haXJ3YXlzOnR4LTA3LTAyLTEtYjQ2ODdhNDItZTgxYy00NjYxLWE0MTQtY2ZkZmRmMzhjY2ZiOk9GLWI2ZjAxMWE3LTZhNDEtNDYyMy1iN2I0LWVlMmNkYThkMDFkMg",
    "totalPrice": {
        "amount": 1252.24,
        "currencyCode": "GBP"
    },
    "journeys": [{
            "id": "QkE6RmxpZ2h0MQ",
            "flightsOrder": [
                "BA0031"
            ],
            "flightSegments": [{
                "id": "BA0031",
                "marketingCarrier": {
                    "airlineId": "BA",
                    "name": "British Airways"
                },
                "operatingCarrier": {
                    "airlineId": "BA",
                    "name": "British Airways"
                },
                "flightNumber": "0031",
                "flightDuration": 720,
                "departure": {
                    "airportCode": "LHR",
                    "airportName": "Heathrow (London) Airport",
                    "terminal": "5",
                    "date": "2019-04-05",
                    "time": "18:40"
                },
                "aircraft": {
                    "code": "388",
                    "name": "Airbus A380 Jet"
                },
                "arrival": {
                    "airportCode": "HKG",
                    "airportName": "Hong Kong Airport",
                    "terminal": "1",
                    "changeOfDay": "1",
                    "date": "2019-04-06",
                    "time": "13:40"
                },
                "passengers": [{
                        "passengerId": "SH1"
                    },
                    {
                        "passengerId": "SH2"
                    }
                ]
            }],
            "totalDuration": 720
        },
        {
            "id": "QkE6RmxpZ2h0Ng",
            "flightsOrder": [
                "BA0032"
            ],
            "flightSegments": [{
                "id": "BA0032",
                "marketingCarrier": {
                    "airlineId": "BA",
                    "name": "British Airways"
                },
                "operatingCarrier": {
                    "airlineId": "BA",
                    "name": "British Airways"
                },
                "flightNumber": "0032",
                "flightDuration": 760,
                "departure": {
                    "airportCode": "HKG",
                    "airportName": "Hong Kong Airport",
                    "terminal": "1",
                    "date": "2019-04-10",
                    "time": "23:10"
                },
                "aircraft": {
                    "code": "388",
                    "name": "Airbus A380 Jet"
                },
                "arrival": {
                    "airportCode": "LHR",
                    "airportName": "Heathrow (London) Airport",
                    "terminal": "5",
                    "changeOfDay": "1",
                    "date": "2019-04-11",
                    "time": "04:50"
                },
                "passengers": [{
                        "passengerId": "SH1"
                    },
                    {
                        "passengerId": "SH2"
                    }
                ]
            }],
            "totalDuration": 760
        }
    ],
    "disclosures": [{
        "id": "DISCLOSURE1",
        "descriptions": [{
            "Text": "31in seat pitch (78cm), lumbar support and adjustable headrest",
            "Media": {
                "MediaLink": "www.britishairways.com/main/WORLD-TRAVELLER/EN_GB"
            }
        }]
    }],
    "penalties": [{
        "penaltyRefId": "Rule1",
        "flightSegment": [
            "BA0031"
        ],
        "passengers": [
            "SH1",
            "SH2"
        ],
        "type": "Change",
        "amount": "150.00",
        "currencyCode": "GBP",
        "remarks": {
            "Remark": "Time/date changes permitted at any time before each flight departure for a change fee of GBP 150.00 or an upgrade fee of GBP 150.00 plus any difference in fare. All sectors may be repriced. Changes subject to availability. Fees apply per ticket"
        }
    }],
    "offerExpiration": "2019-02-19T17:38:11.000Z",
    "priceGuaranteeExpiration": "2019-02-19T17:23:11.000Z",
    "passengers": [{
            "passengerId": "SH1",
            "type": "ADT",
            "fares": [{
                    "id": "PCR_1",
                    "name": "World Traveller",
                    "code": "V",
                    "availableSeats": null,
                    "flightSegment": "BA0031",
                    "fareRefCode": "FBCODE1ADT",
                    "disclosures": [
                        "DISCLOSURE1"
                    ],
                    "penalties": [
                        "Rule1"
                    ]
                },
                {
                    "id": "PCR_2",
                    "name": "Basic",
                    "code": "O",
                    "availableSeats": null,
                    "flightSegment": "BA0032",
                    "fareRefCode": "FBCODE2ADT",
                    "disclosures": [
                        "DISCLOSURE1"
                    ],
                    "penalties": [
                        "Rule1"
                    ]
                }
            ],
            "baseAmount": 280.00,
            "taxAmount": 346.12,
            "totalAmount": 626.12
        },
        {
            "passengerId": "SH2",
            "type": "ADT",
            "fares": [{
                    "id": "PCR_1",
                    "name": "World Traveller",
                    "code": "V",
                    "availableSeats": null,
                    "flightSegment": "BA0031",
                    "fareRefCode": "FBCODE1ADT",
                    "disclosures": [
                        "DISCLOSURE1"
                    ],
                    "penalties": [
                        "Rule1"
                    ]
                },
                {
                    "id": "PCR_2",
                    "name": "Basic",
                    "code": "O",
                    "availableSeats": null,
                    "flightSegment": "BA0032",
                    "fareRefCode": "FBCODE2ADT",
                    "disclosures": [
                        "DISCLOSURE1"
                    ],
                    "penalties": [
                        "Rule1"
                    ]
                }
            ],
            "baseAmount": 280.00,
            "taxAmount": 346.12,
            "totalAmount": 626.12
        }
    ]
}

Response

Parameter Description
bookingId The bookingId to be used to submit a booking
flights A list of all the flights in the current offer

Flights

Parameter Description
flights.id A unique id for the flight
flights.flightSegments An ordered list of flight segments

Submit a booking

Request:

curl "https://sandbox.api.gokyte.com/api/flights/book"
  -X POST
  -H "x-api-key: <your api-key>"
  --data @- << EOF
  {
    "bookingId": "{{bookingId}}",
    "passengers": [
      {
        "passengerId": "SH1",
        "gender": "female",
        "birthDate": "1995-07-20",
        "title": "Mrs",
        "givenName": "First",
        "surname": "Traveler",
        "type": "adult",
        "email": "first.traveler@gokyte.com"
      },
      {
        "passengerId": "SH2",
        "gender": "male",
        "birthDate": "1993-12-15",
        "title": "Mr",
        "givenName": "Second",
        "surname": "Traveler",
        "type": "adult"
      }
    ],
    "payment": {
        "cardholderName": "Mrs First Traveler",
        "cardType": "visa-debit",
        "cardNumber": "4263930000007395",
        "expiryMonth": "07",
        "expiryYear": "2023",
        "issueMonth": "03",
        "issueYear": "2017",
        "cvv": "000",
        "contactEmail": "first.traveler@gokyte.com",
        "address": {
            "addressLine1": "123 Fare Street",
            "addressLine2": "Able Avenue",
            "addressLine3": "",
            "city": "Bournemouth",
            "postalCode": "BH4 8EH",
            "countryCode": "GB"
        }
    }
}
EOF

Response:

{
  "kyteBookingId": "oHg5SJYRHA0",
  "bookingRef": "5ILDNG",
  "airline": {
    "airlineId": "BA",
    "name": "British Airways"
  }
}

Creates and books a flight with given payment information. This is the final step in the booking proccess.

The response will give you back 2 types of booking reference:

  1. kyteBookingId you can use this to get the booking from our system
  2. bookingRef this is the airlines booking reference, this is the reference you should present to the customer

Upon booking the customer will also get a confirmation email from the airline.

Payment Object

Parameter Description Notes
cardholderName The name on the card Must be the same as the Lead passenger (SH1)
contactEmail The email of the payer Must be the same as the Lead passenger (SH1)
cardType The payment card type See Card Types section below
cardNumber The 16-digit card number
expiryMonth The expiry month of the card
expiryYear The expiry year of the card
issueMonth The issue month of the card
issueYear The issue year of the card
cvv The 3 or 4 digit security code of the payment card

Address Object

Parameter Description Notes
addressLine1 The address the card is registered to
addressLine2 The address the card is registered to Optional field
addressLine3 The address the card is registered to Optional field
city The city the card is registered to
postalCode The postal code the card is registered to See Card Types section below
countryCode The country code the card is registered to Must be the code from country endpoint

Card Types

Code Name Notes
visa-personal Visa Personal
visa-corporate Visa Corporate/Business
visa-debit Visa Debit/Delta
maestro Maestro
switch Switch
mastercard-personal Mastercard Personal
mastercard-corporate Mastercard Corporate
mastercard-debit Mastercard Debit
discover-personal Discover Personal
discover-corporate Discover Corporate
diners-club-personal Diners Club Personal
diners-club-corporate Diners Club Corporate
american-express-personal American Express Personal
american-express-corporate American Express Corporate

Test Card Details

These test cards will only work on the sandbox environment.

EasyJet

Parameter Description
cardNumber 4444333322221111
cardType visa-personal
expiryMonth 10
expiryYear 20
cvv 737

British Airways

Parameter Description
cardNumber 4263930000007395
cardType visa-personal
expiryMonth 10
expiryYear 20
cvv 737

HTTP Request

POST https://sandbox.api.gokyte.com/api/flights/book

Response

Parameter Description
kyteBookingId The kyte id for the booking. You can use this to retrieve the customers booking at a later date
bookingRef This is the airlines booking reference, this is the reference you should present to the customer
airline The airline the booking was made with
airline.airlineId The unique code for the airline
airline.name The full name of the airline

Errors

The Kyte API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The resource requested is hidden for administrators only.
404 Not Found -- The specified resource could not be found.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The resource requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're hitting this resource! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.