webhooks scope
(dashboard → Developer Portal → Webhooks, or the API).
Register an endpoint
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 theX-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:
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 aPOST 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
Everydata 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_idis 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_idisnull. Check it, and theamount, against your own record before you fulfil.
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 verifyX-Kori-Signature before trusting a payload. Compute the HMAC over the
raw body (not a re-serialized object) using your webhook secret.
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 sampletest event to confirm your handler works: