Overview
Webhooks notify your server in real time when payment events occur (e.g., payment approved, refund completed). They are essential for reliable payment processing because API responses alone may not reflect the final transaction state.Register a Webhook Endpoint
Prepare your endpoint
Create an HTTPS endpoint on your server that accepts POST requests and returns a
200 status code:Register in the Dashboard
- Navigate to Dashboard > Settings > Webhooks
- Click Add Endpoint
- Enter your HTTPS URL (e.g.,
https://api.yoursite.com/webhooks/yuno) - Select the events you want to receive
- Save the configuration
- Copy the signing secret for signature verification
Webhook Events
| Event | Description |
|---|---|
payment.created | Payment request submitted |
payment.succeeded | Payment approved and captured |
payment.failed | Payment declined or errored |
payment.pending | Payment awaiting async confirmation |
payment.cancelled | Payment voided/cancelled |
refund.succeeded | Refund processed |
refund.failed | Refund could not be processed |
enrollment.succeeded | Card enrolled successfully |
Webhook Payload Structure
URL Requirements
- Must use HTTPS (HTTP is not accepted)
- Must be publicly accessible (not
localhost) - Must respond with
200status within 30 seconds - Must accept
POSTrequests withContent-Type: application/json
Retry Policy
If your endpoint fails to respond with200, Yuno retries with exponential backoff:
| Attempt | Delay |
|---|---|
| 1st retry | 1 minute |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |
| 4th retry | 2 hours |
| 5th retry | 24 hours |
In sandbox, some webhook event types may return 404 errors. This is a known limitation. Test your webhook handler with the events that are available in sandbox and verify full coverage when switching to production.
Best Practices
- Always verify webhook signatures to prevent spoofing
- Process webhooks idempotently (handle duplicate deliveries gracefully)
- Respond with
200immediately, then process the event asynchronously - Log all received webhook events for debugging and reconciliation
- Use a webhook testing tool (like ngrok) for local development