Skip to main content

Order Webhooks

On every order status transition, QI Tech sends a webhook of type insurance.order.status_changed to the configured callback URL. The event identifies the order by its order_key and carries the new status.

Webhooks are notifications, not the source of truth

Webhook delivery is best-effort. Do not depend exclusively on them: a lost event is always recoverable by retrieving the order through GET /v1/insurance/order.

Webhook configuration

Receiving webhooks requires a configured callback URL. See Authentication — Receiving webhooks.

Webhook structure

FieldTypeDescription
webhook_typestringAlways insurance.order.status_changed.
webhook_datetimestringDate and time of the event in ISO 8601.
dataobjectEvent data. See table below.

Attributes of data

FieldTypeDescription
order_keystringOrder key.
statusstringNew order status.
customer_document_numberstringInsured person's document.
reasonarray / stringReason, when applicable: the decline_reasons list on rejected, the reason given on cancelled. null otherwise — the key is always present.
product_countintegerNumber of products in the order. On the emitted event, it is the number of policies that will be issued.
Standard webhook structure
{
"webhook_type": "insurance.order.status_changed",
"webhook_datetime": "2026-07-16T14:03:22Z",
"data": {
"order_key": "5e2b3f60-7c4b-4c8e-9f1a-6d2e8b4a7c90",
"status": "status",
"customer_document_number": "96969879003",
"reason": null
}
}

Events per status

Order created

STATUS
awaiting_payment

Sent when the submission completes successfully. The order awaits the first installment payment through the Pix payment_artifact returned on order creation.


Order rejected

STATUS
rejected

Sent when the order is born rejected at submission because pricing refused at least one line. The reason field carries the decline_reasons list.


Order emitted

STATUS
emitted

Sent when payment is confirmed and policy issuance is dispatched. The product_count field states how many policies will be created — the event does not carry the policy keys, because they are issued asynchronously right afterwards. Discover them with GET /v1/insurance/policies?order_key= or wait for the policy webhooks.

Webhook Body
{
"webhook_type": "insurance.order.status_changed",
"webhook_datetime": "2026-07-16T14:03:22Z",
"data": {
"order_key": "5e2b3f60-7c4b-4c8e-9f1a-6d2e8b4a7c90",
"status": "emitted",
"customer_document_number": "96969879003",
"reason": null,
"product_count": 2
}
}

Order expired

STATUS
expired

Sent when the payment deadline (expires_at) elapses without confirmation. Expiry never undoes a valid payment: if payment is confirmed before expiry is processed, the order is emitted normally and this event does not occur.


Order cancelled

STATUS
cancelled

Sent when a pre-emission cancellation completes. The reason field carries the reason given on the cancellation, when there is one. A post-emission cancellation does not emit this event — the order stays emitted and tracking happens through the policy webhooks.

Attention!

QI Tech webhooks must not be mapped strictly. Additional fields may be added to the webhook payloads returned by our APIs.