Finalise Purchase
Notify after payment
Once the customer successfully paid the price of their cart and insurance, you will have to notify us via a webhook. This way, we will know, that payment for the insurance was fulfilled and we can request an official policy from the insurance company. Please note that the request contains your secret key, therefore this should only be called from your backend!
This message should contain the previously returned quote identifier, the details of the customer and additional identification information of the trip in the following structure:
If the payment was unsuccessful you can either avoid this request or call it with paymentCaptured = false,
so we are able to log that the policy will not be finalised.
curl -X POST \
-d'secretKey=<secret key>' \
-d'paymentCaptured=<true or false, whether the payment was captured successfully>' \
-d'quoteId=<quote id>' \
-d'zip=<zip code>' \
-d'city=<city>' \
-d'address=<address>' \
-d'country=<country>' \
-d'email=<email>' \
-d'firstName=<first name>' \
-d'lastName=<last name>' \
-d'name=<if the buyer is a company>' \
-d'vat=<vat id if any>' \
https://api.travel.staging.vernsurance.com/finalize
const got = require('got');
got.post('https://api.travel.staging.vernsurance.com/finalize', {
json: {
secretKey: '<secret key>',
paymentCaptured: '<true or false, whether the payment was captured successfully>',
quoteId: '<quote id>',
zip: '<zip code>',
city: '<city>',
address: '<address>',
country: '<country>',
email: '<email>',
firstName: '<first name>',
lastName: '<last name>',
name: '<if the buyer is a company>',
vat: '<vat id if any>'
}
});
Where:
secretKey: secret key of the sales partnerpaymentCaptured: is indicating if the payment was successful. Iffalsethe policy will be not created.quoteId: the identifier of the quote returned after recommendationzip: zip code of the customercity: city of the customeraddress: address of the customercountry: country of the customeremail: email of the customerfirstName: firstName of the customerlastName: lastName of the customername: name of the company, when there is a billing persona provided (optional)vat: vat number of the company, when there is a billing persona provided (optional)
