Purchase
Quote & Save V2

Save and pay for a quote (V2)

Saves and pays for a policy. If tripCost or addons are provided, the quote will be recalculated first. This endpoint calls the backend /v2/quote/saveAndPay endpoint.

post/v2/purchase

Headers

Authorizationstring

Bearer token

Request body

policyCodeHashstring required

Policy code hash (quote hash)

tripCostnumber

Optional trip cost for recalculation

Example request

{
  "policyCodeHash": "abc123def456",
  "tripCost": 7500,
  "addons": [
    {
      "isSelected": true,
      "dates": [
        {
          "startDate": "2023-05-18",
          "endDate": "2023-05-19",
          "noOfCars": 1
        }
      ],
      "initialDepositDate": "2024-06-01"
    }
  ]
}

Response

The purchase has been completed.

purchaseIdstring required

Policy ID of all travelers

totalPricenumber required

The price that was charged

paymentIntentstring

Payment intent token of the purchase

policyUrlstring

URL to download the policy

receiptUrlstring

URL to download the receipt

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