Best fares, easy and straightforward integration

Designed with for developers

Redirect

Introduction

The Redirect endpoint lets you redirect a customer to our websites. The business logic behind this is taken care of by our search engine. You will get information regarding which website will be used to book flight(s). It will also include a name, a URL and a URL pointing to the website's logo. This is useful because then you can dynamically display your partner's name, URL and logo as new routes and projects are added.

The customer will have a cookie set in his browser, allowing us to pay your commission for their bookings at the end of each month.

GET Request Parameters

  • https://faresapi.com/api/v1/redirect

In order to do that, you need to provide the following parameters. You may omit optional parameters

flightId Mandatory

A Flight ID from Search

returnFlightId Optional

A Flight ID from Search

affiliate Mandatory Your Affiliate ID.
residents[adults] Mandatory The number of adults flying, between 0 and 12. Any non-numeric value is ignored.
There should be at least one adult regardless of whether they are a resident or a non-resident.
residents[children] Optional The number of children flying, between 0 and 12. Any non-numeric value is ignored.
residents[infants] Optional The number of infants flying, between 0 and 12. Any non-numeric value is ignored.
nonResidents[adults] Mandatory The number of adults flying, between 0 and 12. Any non-numeric value is ignored.
There should be at least one adult regardless of whether they are a resident or a non-resident.
nonResidents[children] Optional The number of children flying, between 0 and 12. Any non-numeric value is ignored.
nonResidents[infants] Optional The number of infants flying, between 0 and 12. Any non-numeric value is ignored.
locale Optional The locale to redirect to. Default: en
Possible values are:
  • en - English
  • sw - Kiswahili
  • es - Spanish
  • vn - Việt
partnerClickId Optional Your Click ID or any reference you'd like to store. Click IDs will appear in the Sale Reports . This is a string field allowing up to 255 characters.

Please note that even if most fields are required, this redirect will work without them.

You can skip Residents or Non-Residents. If no passengers are provided, 1 Resident Adult is assumed.

If you fail to provide your correct Affiliate Code, you will not get a commission credited.

If you fail to provide a correct Flight ID, redirection will still work and the customer will be taken to our homepage.

Redirect

$params = array (
  'flightId' => 1,
  'returnFlightId' => 46,
  'affiliate' => 'YourAffiliateCode',
  'residents' => 
  array (
    'adults' => 1,
    'children' => 0,
    'infants' => 0,
  ),
  'nonResidents' => 
  array (
    'adults' => 1,
    'children' => 0,
    'infants' => 0,
  ),
);

$queryString = http_build_query($params);
var_dump($queryString);
// flightId=1&returnFlightId=46&affiliate=YourAffiliateCode&residents[adults]=1&residents[children]=0&residents[infants]=0&nonResidents[adults]=1&nonResidents[children]=0&nonResidents[infants]=0

$url = 'https://faresapi.com/api/v1/redirect?'.$queryString;
var_dump($url);
// https://faresapi.com/api/v1/redirect?flightId=1&returnFlightId=46&affiliate=YourAffiliateCode&residents[adults]=1&residents[children]=0&residents[infants]=0&nonResidents[adults]=1&nonResidents[children]=0&nonResidents[infants]=0;

// Redirect customer to $url or alternatively show an anchor on your website