DOCS Live

Merchants

Payment webhooks for merchants

Which payment events to subscribe to, what each means for your order, and how to never ship an unpaid order.

The mechanics of webhooks (registering, verifying signatures, retries, catching up) are in Receiving webhooks. This page is about what a merchant does with each payment event.

The rule that keeps orders safe: a webhook tells you to look; the payment you read tells you what is true. Ship only when a read of the payment says succeeded.

Before you start

An endpoint registered for your application with payment.* and refund.* (add payout.* and settlement.* if you are paid out by KulPay).

The flow at a glance

#WhoWhat happens
1KulPayPosts a payment event to your application's endpoint.
2Your systemVerifies it, records its ID, answers 2xx.
3Your systemReads the payment and moves the order to the state it says.

1. Read the payment the event names

Your system, for every payment event.

GET /payments/{provider_payment_id} · API reference

The event carries the payment's IDs. Read the payment and act on its status, not on the event's type alone: events can arrive late or twice, and the read is always current.

2. Move the order

Your system.

3. Reconcile what you missed

Your system, daily or after an outage.

GET /v1/events · API reference

Catch up with GET /v1/events?since=<last event id>, so no payment is left unconfirmed in your system.

Events

EventWhat it tells you
payment.succeeded

Paid. Fulfil the order.

payment.failed

Not paid.

payment.expired

Not paid in time.

payment.requires_action

The customer has a step left.

payment.refunded

Fully refunded.

payment.partially_refunded

Partly refunded.

payment.disputed

A chargeback was opened.

refund.succeeded

A refund reached the customer.

Errors that matter here

Every error is application/problem+json with a stable code; branch on the code, not the message. The full list is in the error catalogue.

ErrorWhenWhat to do
404 not_found

The payment read with a key of another mode or application.

Read with the application's key in the event's mode.

Testing it

Pay a test charge with +258840000005 (succeeds without a webhook) and check your daily reconciliation finds and confirms it.


All flows · API reference · Error catalogue