Insurance

Using this API

Use the Insurance Rest API to research, verify cancellation policies and book insurance for your travels with different providers around the world.

The Insurance Rest API has the following methods to be consumed, in this order:

  • Search: Used to define where the passenger is going to travel, the service start date, the number of days and the ages of the passengers.

  • GetCancellationPolicies: Used to check which are the Cancellation Policies for the chosen insurance.

  • DoBooking: Used to confirm a reservation and send passenger information. Read more about possible status here.

  • Cancel: Used to cancel a Insurance reservation.

  • GetServiceDetails: Serves to view the details of your reservation.

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.

Insurance API endpoint

Each method will have its own instance in the Cangooroo Booking Engine and, with that, each one will have its own endpoint. The end points of the air services will be:

  • {{URL}}/ws/Rest/Insurance.svc/Search

  • {{URL}}/ws/Rest/Insurance.svc/GetCancellationPolicies

  • {{URL}}/ws/Rest/Insurance.svc/DoBooking

  • {{URL}}/ws/Rest/Insurance.svc/Cancel

  • {{URL}}/ws/Rest/Insurance.svc/GetServiceDetails

*Note the BOLD words in the example above, since they vary depending on the method you will be using.

Search

This is where everything begins. The Search Request is where you will pass your credentials, define where you are traveling, the date of service, the number of days and ages of the passengers.

To see all the properties contained in the Search and Answer Request, refer to this reference page.

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":{

"CityId": 1009709,

"DateService": "2019-07-28",

"NumberOfDays": 3,

"PassengersAge": [25, 20]

}

}

Credential

The credentials tag 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 field will be used for your search specifications, where you will be informed of the city ID where the passengers are going to travel, the date of travel, the number of days and the ages of the passengers.

Search Response

The search response is separated between the response information, the token, and the insurance found; Below you can see what each of these objects represents.

Token

The Token field is extremely important, as explained on our Services page. You will need this token to confirm the reservation of choosen tour and this information should be transported with each subsequent request.

A Token will always be unique and the combination of Token + Credentials + expiration ensures that we will never have matching results stored on our servers.

The TotalToursResults field provides information on the total number of results found, lastly the number of results in this single response.

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.

Insurances

In the search will be returned the list of Insurance with its specifications, each insurance has a list of items that will be insured (Coverages) next to the amount charged for each item insured.

GetCancellationPolicies

The GetPaymentPolicies is the method you should call after receiving the Search Response and after you've selected the Insurance you wish to book. This is a mandatory step for our booking process, which means that you will must make this call before attempting to confirm your booking.

It is important to be aware that many Suppliers work with cached information to decrease response time when responding to availability requests. Therefore, some values may change from the Search Availability Response for 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 properties contained in the GetCancellationPolicies Request and Response, please refer to this reference page.

GetPaymentPolicies Request

The GetPaymentPolicies Request is straightforward and simple and below you will find an example along with the Frequently Asked Questions we have about it.

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"Criteria":{

"CityId": 1009709,

"DateService": "2019-07-28",

"NumberOfDays": 3,

"PassengersAge": [25, 20]

}

}

Credential

The credentials tag is the same as required on the SearchAvailability Request with a UserName and a Password as shown below:

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

The UserName field 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.

Token

As stated before, the Token you received on the SearchAvailability Response is extremely important because it is this information that binds the booking process together. To learn more about the Token, you can check our Services page.

InsuranceIds

Here the insurance IDS chosen by the user will be informed, this field receives a list of strings that correspond to the insurance Ids that the user chose.

GetCancellationPolices Response

In the response, the insurance information, the cancellation period and the rate charged for the updated service will be shown.

DoBooking

The DoBooking method is used to make the reservation of the Insurance that was chosen in the Search Request and dealt with in the GetCancellationPolices method, this is another simple but very important step, since for each passenger informed here a separate insurance service will be reserved.

To see all properties contained in the DoBooking Request and Response, please refer to this reference page.

DoBooking Request

The request of DoBooking is already a little more complex, in addition to informing the chosen Insurance ID, the passenger data will also be informed, where for each informed passenger will be reserved an insurance service for him where the main passenger of the insurance.

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"Token": "d09c4456-02cb-4a43-87e5-1e696ab6965f",

"InsuranceId": "100",

"Passengers":[{

"Name": "Teste",

"Surname": "NoBook",

"Age": 25,

"Cpf": "011.400.289-22",

"Title": "Mr",

"MainPax": true,

"isChild": false

}]

}

Credential

The credentials tag is the same as required on the SearchAvailability and GetCancellationPolicies Request with a UserName and a Password.

Token

The token that was generated in the survey and handled in the GetCancellationPolicies will be used for the last time to close the Tour reservation.

"Token": "d09c4456-02cb-4a43-87e5-1e696ab6965f",

InsuranceId

The insurance Id chosen in the search request and dealt with in the GetCancellationPolices method.

"InsuranceId": "100",

Passengers

Here the user will inform the passenger data, among these data will be the name, surname, age, CPF and a Boolean variable to identify if the passenger is child or not, remembering that it is obligatory 1 main passenger.

"Passengers":[{

"Name": "Teste",

"Surname": "NoBook",

"Age": 25,

"Cpf": "011.400.289-22",

"Title": "Mr",

"MainPax": true,

"isChild": false

}]

DoBooking Response

Here, the user can see the result of his request, together with the other information of his reservation, it is worth paying attention in the fields ServiceId (reserve code) and Reservation Status, since these fields will be important for the following methods .

Cancel

This method is very simple, in which the user must 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 the Cancel Request and Response, please refer to this reference page.

Cancel Request

The request is very simple, in it the user will only inform his credentials next to the id of the reservation made in the previous method.

{

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

"ServiceId": 1466

}

Credential

The credentials tag is the same as required on the Search request, GetCancellationPolicies and DoBooking Request with a UserName and a Password as shown below:

"Credential": {

"Username": "Your_Username",

"Password": "Your_Password"

},

After you enter the credentials of the user, the ServiceId of a reservation that was made with the credentials informed must be passed.

Cancel Response

In the cancellation response, the user will be able to see all the details of their canceled reservation.