Overview
Webhooks provide asynchronous updates about authorization results via HTTP callbacks, ensuring payment status is synchronized between your system and Push Cash. Without webhooks, ambiguous authorization results (e.g. due to timeouts or internal server errors) leave little recourse to recover and correct transaction status. We strongly recommend that all integrations enable webhooks to ensure stability and reliability.Integration Steps
1. Update Authorization Request
Update yourPOST /authorization
request, following the format in the API Reference. Important fields to note for webhook enablement are:
Field | Type | Description |
---|---|---|
webhook_url | string | HTTPS URL where Push will send webhook callbacks |
webhook_secret | string | Secret key for HMAC signature verification (minimum 32 characters, maximum 4096 characters) |
tag | string | Your internal transaction ID for matching webhooks to internal records (maximum 255 characters) |
2. Implement Webhook Endpoint
Create an endpoint at yourwebhook_url
that:
- Verifies webhook authenticity (see Security section below)
- Update internal transaction record based on
data.tag
andtype
fields (see Update Internal Transaction Record below)
Security
Signature Verification
Ifwebhook_secret
was provided, your webhook request will include an X-Webhook-Signature
header containing an HMAC-SHA256 signature of the payload. You must verify this signature to ensure the request came from Push Cash and hasn’t been tampered with.
Signature Format
- Extract the signature from the
X-Webhook-Signature
header - Read the raw request body as bytes (before parsing JSON)
- Compute HMAC-SHA256 using your
webhook_secret
and the raw body - Compare signatures using constant-time comparison
- Reject requests with invalid signatures (return
401 Unauthorized
)
Timestamp Verification
Thetimestamp
field in the webhook payload indicates when the webhook was created. To prevent replay attacks, verify that the timestamp is recent (within 10 minutes).
Verification Steps
- Parse the
timestamp
field from the payload (ISO 8601
format) - Compare with current time
- Reject requests older than 10 minutes (return
401 Unauthorized
)
Update Internal Transaction Record
- Match webhook to internal transaction record
- Parse the webhook payload for the
data.tag
field and match it to your internal transaction record in your database
You need to commit the transaction record in your database before calling the authorization endpoint. View Independent Ordering for more information.
- Update transaction status
- Parse the webhook payload for the
type
field and update the transaction status in your database
You must ensure that you handle idempotency and do not perform a duplicate update. View Handle Duplicates (Idempotency) for more information.
Independent Ordering
Webhook delivery and authorization responses are independent and may arrive in any order. Your system must handle both scenarios by ensuring that the internal transaction record is committed to the database before the call to the authorization endpoint:- Webhook arrives first (before authorization response)
- Authorization response arrives first (before webhook)

Handle Duplicates (Idempotency)
Push provides at-least-once delivery for webhooks. Your application must handle duplicate webhook deliveries gracefully using database transactions to ensure idempotency. In the case of a duplicated webhook delivery from Push either due to an error or timeout from your callback handler, you should discard the request and return a200 OK
.
If Push does not receive a200 OK
response from your webhook endpoint, delivery will be retried with exponential backoff.
Environment | Retry Behavior |
---|---|
Sandbox | Up to 3 attempts |
Production | Up to 40 attempts over 3 days, then marked as expired |
Best Practices
- Return
200 OK
only after successfully processing the webhook - Return
4xx/5xx
if processing fails (triggers retry) - Log webhook payloads for debugging and audit trails
- Monitor webhook failures to detect integration issues