Service the policy
After the sale, your customer will want their documents, changes to their cover, a renewal, or a cancellation. Every call here takes the providerId and policyId you kept from the purchase.
Show the policylink
curl https://insure-api.netapps.ng/api/v1/policies/66f1c2a9e4b0d3a1c8e7f512/pol_5e5447c7b9c6 \
-H "x-api-key: $INSURETECH_API_KEY"The policy is read live from the insurer, so its status is current. GET /policies lists every policy your business sold.
Give your customer their documentslink
- List them with
GET /policies/{providerId}/{policyId}/documents. - Download one with
GET /policies/{providerId}/{policyId}/documents/{documentId}. The answer is the file itself, such as a PDF certificate, not JSON.
Listen for document.ready to learn when a new document appears.
Change the cover mid-termlink
An endorsement is a change such as a higher sum assured or an added driver. It takes two calls, so your customer sees the cost before anything changes.
- Fetch the endorsement form:
GET /products/{providerId}/{productId}/form?context=endorsement. - Price the change with
POST /policies/{providerId}/{policyId}/endorsements, sendingformId,formVersionand the answers. - Show
endorsement.premiumDelta. Positive means your customer pays more, negative means a refund. - Confirm before
endorsement.expiresAtwithPOST /policies/{providerId}/{policyId}/endorsements/{endorsementId}/confirm. When the change costs more, charge your customer exactly the delta first and send it aspayment.
A price increase is billed on your next statement. A decrease is credited on it, and you return it to your customer.
Renewlink
When policy.renewal_due arrives:
- Ask for a renewal quote with
POST /policies/{providerId}/{policyId}/renewal-quote. There is no request body. - The answer is an ordinary quote with
renewalOfset. A 202 means the insurer is still pricing it: wait forquote.completed. - Charge your customer and buy it with
POST /purchases, exactly like a first sale.
Cancellink
curl -X POST https://insure-api.netapps.ng/api/v1/policies/66f1c2a9e4b0d3a1c8e7f512/pol_5e5447c7b9c6/cancel \
-H "x-api-key: $INSURETECH_API_KEY" \
-H "Idempotency-Key: 9d1f3b5a-7c9e-4b1d-a3f5-8e0c2a4b6d8f" \
-H "Content-Type: application/json" \
-d '{ "reason": "CUSTOMER_REQUEST", "note": "The customer sold the vehicle." }'outcome | Meaning |
|---|---|
cancelled | Cover ends on cancellation.effectiveDate. |
pending | The insurer is reviewing it. Wait for policy.cancelled. Nothing is refunded until it decides. |
cancellation.refund.payTo says who refunds your customer:
payTo | What happens |
|---|---|
MARKETPLACE | The refund is credited on your next statement, and you return it to your customer. |
CUSTOMER | The insurer pays your customer directly. Nothing is credited to you. |
When an insurer does not offer somethinglink
Not every insurer supports every change. A 422 FEATURE_NOT_SUPPORTED names the missing feature in details.feature. Retrying will not help: tell your customer to contact the insurer.
Nextlink
Handle claims on the policies you sold.