Purchase coverage
Changed onPurchase a policy with Faye. Call this endpoint after a quote is generated. Please provide the expected price to validate the amount to be charged.
Payment token must be provided in the request body.
Request
- Base URLhttps://partnerapi.withfaye.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Bearer token
Request body
Example request
{
"advisorId": "123456",
"departureDate": "2023-05-18",
"returnDate": "2023-05-30",
"destination": [
{
"country": "US",
"googlePlaceId": "ChIJYYOWXuckZUcRZdTiJR5FQOc",
"state": "CA"
}
],
"coverageOptions": {
"cfarOption": {
"initialDepositDate": "2023-05-18"
},
"cfwrOption": {
"initialDepositDate": "2023-05-18"
},
"carRentalOption": {
"carDatesDto": [
{
"startDate": "2023-05-18",
"endDate": "2023-05-19",
"noOfCars": 1
}
],
"noOfCars": 2
}
},
"productId": "PR-STANDARD-01",
"productIds": [
"PR-STANDARD-01",
"PR-SPORTS-01"
],
"timezone": "America/New_York",
"address": {
"addressLine1": "123 Main St",
"addressLine2": "Apt 1",
"city": "San Francisco",
"state": "CA",
"zip": "94105",
"country": "US"
},
"primaryEmail": "bob@example.com",
"travelerDetails": [
{
"firstName": "Jane",
"lastName": "Doe",
"email": "jane.doe@gmail.com",
"dob": "1980-11-25"
}
],
"paymentToken": "tok_1H4qXp2eZvKYlo2CgqjQ1J4Y",
"paymentIntent": "pi_3MtweELkdIwHu7ix0Dt0gF2H",
"paymentMethod": "pm_3MtweELkdIwHu7ix0Dt0gF2H",
"paymentCustomerId": "cus_3MtweELkdIwHu7ix0Dt0gF2H",
"paymentService": "stripe",
"expectedPrice": 375.35,
"externalId": "Aa123",
"noTravellers": 2,
"utms": [
{
"key": "utm_source",
"value": "google"
}
]
}Response
The purchase has been completed.
Example response
{
"purchaseId": "P23-1234",
"plans": [
{
"name": "Bob Smith",
"planId": "P23-1234-1"
}
],
"totalPrice": 100.24,
"paymentIntent": "pi_3MtweELkdIwHu7ix0Dt0gF2H",
"policyUrl": "https://example.com/policy.pdf",
"receiptUrl": "https://example.com/receipt.pdf"
}Changes
- breaking
added to the
/////request propertyallOflist - breaking
the
request property type changed fromdatetostring, and format from no format todate - breaking
the
/request property type changed fromarraytostring - breaking
the
request property type changed fromdatetostring, and format from no format todate - breaking
the
//request property type changed fromdatetostring, and format from no format todate - warning
removed from the
/////request propertyallOflist - info
added the new optional request property
///// - info
added the new optional request property
/////
- breaking
- breaking
the
request property type changed fromstringtodate, and format fromdateto no format - breaking
the
/request property type changed fromstringtoarray - breaking
the
request property type changed fromstringtodate, and format fromdateto no format - breaking
the
//request property type changed fromstringtodate, and format fromdateto no format - info
added the new optional
headerrequest parameterAuthorization
- breaking