Price a quote
A quote is the insurer's firm price for your customer's answers. Your customer can buy it until it expires.
1. Request the quotelink
curl -X POST https://insure-api.netapps.ng/api/v1/quotes \
-H "x-api-key: $INSURETECH_API_KEY" \
-H "Idempotency-Key: 3f0e6a52-8c1b-4d7e-9a41-2b6c5d8e7f90" \
-H "X-Request-Id: order_10293" \
-H "Content-Type: application/json" \
-d '{
"providerId": "66f1c2a9e4b0d3a1c8e7f512",
"productId": "prod_motor_comprehensive_v3",
"formId": "form_motor_quote",
"formVersion": 1,
"formData": {
"vehicle": {
"make": "TOYOTA",
"age": 4,
"sumInsured": { "amountMinor": 600000000, "currency": "NGN" }
}
},
"channel": "web"
}'Add configuration when your customer chose a variant or add-ons from the product's config.
2. Show the pricelink
| Field | What to do with it |
|---|---|
quote.quoteId | Keep it. You buy the quote with it. |
quote.totalMinor, quote.currency | The full price. 4037500 NGN is ₦40,375.00. |
quote.expiresAt | Buy before this time, or quote again. |
quote.usable | Whether the quote can still be bought. |
quote.document.breakdown | Base premium, add-ons, discounts, fees and taxes, to show your customer. |
quote.document.paymentOptions | Installment schedules, when the insurer offers them. |
3. Handle background pricinglink
Some insurers price in the background. Then you get 202, quote.usable is false and quote.document.status is PENDING. Either:
- wait for the
quote.completedwebhook, or - poll
GET /quotes/{providerId}/{quoteId}untilusableistrue.
Buying a pending quote is 409 QUOTE_PENDING.
Fix what the insurer refuseslink
| Answer | What to do |
|---|---|
422 VALIDATION_FAILED with fieldErrors | Show each error next to its field, then quote again with a new Idempotency-Key. |
409 PRODUCT_NOT_PURCHASABLE | The insurer is not available to your business in this environment. details.reasons says why. Offer another product. |
503 MAINTENANCE | The insurer cannot be called in this environment. Contact support. |
Nextlink
Take payment and buy the quote.