Purchase
Quote & Save V2

Save and pay for a quote (V2)

Saves and pays for a policy. This endpoint calls the backend /v2/quote/saveAndPay endpoint. Note: if address information doesn`t given in the create quote flow endpoint, then its need to be given now in this endpoint

post/v2/purchase

Headers

Authorizationstring

Bearer token

Request body

policyCodeHashstring required

Policy code hash (quote hash)

Example request

{
  "address": {
    "country": "FR",
    "areaLevel1": "CA",
    "locality": "Paris",
    "label": "Paris, France",
    "streetAndNumber": "123 Main St",
    "city": "San Francisco",
    "apartment": "Apt 4B",
    "zipCode": "94102"
  },
  "policyCodeHash": "abc123def456"
}

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

Changed in 2 of the 3 revisions of this API.22

  • e016afb8fdb321See the full diff
    • removed the request property addons

      request-property-removed

    • removed the request property tripCost

      request-property-removed

    • added the new optional request property address

      new-optional-request-property

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional header request parameter Authorization

      new-optional-request-parameter