Skip to main content
Webhooks let Kori notify your server when events happen — most importantly, when an asynchronous collection settles. Register endpoints with the webhooks scope (dashboard → Developer Portal → Webhooks, or the API).

Register an endpoint

The response includes a secret once — store it securely; you’ll use it to verify signatures. You can register up to 5 endpoints per merchant.
Webhooks are per environment. An endpoint registered with a Live key receives Live events only, and one registered with a Sandbox key receives Sandbox events only — so register your endpoint twice if you want both.

The signing secret

Each endpoint has its own signing secret, the key for the X-Kori-Signature HMAC. It is returned only in the response to POST /webhooks — the list and detail endpoints never include it, and there is no way to read it back later. If you lost it, or it leaked, rotate it:
The response carries the new secret, once. Deliveries are signed with it immediately, so deploy it to your server first if you can’t tolerate a gap in verification. Rotating also records a security_alert notification on your account. In the dashboard the secret is shown once, right after you add the endpoint, and each endpoint under Developer Portal → Webhooks has a rotate action.

Events

A settled collection fires exactly one of payment_received or payment_link_used, never both: the link case replaces the direct one. Both fire once per reference, whichever path settles it first (the provider callback, your status poll, or reconciliation).

Delivery format

Kori sends a POST with a JSON body and these headers: Every delivery uses the same envelope: Respond with a 2xx status quickly. Non-2xx responses count as failures.

Event payloads

Every data object carries title and message — the same wording as the matching dashboard notification, suitable for logging but not for branching on — plus the fields specific to the event.

Field notes

client_reference_id is your own id for the payment — an order, an invoice. How far you can trust it depends on where it came from:
  • From a checkout session — you set it through the API, server-side, and the payer never sees or touches it. payment_session_id is set. This is the one to build on.
  • From a bare link’s URL (?client_reference_id=…) — it travels in a URL the payer can edit, so treat it as a claim, not a fact. payment_session_id is null. Check it, and the amount, against your own record before you fulfil.
It is null when you did not set one. payment_session_id is the checkout session the payment came through, or null when the payer used the bare link. Use it with GET /payment-sessions/{id}. payment_received always carries payment_link_id: null — that is what distinguishes it from payment_link_used, where the field holds the link’s ID. The reference is the one you sent when creating the collection, or the generated one if you sent none. bulk_pay_done includes refunded — the total credited back to your balance for failed recipients — only when the batch completed during the original request. When the batch is closed later by reconciliation the field is absent, so treat it as optional and read failed_count for the outcome. The test event (sent by POST /webhooks/{id}/test) is the one exception to the envelope: it has no merchant_id, and its data holds only message. Don’t use it to validate your parsing of real events.

Action variants

api_key_created and security_alert each cover several distinct actions. Switch on data.action rather than on title:

Verify the signature

Always verify X-Kori-Signature before trusting a payload. Compute the HMAC over the raw body (not a re-serialized object) using your webhook secret.
Verify against the raw bytes of the request body. Parsing to JSON and re-stringifying changes whitespace/key order and will break the signature.

Retries and auto-disable

Failed deliveries increment a failure counter. After repeated consecutive failures, an endpoint is automatically disabled (is_active: false). Fix your endpoint and re-enable it via PUT /merchant/api/webhooks/{id}. A successful delivery resets the counter to zero, so occasional failures never accumulate towards the limit.

Test an endpoint

Send a sample test event to confirm your handler works: