Finalise Purchase
Notify after payment
Once the customer successfully paid the price of the tickets 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 tickets 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>' \
-d'tickets[0][price]=<price of the ticket>' \
-d'tickets[0][currency]=<currency, eg HUF>' \
-d'tickets[0][startTime]=<iso6801 date or datetime>' \
-d'tickets[0][endTime]=<iso6801 date or datetime>' \
-d'tickets[0][eventName]=<name of the event>' \
-d'tickets[0][eventId]=<id of the event>' \
-d'tickets[0][ticketId]=<barcode or id, that you use to identify the tickets>' \
https://api.ticket.staging.vernsurance.com/finalize
const got = require('got');
got.post('https://api.ticket.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>',
tickets: [{
price: '<price of the ticket>',
currency: '<currency, eg HUF>',
startTime: '<iso6801 date or datetime>',
endTime: '<iso6801 date or datetime>',
eventName: '<name of the event>',
eventId: '<id of the event>',
ticketId: '<barcode or id, that you use to identify the tickets>'
}]
}
});
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)tickets: list of tickets in a similar structure to the recommendation, but extended with a ticket identification string
