Webhooks
When a payment status changes, LedePay sends an event to your configured webhook URL. Verify the signature and respond promptly.
Available Events
| Event | Description |
|---|---|
| payment.succeeded | Payment succeeded |
| payment.failed | Payment failed |
| chargeback.created | Chargeback received |
| refund.succeeded | Refund succeeded |
Signature Verification
Use the header LedePay-Signature with your key to verify the event came from LedePay and was not tampered with.
Example Event
payloadJSON
{
"id": "evt_xxx",
"type": "payment.succeeded",
"data": {
"object": {
"id": "pi_xxx",
"amount": 100,
"currency": "CNY",
"status": "succeeded"
}
}
}