Purchases

Turning a usable quote into a policy.

GET/purchases

List purchases

The purchases this business has made, newest first.

lock

Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.

Responses

One page of purchases.

{
  "items": [],
  "pagination": null
}
boltTry it
env
GET/api/v1/purchases

Code samples

curl -X GET '/api/v1/purchases'
POST/purchases

Buy a quote

Turns a usable quote into a policy. Collect the premium yourself and describe the settled payment in payment; amountMinor must match the quote's total, or the request is 409 AMOUNT_MISMATCH. A quote that has expired or has already been bought is 409.

lock

Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.

Request body

application/json
{
  "providerId": null,
  "quoteId": "",
  "transactionId": "",
  "customer": null,
  "payment": null,
  "beneficiaries": [],
  "consents": [],
  "startDate": "",
  "context": null,
  "country": null,
  "currency": null,
  "channel": null
}

Responses

The purchase this Idempotency-Key already produced, replayed.

null
boltTry it
env
POST/api/v1/purchases

Request body

Code samples

curl -X POST '/api/v1/purchases' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "providerId": null,
  "quoteId": "",
  "transactionId": "",
  "customer": null,
  "payment": null,
  "beneficiaries": [],
  "consents": [],
  "startDate": "",
  "context": null,
  "country": null,
  "currency": null,
  "channel": null
}'
GET/purchases/{providerId}/{purchaseId}

Read one purchase

A purchase another business owns is the same 404 as one that does not exist.

lock

Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.

Parameters

purchaseIdpathstringrequireddefault: The insurer's purchase id.

Responses

The stored purchase.

null
boltTry it
env
GET/api/v1/purchases/{providerId}/{purchaseId}

Path parameters

purchaseId*

Code samples

curl -X GET '/api/v1/purchases/{providerId}/{purchaseId}'