Events
When the status of a charge changes, KingsPay emits an event. You can receive these events by configuring a webhook destination.
This page lists all events emitted for the Charges resource. For a general guide on consuming events—verifying signatures, handling retries, and setting up webhook destinations—see the Events overview.
Available events
payment_charge.created
Emitted when a new charge is successfully created.
| Field | Description |
|---|---|
event | payment_charge.created |
data.id | Unique ID of the charge. |
data.status | Always pending at creation. |
data.amount | Charge amount. |
data.currency | Currency code. |
data.client_reference_id | Your own reference ID, echoed back from the create request. |
data.payment_method | Payment method used. |
data.expires_at | When the charge expires if unpaid. |
data.created_at | Timestamp of charge creation. |
payment_charge.succeeded
Emitted when a customer successfully completes the payment. Use this event as the authoritative signal to mark an order as paid.
| Field | Description |
|---|---|
event | payment_charge.succeeded |
data.id | Unique ID of the charge. |
data.status | Always success. |
data.amount | Charge amount. |
data.currency | Currency code. |
data.client_reference_id | Your own reference ID, echoed back from the create request. |
data.fee | Fee deducted by KingsPay. |
data.net_amount | Amount after fees. |
data.paid_at | Timestamp of when the payment was confirmed. |
payment_charge.failed
Emitted when a charge fails or expires without payment.
| Field | Description |
|---|---|
event | payment_charge.failed |
data.id | Unique ID of the charge. |
data.status | Always failed. |
data.amount | Charge amount. |
data.currency | Currency code. |
data.client_reference_id | Your own reference ID, echoed back from the create request. |
data.updated_at | Timestamp of when the charge failed or expired. |
payment_charge.confirming
Emitted when the payment has been seen and is waiting to be confirmed. data.status is confirming. Don't mark the order as paid yet: a payment_charge.succeeded, payment_charge.partially_paid or payment_charge.failed event follows.
payment_charge.partially_paid
Emitted when the customer paid less than the charge amount. data.status is part_paid, and the amount received is credited to your balance.
What to do with these events
- On
payment_charge.succeeded— mark the order as paid, trigger fulfillment, and notify the customer. - On
payment_charge.partially_paid: decide whether to fulfill the order, or ask the customer to pay the rest with a new charge. - On
payment_charge.failed— release reserved inventory, optionally notify the customer, and allow them to retry.
For details on verifying event signatures and configuring where events are delivered, see the Events overview.