Best fares, easy and straightforward integration
Designed with for developers
Issue Tickets will take you through the whole process of creating reservations, making payments and ticketing the reservations at once. In a single API call.
As this is your most important call, please pay special attention and take special care of the errors that you may encounter. These happen now and then in the real world due to various reasons, very often third-party-related, and is of crucial importance to handle them with care.
POST
https://faresapi.com/api/v1/booking/ABCDEFG/issue
Where ABCDEFG is the Booking PNR returned by
Create Booking
.
Each PNR is an alphanumeric string with a length of exactly 7 characters total. Feel free to set your DB column to fixed length for better performance.
number | Mandatory |
Credit Card Number
Please note that American Express
is not supported for flights that will be booked at air-viva.com (Site ID 3)
|
holderName | Mandatory | Credit Card Holder names as they appear on the card |
expMonth | Mandatory | Expiry Month with leading zeros (01 through 12) |
expYear | Mandatory | Expiry Year last two digits only (24 for 2024) |
cvv | Mandatory | CVV |
{ "creditCard": { "number": 1234123412341234, "holderName": "test test", "expMonth": 11, "expYear": 22, "cvv": 123 } }
Upon successful booking, the response status will be 200 OK. This is the only response that means everything is alright.
In the response body you'll get exactly the same content as returned by Get Booking
Booking status is not "Waiting for Payment", nor failed, nor any of the aforementioned statuses where additional action is required or a flight was missing.
If you believe a booking is stuck, has failed, or is otherwise unexpectedly not allowing you to issue, please do not hesitate to contact us.
The error responses from this API call may be slightly different.
In general, the response will be the same as the usual Error Response
The difference will be in the form of additional data to aid you in building your app's logic.
You'll learn about the additional information provided with the error response below
Type ERROR_OFFER_PRICE_CHANGE
Offer price has changed. This happens most often when a resident fare has been selected for a non-resident passenger.
This may also happen if there have been several economy fares and the cheapest one that had been available at the time is no longer available.
Fares are being validated and re-calculated upon receiving passenger data.
Since this is a very special scenario, and abandoning the booking and creating a new one would require starting the process all over again and submitting all pax data, we've taken care of making accepting the new price effortless.
You'll be able to accept the new price and proceed with issuing. You have to add the acceptProposedOffer boolean with value true to your POSTed JSON we will proceed with issuing the tickets.
Type ERROR_OFFER_FLIGHT_MISSING
A flight is no longer available. This will happen either when a flight gets fully booked or when passengers were attempted to be booked as residents, but were actually not and the flight had no non-resident fares to revert to proposing a new price.
At this point, you should query all flights on the route again and possibly offer the customer to select another one.
On your first call, you will also get the Flight ID of the flight that caused the issue.
Type ERROR_BOOKING_FAILED
Booking has failed. Please contact us for additional information about each individual booking.
At this point, no additional information is exposed via the API. In the future, we will definitely add common causes of failure.
The nature of the failure will most likely be related to third-party providers declining payments. We are constantly working towards improving this.
Type ERROR_BOOKING_IN_PROGRESS
Tickets are currently being issued. Our API will not allow you to call issue more than once.
If you believe a booking is stuck or has failed, please do not hesitate to contact us.
Type ERROR_BOOKING_NOT_WAITING_FOR_PAYMENT
This is a safeguard to prevent calling this API method several times.
Booking status is not "Waiting for Payment", nor failed, nor any of the aforementioned statuses where additional action is required or a flight was missing.
If you believe a booking is stuck, has failed, or is otherwise unexpectedly not allowing you to issue, please do not hesitate to contact us.