Flight
Using this endpoint
Use flight endpoint to search, verify conditions, and book air travel with over 100 different vendors around the world.
The Air endpoint has the following methods to be consumed, in this order:
Search: used to define the type of flight you want, which places you will be traveling to, and the number of passengers and the age of the passengers that will travel with you.
SearchNextSegment: This method complementary to the search should be used when the search criteria are for round tryp or multi stretches. It will return the information of the return flights and other stretches
getBookingConditions: used to check which are the booking conditions for the chosen flights.
DoBooking: used to confirm a booking, send passenger's and payment informations. Read more about the possible status here.
cancelByService: Use this method to cancel a specific service in a file (reservation).
cancelAllFlightServices: Use this method to cancel all flights services in a file (reservation). Please be aware that only flight services will be cancelled using this method.
The API works with Json in its requests and responses, so text parameters can be identified by enclosing double quotation marks ("example"), numbers and boolean parameters can be sent normally.
Below you will find more information on the most important rules, possibilities, points of attention and properties to use for each method.
Flight endpoint
Search
This is where everything begins. The Search Request is where you will pass your credentials, define where you want to travel, whether you are traveling round-trip, multi stretches or one-way, the class you wish to fly, whether you want flights with baggage included and of course, the day you want to travel.
Search Request
The Search Request is pretty simple, below you will find the most common usage of this method as well as some examples for the most Frequently Asked Questions we have.
{
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
"Criteria":{
"DepartureDate": "2020-01-20",
"ReturnDate": "2020-01-26",
"IataOriginAirport": "GRU",
"IataDestinationAirport": "GIG",
"NumberOfAdults": 1,
"ChildrenAge": [7],
"NationalityPax": "BR",
"SearchType": "RoundTrip",
"ClassFlight": "All",
"Luggage": "Both"
}
}
Credential
The credentials field is fairly simple and only has the UserName and the Password as shown below:
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
The UserName space is where you're supposed to put in the UserName given you by the Operator. While the Password is where you're supposed to insert the Password given you by the Operator.
Criteria
The Criteria section is where you define the type of flight you are looking for and you will find the explanation for all the most important sections and properties.
DepartureDate and ReturnDate
Here you enter the departure dates and return (ReturnDate) of your flight, if you choose a oneway trip the ReturnDate field can be excluded from your request.
"DepartureDate": "2020-01-20",
"ReturnDate": "2020-01-26",
OriginCity and DestinationCity
Here you will enter the airport code of origin and destination of the trip, the standard of sending 3 letters.
"IataOriginAirport": "GRU",
"IataDestinationAirport": "GIG",
Flight Preferences
Here you will inform the type of flight you want to book, whether it is a one way trip or the return trip, the desired class and if you want a flight with baggage included.
Luggage
The Luggage field is where you must send us if the flights surveyed will have luggage included, without luggage or both.
Both
Included
NotIncluded
ClassFlight
The ClassFlight field is where you must send us the class of the flights surveyed, which can be:
All
Economic
EconomicPremium
Business
FirstClass
SearchType
The SearchType field is where you must send us which search will be carried out:
RoundTrip
OneWay
MultiStretches
Passengers information
Here is where you will be informed of the number of passengers that will be flying with your nationality, the first parameter to be passed is the number of adults, followed by the number of children next to their ages, the children's refueling fields are optional, if the passengers choose not to travel with children, the fields should be excluded.
Finally, we will have the field of nationality, where the nationality of the main passenger will be passed.
"NumberOfAdults": 1,
"ChildrenAge": [7],
"NationalityPax": "BR",
To see all the properties contained in the Search Request, please see our reference page.
Search Response
After completing the requested fields, a list of flights will be returned based on these information, below we will explain each of these fields.
When your search provides larger sets of results, those that affect the performance of your application and on those occasions, you will have to work with filters and paging our results.
Flights
The search return is composed of a segment set that presents the price, origin and destination information and the flight ids that are linked.
Segments:
"Segments": [
{
"AdultPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 541.89
},
"TotalPrice": {
"Currency": "BRL",
"Value": 11084.93
}
},
"ArrivalTime": "13:14",
"BoardingTime": "01:24",
"ChildPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 541.89
},
"TotalPrice": {
"Currency": "BRL",
"Value": 19549.88
}
},
"Commission": {
"Currency": "BRL",
"Value": 1054.31
},
"DestinationAirport": {
"CityName": "Miami (e arredores), Flórida, Estados Unidos da América",
"Iata": "MIA",
"Name": "Miami, FL, United States (MIA/KMIA Miami Intl.)"
},
"DestinationAirportCode": "MIA",
"EnumMarkupType": 1,
"FlightIds": [
"GRUNYCACOL12217",
"NYCSXFACOL71099",
"SXFMIAACOL30553"
],
"FullBoardingDate": "Thu 12 Nov 2020",
"InfantPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 541.89
},
"TotalPrice": {
"Currency": "BRL",
"Value": 11200.67
}
},
"IsOperatorFare": true,
"NumberOfAdults": 1,
"OriginAirport": {
"CityName": "São Paulo (e arredores), Brasil",
"Iata": "GRU",
"Name": "Sao Paulo, Brazil (GRU/SBGR Governor Andre Franco Montoro Intl.)"
},
"OriginAirportCode": "GRU",
"QttStops": 2,
"ResponseId": "jbdqlAoRdmN5kP4FC25zb5qI+4jNZCSRinJXv6+ygrSoD3kU6+pZZOea4gFyVFmFCfPz5Dh4d2yAc6kdGHp+dX2m+PncGn8iLeSlGhBQj3UQsGtQreJNXIctFZ8m4FJlVHDn9GOaCO0WrXDzYMkwZxWvFL9HUFYkIFzJy2uHaFNY6b4Ii/L2Sr305ssUTpkNpEffZZVsLxfNosfe3ibQJfc738n54GjKuKFNiXZuIBM=",
"SearchType": 1,
"SegmentNumber": 1,
"TitleSegment": "Ida",
"TotalDepartureTax": {
"Currency": "BRL",
"Value": 541.89
},
"TotalHours": "11h 50m",
"TotalPrice": {
"Currency": "BRL",
"Value": 11084.93
},
"TurgwId": "GRUMIAGRUNYCACOL12217#NYCSXFACOL71099#SXFMIAACOL30553|00#00#00"
},
With the information of the flight ID linked in the chosen segment, it is possible to obtain detailed flight information in the flight set.
Flights:
"Flights": [
{
"AircraftDetails": {
"IATA": "ERD",
"Name": "ERD EMBRAER RJ140 JET,44 STD SEATS"
},
"Airline": {
"Code": "IB",
"Name": "IBERIA",
"ThumbURL": "http://i.t4w.mobi/ai/IB.png"
},
"ArrivalTime": "12/20/2020 9:01:00 AM",
"DepartureTime": "12/20/2020 5:16:00 AM",
"DestinationAirport": {
"CityName": "São Paulo (e arredores), Brasil",
"Iata": "GRU",
"Name": "Sao Paulo, Brazil (GRU/SBGR Governor Andre Franco Montoro Intl.)"
},
"DestinationAirportCode": "GRU",
"FlightNumber": "JC66149",
"FullArrivalDate": "Sun 20 Dec 2020",
"FullBoardingDate": "Sun 20 Dec 2020",
"ID": "MIAGRUIBJC66149",
"MarketingClass": "Primeira Classe",
"OperatorAirline": {
"Code": "IB",
"Name": "IBERIA",
"ThumbURL": "http://i.t4w.mobi/ai/IB.png"
},
"OriginAirport": {
"CityName": "Miami (e arredores), Flórida, Estados Unidos da América",
"Iata": "MIA",
"Name": "Miami, FL, United States (MIA/KMIA Miami Intl.)"
},
"OriginAirportCode": "MIA",
"TotalHours": "3h 45m"
},
If your search was made for a round trip or multi stretches, to obtain the result of the return flights it is necessary to use the SearchNextSegment method.
SearchNextSegment
SearchNextSegment request
SearchNextSegment is the method you should call if your search is made for a trip with multiple stretches or round trip.
In the criteria, the responseId of the segment chosen in the search must be informed so that it is possible to obtain the information of the next segments.
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
"ResponseId": ""
SearchNextSegment response
The response have the segment selected in the search and the segment corresponding to the return or stretches.
In the set of flights, we have the flights corresponding to all streches or the round trip.
Segments:
"Segments": [
{
"AdultPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 547.15
},
"TotalPrice": {
"Currency": "BRL",
"Value": 24105.91
}
},
"ArrivalTime": "06:39",
"BoardingTime": "05:21",
"ChildPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 547.15
},
"TotalPrice": {
"Currency": "BRL",
"Value": 20018.11
}
},
"Commission": {
"Currency": "BRL",
"Value": 2355.88
},
"DestinationAirport": {
"CityName": "Miami (e arredores), Flórida, Estados Unidos da América",
"Iata": "MIA",
"Name": "Miami, FL, United States (MIA/KMIA Miami Intl.)"
},
"DestinationAirportCode": "MIA",
"EnumMarkupType": 1,
"FlightIds": [
"GRUMIATXEK28356"
],
"FullBoardingDate": "Thu 12 Nov 2020",
"InfantPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 547.15
},
"TotalPrice": {
"Currency": "BRL",
"Value": 6592.04
}
},
"NumberOfAdults": 1,
"OriginAirport": {
"CityName": "São Paulo (e arredores), Brasil",
"Iata": "GRU",
"Name": "Sao Paulo, Brazil (GRU/SBGR Governor Andre Franco Montoro Intl.)"
},
"OriginAirportCode": "GRU",
"RelatedSegments": [],
"ResponseId": "jbdqlAoRdmN5kP4FC25zb/ktjXytlmczKDWBjFDoetwzeeT+x56JwCsvibOkOKOOj5X4j95a8ouBUG9zLyZF7dHla2lCQHwrL1IsJjXkJziaRihi7GtyHOWaGSDSWeFO6lV/AidS207D+9KVb+7T7VpkvdiR6JHL5618uiViy42JnEANA8d7Rg==",
"SearchType": 1,
"SegmentNumber": 1,
"TitleSegment": "Ida",
"TotalDepartureTax": {
"Currency": "BRL",
"Value": 547.15
},
"TotalHours": "1h 18m",
"TotalPrice": {
"Currency": "BRL",
"Value": 24105.91
}
},
{
"AdultPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 1025.9
},
"TotalPrice": {
"Currency": "BRL",
"Value": 11537.38
}
},
"ArrivalTime": "07:06",
"BoardingTime": "04:53",
"ChildPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 1025.9
},
"TotalPrice": {
"Currency": "BRL",
"Value": 18613.42
}
},
"Commission": {
"Currency": "BRL",
"Value": 1051.15
},
"DestinationAirport": {
"CityName": "São Paulo (e arredores), Brasil",
"Iata": "GRU",
"Name": "Sao Paulo, Brazil (GRU/SBGR Governor Andre Franco Montoro Intl.)"
},
"DestinationAirportCode": "GRU",
"EnumMarkupType": 1,
"FlightIds": [
"MIAGRUKXEK91694"
],
"FullBoardingDate": "Mon 30 Nov 2020",
"InfantPricingInformation": {
"SaleDepartureTax": {
"Currency": "BRL",
"Value": 1025.9
},
"TotalPrice": {
"Currency": "BRL",
"Value": 15756.7
}
},
"IsOperatorFare": true,
"NumberOfAdults": 1,
"OriginAirport": {
"CityName": "Miami (e arredores), Flórida, Estados Unidos da América",
"Iata": "MIA",
"Name": "Miami, FL, United States (MIA/KMIA Miami Intl.)"
},
"OriginAirportCode": "MIA",
"RelatedSegments": [
"GRUMIAGRUMIATXEK28356|00"
],
"ResponseId": "rkjiMbc31Db0HzYLLkMo6yMUVyxMCL2GhrbUIBpS44QEWkTA7HdHY0UDO24HGgbn/d1iUt3HW4zdqnNYH+HCRFSd3hQYuwM67PviOIlBUIah5bYJXPRHCz+M49G99u2XmOYLBNGt9igccKz7M4NIG8O/TTuepu3cA1qQauwvxOyIfoZXTdERxQ==",
"SearchType": 1,
"SegmentNumber": 2,
"TitleSegment": "Volta",
"TotalDepartureTax": {
"Currency": "BRL",
"Value": 1025.9
},
"TotalHours": "2h 13m",
"TotalPrice": {
"Currency": "BRL",
"Value": 11537.38
}
}
]
Flights:
"Flights": [
{
"Airline": {
"Code": "KX",
"Name": "Cayman Airways",
"ThumbURL": "http://i.t4w.mobi/ai/KX.png"
},
"ArrivalTime": "11/30/2020 7:06:00 AM",
"DepartureTime": "11/30/2020 4:53:00 AM",
"DestinationAirport": {
"CityName": "São Paulo (e arredores), Brasil",
"Iata": "GRU",
"Name": "Sao Paulo, Brazil (GRU/SBGR Governor Andre Franco Montoro Intl.)"
},
"DestinationAirportCode": "GRU",
"FlightNumber": "EK91694",
"FullArrivalDate": "Mon 30 Nov 2020",
"FullBoardingDate": "Mon 30 Nov 2020",
"ID": "MIAGRUKXEK91694",
"MarketingClass": "Executiva",
"OperatorAirline": {
"Code": "KX",
"Name": "Cayman Airways",
"ThumbURL": "http://i.t4w.mobi/ai/KX.png"
},
"OriginAirport": {
"CityName": "Miami (e arredores), Flórida, Estados Unidos da América",
"Iata": "MIA",
"Name": "Miami, FL, United States (MIA/KMIA Miami Intl.)"
},
"OriginAirportCode": "MIA",
"TotalHours": "2h 13m"
},
{
"AircraftDetails": {
"IATA": "739",
"Name": "739 BOEING 737-900 JET,189 STD SEATS"
},
"Airline": {
"Code": "TX",
"Name": "Air Caraibes",
"ThumbURL": "http://i.t4w.mobi/ai/TX.png"
},
"ArrivalTime": "11/12/2020 6:39:00 AM",
"DepartureTime": "11/12/2020 5:21:00 AM",
"DestinationAirport": {
"CityName": "Miami (e arredores), Flórida, Estados Unidos da América",
"Iata": "MIA",
"Name": "Miami, FL, United States (MIA/KMIA Miami Intl.)"
},
"DestinationAirportCode": "MIA",
"FlightNumber": "EK28356",
"FullArrivalDate": "Thu 12 Nov 2020",
"FullBoardingDate": "Thu 12 Nov 2020",
"ID": "GRUMIATXEK28356",
"MarketingClass": "Executiva",
"OperatorAirline": {
"Code": "TX",
"Name": "Air Caraibes",
"ThumbURL": "http://i.t4w.mobi/ai/TX.png"
},
"OriginAirport": {
"CityName": "São Paulo (e arredores), Brasil",
"Iata": "GRU",
"Name": "Sao Paulo, Brazil (GRU/SBGR Governor Andre Franco Montoro Intl.)"
},
"OriginAirportCode": "GRU",
"TotalHours": "1h 18m"
}
],
GetBookingConditions
GetBookingConditions is the method to which you should call as soon as you receive the search or searchNextSegment response, and then select the flight service you want to reserve. This is a mandatory step for our booking process, which means you must make this call before attempting to confirm your reservation.
It is important to be aware that many vendors work with cached information to decrease response time when responding to requests. Therefore, some values can be changed from Search Response to Payment Policy Response, such as price, rate information, and other properties. That is why it is important to compare, verify and update your information and properly notify the user in case of changes.
To see all the properties contained in the Cancellation Policy Request, please see our reference page.
GetBookingConditions request
The GetBookingConditions Request is pretty direct and simple and below you will find the most Frequently Asked Questions we have about it.
{
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
"ResponsesIds":[]
}
Credentials
The credentials field is the same as required on the Search with a UserName and a Password as shown below:
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
ResponsesIds
To consult information about the flights chosen in the previous steps, the responsesIds of the chosen segments must be informed.
"ResponsesIds":["jbdqlAoRdmN5kP4FC25zbx42KYNksZ3yymUhNy35xmC8VHA9hqyyzD3qZXhcw24wm8UOUtclU8p4bb8GmUk+qMg6rynJKx11sAHHU3RsR1yyEFUHC2VKavhTOhcXKjlBAjIzqbR7CKIKlzYMjmm0OrT36FZDDjfOMo2oqTVCtT9/nRJVUsN0rngfR2LDdxptTm2S/4jXqDyj4NxN2vcgKg==", "rkjiMbc31Db0HzYLLkMo65RBB2WK+yTNICaXkZJzErAAb3Sv65gbOJZ/Zp4yRFgIVbjFwkFHIpFgSzyjP1qe7IsAsiWZpQ1P0aIUZheXXR1bsCios92wZKefqUn3g3P5YUSSqSw2V6dk3N1CiYMJBNsVxuJ2lCsSzpLv2pYTI5WVlGqHLyCghUcm1gWXyb1K4fBaK2kxkcCghhJ+lcpgkA=="]
GetBookingConditions response
In response, in addition to displaying the chosen flights service information with the updated data, cancellation policies will also be returned.
CancelationPolicies
In addition to the information updated by the supplier, the user will also see the description of the service updated by the supplier.
"CancelationPolicies": "Após a emissão, consulte a Operadora."
PaymentConditions
If available, the payment terms of the service, along with the accepted cards and minimum value of each installment can also be seen.
[
{
"CreditCard": {
"MinimumParcelValue": {
"Currency": "BRL",
"Value": 15
},
"NumberPaymentAmex": 6,
"NumberPaymentDiners": 6,
"NumberPaymentElo": 6,
"NumberPaymentMaster": 6,
"NumberPaymentVisa": 6
},
"Name": "Parcelamento direto na Gol sem Juros"
}
]
doBooking
The DoBooking method is used to confirm the reservation of the flight that was chosen in the survey and dealt with in the GetCancellationPolices, this is another simple but very important step, as it will inform the main passenger and the escorts (if any).
To see all the properties contained in the doBooking Request and Response, please see our reference page.
doBooking Request
The DoBooking request is already a bit more complex, in addition to informing the IDs of the outbound flights and (if it has) return, the passenger must inform the main passenger (The first informed passenger is considered the principal).
Credentials
The credentials tag is the same as required on the Search Request with a UserName and a Password as shown below:
{
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
ResponsesIds
To reserve the chosen segments, the response ids must be informed:
"ResponsesIds":["jbdqlAoRdmN5kP4FC25zbx42KYNksZ3yymUhNy35xmC8VHA9hqyyzD3qZXhcw24wm8UOUtclU8p4bb8GmUk+qMg6rynJKx11sAHHU3RsR1yyEFUHC2VKavhTOhcXKjlBAjIzqbR7CKIKlzYMjmm0OrT36FZDDjfOMo2oqTVCtT9/nRJVUsN0rngfR2LDdxptTm2S/4jXqDyj4NxN2vcgKg==", "rkjiMbc31Db0HzYLLkMo65RBB2WK+yTNICaXkZJzErAAb3Sv65gbOJZ/Zp4yRFgIVbjFwkFHIpFgSzyjP1qe7IsAsiWZpQ1P0aIUZheXXR1bsCios92wZKefqUn3g3P5YUSSqSw2V6dk3N1CiYMJBNsVxuJ2lCsSzpLv2pYTI5WVlGqHLyCghUcm1gWXyb1K4fBaK2kxkcCghhJ+lcpgkA=="]
Passengers
Here you will be informed the data of each of the passengers in list format, where each passenger must inform their name, surname, CPF among others, this is a very important step since the first passenger to be informed here will be considered the main passenger.
"Passengers": [{
"Name": "test",
"Surname": "NoBook",
"Age": 25,
"Cpf": "011.400.289-22",
"Title": "Mr",
"MainPax": true,
"isChild": false,
"Address": "Rua do Rocio",
"City": "São Paulo",
"ZipCode": "04552000",
"State": "São Paulo",
"AddressNumber": "123",
"Email": "emailtest@t4w.com.br",
"PhoneDDD": "11",
"PhoneDDI": "55",
"PhoneNumber": "40028922"
}]
Payment
This field refers to the payment data of the user, if the user chooses to make the payment, or if the agency is anticipated and the reservation is in penalty, cangooroo will make the payment.
"Payment":{
"CreditCard": {
"Holder": "Nikolas K",
"CardNumber": "4111111111111111",
"SecurityCode": "123",
"YearExpiration": 2020,
"MonthExpiration": 12,
"Installments": 3,
"CardOperator": "VISA"
}
}
SetWaitingPayment
When you send SetWaitingPayment as true, your reservation will be created with the status awaiting payment. The reservation will be available for confirmation until the token expires and if it is not paid, it will be rejected. When paying within the period, the reservation will be sent to the supplier for confirmation.
To see all the properties contained in the Booking Request, please see our reference page.
doBooking Response
Here you can see the result of your request, along with other information on your booking, such as the number of flights (both the outbound and the return flights), reservation Id, flight dates, it is worth noting the ServiceId fields that shows the reserved service id and the Status field that shows the status of your reservation in the system.
CancelByService
This method is very simple, where the client will inform, in addition to the credentials of the client, the ServiceId of his reservation made in the previous method.
To see all properties contained in Cancel request and response, see our reference page.
CancelByService Request
This is a simple method, because with it the customer can cancel their reservations made in the system, being necessary only the service id that is generated in the booking process.
{
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
"ServiceId": 379
}
Credential
The credentials tag is the same as required on the Search, cancellationPolicies and DoBooking Request with a UserName and a Password as shown below:
{
"Credential": {
"Username": "Your_Username",
"Password": "Your_Password"
},
ServiceId
After you enter the credentials of the user, the ServiceId of a reservation that was made with the credentials informed must be passed.
"ServiceId": 379
CancelByService Response
In the answer of this method the customer can see the status of his reservation and verify that it has been successfully canceled, it is worth noting that if a reservation is canceled after its cancellation policies take effect, the customer may pay a fine for the service.
CancelAllFlightServices
Use this method to cancel all flights services in a file (reservation). Please be aware that only flight services will be cancelled using this method.
CancelAllFlightServices Request
After you enter the credentials of the user, the bookingId of a reservation that was made with the credentials informed must be passed.
{
"Credential": {
"Username": "cangooroov3",
"Password": "cangooroo@123"
},
"BookingId": 379
}
CancelAllFlightServices Response
In the answer of this method the customer can see the status of his reservation and verify that it has been successfully canceled, it is worth noting that if a reservation is canceled after its cancellation policies take effect, the customer may pay a fine for the service.
URL and Examples
SOAP
http://ws-[clientIdentification].cangooroo.net/API/SOAP/Flight.svc
REST
REST: http://ws-[clientIdentification].cangooroo.net/API/REST/Flight.svc
Postman example here: https://documenter.getpostman.com/view/11200591/SzfAymKV?version=latest#eaf2700c-69f6-4d7e-b628-7212bccc8405