Webhooks
YnoPay sends webhook events to notify your server of payment state changes.
Create a Webhook Endpoint
POST /v1/webhook_endpoints| Param | Type | Required |
|---|---|---|
url | string | Yes |
enabledEvents | string[] | Yes |
Event types
| Event | Description |
|---|---|
payment_intent.succeeded | Payment confirmed |
payment_intent.failed | Payment failed |
checkout.session.completed | Checkout session paid |
charge.succeeded | Charge reconciled |
Signature verification
Each webhook includes an X-YnoPay-Signature header — an HMAC-SHA256 hex digest of the raw body:
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected),
);
}Retry policy
- Webhooks are retried up to 5 times with exponential backoff
- Respond with
2xxto acknowledge receipt - Failed deliveries go to the dead-letter queue after all retries