Purchase Quote

Convert a quote into an active policy by providing customer and payment information.

This operation is idempotent with a 7-day TTL — use the X-Request-Id header for safe retries. If a duplicate request is detected, the original response is returned with X-Idempotent-Replayed: true.

Customer details are required unless they were already captured at quote creation time. If the quote already has customer data, you may omit the customer object entirely.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Purchase Flow

What This Endpoint Does

  1. Validates Quote: Ensures the quote is still valid and not expired
  2. Creates Policy: Generates a unique policy number and activates coverage
  3. Stores Customer Data: Securely saves customer information for claims
  4. Returns Policy: Provides complete policy details including payment breakdown

When to Use This Endpoint

Call this endpoint when:

  • Customer has selected their preferred coverage tier from the quote
  • Payment has been successfully processed in your system
  • You have collected all required customer information
  • Customer has agreed to the insurance terms

Important: Quote ID Selection

Use the quote_id from one of the pricing_options in your quote response, NOT the parent quote object.

1. Create quote → Receive response with pricing_options
2. Customer selects an option (e.g., "Full Coverage")
3. Extract that option's quote_id
4. Use that quote_id in: `POST /quotes/{quote_id}/purchase`

Request Parameters

ParameterRequiredDescription
customer.emailYesValid email for policy documents and claims
customer.firstNameYesMin 2 characters, used in policy contract
customer.lastNameYesMin 1 character, used in policy contract
customer.phoneNoInternational format recommended for claims support
payment.transactionIdYesYour payment processor's transaction ID
bookingReferenceNoYour internal booking/reservation reference
includeTemplateNoSet true to receive formatted policy confirmation

Understanding the Response

policy object contains:

FieldDescription
policy_idUUID for future operations (modify, cancel, retrieve)
policy_numberHuman-readable reference (e.g., "WIT-2025-00001")
statusPolicy state: active, cancelled, completed, expired
payout_methodHow payouts are delivered: cash or voucher
external_booking_idYour booking reference (if provided)

coverage object:

FieldDescription
start_date / end_dateCoverage period (inclusive)
coverage_amountMaximum total payout
daily_coverage_amountMaximum payout per day
location.weather_stationStation monitoring rainfall for this policy

protection object:

FieldDescription
trigger_typeWeather condition type (currently "rainfall")
trigger_valueMillimetres that triggers payout
payout_percentageSelected coverage level (50%, 75%, or 100%)

payment object:

FieldDescription
total_premiumAmount customer paid
base_premiumPremium before taxes
total_taxAll taxes combined
tax_breakdownIndividual tax components (GST, stamp duty, etc.)
voucher_discount_amountDiscount from voucher payout option (if applicable)
cc_surcharge_amountCredit card surcharge amount (if enabled)
cc_surcharge_rateSurcharge rate applied
cc_surcharge_enabledWhether CC surcharges are active for this partner

is_modification: Boolean indicating if this policy resulted from a modification.

Error Handling

ErrorCodeDescription
QUOTE_NOT_FOUND404Quote doesn't exist or was deleted
QUOTE_EXPIRED410Quote is older than 3 hours - create a new quote
QUOTE_ALREADY_CONVERTED409This quote has already been purchased
QUOTE_GROUP_ALREADY_CONVERTED409Another quote from this group was already purchased
QUOTE_PREMIUM_NOT_FOUND422Quote premium data not found
INVALID_QUOTE_OPTION422Specified quote option not found
NO_PAYOUT_OPTION422No payout option available for this quote
VALIDATION_ERROR400Missing or invalid request fields
QUOTE_NOT_ACTIVE422Quote is not in active status (may be rejected)

Idempotency

Include X-Request-Id header for safe retries:

  • System caches responses for 7 days (168 hours)
  • Retrying with same request-id returns original policy
  • Check X-Idempotent-Replayed: true header to detect cached responses
  • Only 2xx and 4xx responses are cached — 5xx errors are always retryable
  • The request body is hashed — sending a different body with the same key returns an error
  • Always use idempotency in production for network resilience

Best Practices

  1. Process payment first: Only call this endpoint after payment succeeds
  2. Always use idempotency: Include X-Request-Id on every purchase request
  3. Store policy_id: Required for future modify/cancel operations
  4. Include bookingReference: Essential for reconciliation
  5. Send confirmation: Email policy_number to customer immediately

Next Steps

After successful purchase:

  1. Send policy confirmation email with policy_number
  2. Store policy_id linked to your booking
  3. Use GET /policies/{id} to retrieve policy status
  4. Use POST /policies/{id}/modify if customer changes dates
  5. Use POST /policies/{id}/cancel if booking is cancelled
Path Params
uuid
required

UUID of the quote

Body Params

Customer details are required unless they were already captured at quote creation time.

customer
object

Customer details. At purchase time, email, firstName, and phone are required unless they were already captured at quote time. lastName is optional.

payment
object
required
string
required

External booking or order reference. Ties the policy to the booking.

boolean
Defaults to false

Include policy confirmation template in response

Headers
string

Idempotency key for safe retries. Send the same key and the same body when retrying. If a request with this key already completed within the TTL window (7 days for financial operations), the original response is returned with X-Idempotent-Replayed: true and nothing is re-executed. While the first request is still processing, a retry gets 409 CONFLICT_ERROR (details.reason = request_in_progress, Retry-After: 1). Reusing a key with a different body gets 422 VALIDATION_ERROR (details.reason = idempotency_key_reused). 5xx responses are not stored, so a retry after one executes again.

Responses

Language
Credentials
Bearer
API Key
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json