webhook_url you setX-Autopay-Delivery-Id and the same JSON body. Your handler must beX-Autopay-Delivery-Id, return 200 and stop.event and update your order (table below).X-API-Secret.message = "{X-Autopay-Timestamp}.{X-Autopay-Delivery-Id}.{raw_body}"
X-Autopay-Signature = HMAC-SHA256(webhook_secret, message) // lowercase hexJSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE.timestamp is ISO-8601. Header X-Autopay-Timestamp is unix secondsevent | Fulfill order? | Your action |
|---|---|---|
invoice.completed | Yes | Mark paid using invoice_id / external_reference. Read data.fees only as customer_total and merchant_net. |
invoice.under_review | No | Hold the order. A later completed or failed will follow after review. |
invoice.failed | No | Payment was rejected. Release hold. |
invoice.cancelled | No | Invoice cancelled. Release hold. |
invoice.expired | No | Timed out. Release hold. |
invoice.paid. Unknown event names: return 200 and ignoredata.provider is vodafone_cash or instapay when a transaction exists.X-Autopay-* headers.X-Autopay-Delivery-Id does not double-charge / double-ship.localhost / 127.0.0.1 webhook URLs are rejected at invoice create time.curl --location '/webhooks/autopay' \
--header 'X-Autopay-Signature;' \
--header 'X-Autopay-Timestamp;' \
--header 'X-Autopay-Delivery-Id;' \
--header 'X-API-Key: <api-key>' \
--header 'X-API-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"event": "invoice.completed",
"invoice_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"external_reference": "ORD-1001",
"timestamp": "2026-08-17T10:12:00+00:00",
"data": {
"invoice_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"external_reference": "ORD-1001",
"amount": "100.00",
"currency": "EGP",
"status": "completed",
"transaction_id": 42,
"provider": "instapay",
"paid_at": "2026-08-17T10:12:00+00:00",
"customer": {
"name": "Ahmed Ali",
"email": "customer@example.com",
"phone": "01012345678",
"metadata": {
"order_id": "1001"
}
},
"transaction": {
"id": 42,
"uuid": "a3f1c8e2-4b5d-4e6f-8a9b-1c2d3e4f5a6b",
"invoice_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"provider": "instapay",
"status": "verified",
"currency": "EGP",
"amount": "100.00",
"received_amount": "100.00",
"sender_identifier": "ahmed@instapay",
"sender_name": "Ahmed Ali",
"reference": "123456789",
"is_flagged": false,
"flag_reason": null,
"fees": {
"customer_total": "103.00",
"merchant_net": "100.00"
},
"matched_at": "2026-08-17T10:12:00+00:00",
"created_at": "2026-08-17T10:05:00+00:00"
}
}
}'{
"received": true
}