How it works
When you create a payment or cashout withcallbackUrl, Safefy sends an HTTP POST request to that URL whenever status reaches a relevant state.
For full domain-specific payloads, see:
Payment events
Cashout events
Sent headers
Signature
- For
payment.*events, the secret ispaymentId. - For
cashout.*events, the secret ispayoutId.
Retries
If your endpoint does not return2xx, Safefy retries:
- Attempt 1 (immediate)
- Attempt 2 after ~2 seconds
- Attempt 3 after ~4 seconds
200 OK) and process asynchronously.
Idempotency
Because retries can happen, your webhook processing must be idempotent.- Recommended key:
id(delivery id) ordata.id + type - Ignore already-processed events
Quick example
Payment status flow
Understand the transaction lifecycle and when each webhook is fired:Best practices
Respond quickly
Return 200 OK immediately and process the webhook asynchronously.
Be idempotent
Use the webhook id to avoid processing the same event twice.
Validate the signature
Always verify X-Safefy-Signature before trusting the payload.
Use HTTPS
Configure your callbackUrl with HTTPS in production.