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.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Purchase Flow
What This Endpoint Does
- Validates Quote: Ensures the quote is still valid and not expired
- Creates Policy: Generates a unique policy number and activates coverage
- Stores Customer Data: Securely saves customer information for claims
- 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
| Parameter | Required | Description |
|---|---|---|
| customer.email | Yes | Valid email for policy documents and claims |
| customer.firstName | Yes | Min 2 characters, used in policy contract |
| customer.lastName | Yes | Min 1 character, used in policy contract |
| customer.phone | No | International format recommended for claims support |
| payment.transactionId | Yes | Your payment processor's transaction ID |
| bookingReference | No | Your internal booking/reservation reference |
| includeTemplate | No | Set true to receive formatted policy confirmation |
Understanding the Response
policy object contains:
| Field | Description |
|---|---|
| policy_id | UUID for future operations (modify, cancel, retrieve) |
| policy_number | Human-readable reference (e.g., "WIT-2025-00001") |
| status | Policy state: active, cancelled, completed, expired |
| payout_method | How payouts are delivered: cash or voucher |
| external_booking_id | Your booking reference (if provided) |
coverage object:
| Field | Description |
|---|---|
| start_date / end_date | Coverage period (inclusive) |
| coverage_amount | Maximum total payout |
| daily_coverage_amount | Maximum payout per day |
| location.weather_station | Station monitoring rainfall for this policy |
protection object:
| Field | Description |
|---|---|
| trigger_type | Weather condition type (currently "rainfall") |
| trigger_value | Millimetres that triggers payout |
| payout_percentage | Selected coverage level (50%, 75%, or 100%) |
payment object:
| Field | Description |
|---|---|
| total_premium | Amount customer paid |
| base_premium | Premium before taxes |
| total_tax | All taxes combined |
| tax_breakdown | Individual tax components (GST, stamp duty, etc.) |
| voucher_discount_amount | Discount from voucher payout option (if applicable) |
| cc_surcharge_amount | Credit card surcharge amount (if enabled) |
| cc_surcharge_rate | Surcharge rate applied |
| cc_surcharge_enabled | Whether CC surcharges are active for this partner |
is_modification: Boolean indicating if this policy resulted from a modification.
Error Handling
| Error | Code | Description |
|---|---|---|
| QUOTE_NOT_FOUND | 404 | Quote doesn't exist or was deleted |
| QUOTE_EXPIRED | 410 | Quote is older than 3 hours - create a new quote |
| QUOTE_ALREADY_CONVERTED | 409 | This quote has already been purchased |
| QUOTE_GROUP_ALREADY_CONVERTED | 409 | Another quote from this group was already purchased |
| QUOTE_PREMIUM_NOT_FOUND | 422 | Quote premium data not found |
| INVALID_QUOTE_OPTION | 422 | Specified quote option not found |
| NO_PAYOUT_OPTION | 422 | No payout option available for this quote |
| VALIDATION_ERROR | 400 | Missing or invalid request fields |
| QUOTE_NOT_ACTIVE | 422 | Quote 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: trueheader 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
- Process payment first: Only call this endpoint after payment succeeds
- Always use idempotency: Include X-Request-Id on every purchase request
- Store policy_id: Required for future modify/cancel operations
- Include bookingReference: Essential for reconciliation
- Send confirmation: Email policy_number to customer immediately
Next Steps
After successful purchase:
- Send policy confirmation email with policy_number
- Store policy_id linked to your booking
- Use
GET /policies/{id}to retrieve policy status - Use
POST /policies/{id}/modifyif customer changes dates - Use
POST /policies/{id}/cancelif booking is cancelled
