Webhooks let SmartRetry push event notifications to your server in real time. Instead of polling the status endpoint, you receive an HTTP POST request whenever a transaction’s state changes.Documentation Index
Fetch the complete documentation index at: https://www.smartretry.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
How webhooks work
Configure your endpoint
Register a webhook URL in your SmartRetry dashboard. This endpoint must be publicly accessible and respond to HTTPS POST requests.
Receive events
When a transaction event occurs (approval, decline, retry attempt, etc.), SmartRetry sends a JSON payload to your endpoint.
Event types
| Event | Description |
|---|---|
transaction.approved | A transaction was approved by the issuer. |
transaction.declined | A transaction was declined. Check reason_code for details. |
transaction.pending | A transaction is awaiting final status (e.g., 3DS challenge). |
transaction.retry_scheduled | SmartRetry scheduled an automatic retry for a soft decline. |
transaction.retry_attempted | A retry attempt was made. |
recurring.created | A new recurring series was initialized. |
recurring.charged | A recurring payment was processed. |
recurring.cancelled | A recurring series was cancelled. |
recurring.completed | A recurring series reached its payment limit. |
future_transaction.scheduled | A future payment was scheduled. |
future_transaction.executed | A scheduled payment was processed. |
future_transaction.cancelled | A scheduled payment was cancelled. |
Webhook payload
All webhook payloads follow a consistent structure:Unique identifier for this webhook event. Use this to deduplicate retried deliveries.
The event type. See Event types above.
ISO 8601 timestamp of when the event occurred.
Event-specific payload. Structure varies by event type but always includes relevant IDs.
Verifying webhook signatures
Every webhook request includes a signature header to verify the request originated from SmartRetry.t- Unix timestamp of when the signature was generatedv1- HMAC-SHA256 signature of the payload
Verification steps
Retry behavior
If your endpoint doesn’t return a2xx response, SmartRetry retries the delivery with exponential backoff:
| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
| 6 | 8 hours |
| 7 | 24 hours |
Best practices
-
Respond quickly - Return a
2xxresponse immediately and process the event asynchronously. If processing takes longer than 30 seconds, the request times out and triggers a retry. -
Idempotent handlers - Design your webhook handlers to safely process the same event multiple times. Use the
idfield as a deduplication key. -
Verify signatures - Always validate the
X-SmartRetry-Signatureheader before processing any webhook. - Use HTTPS - Webhook endpoints must use HTTPS. HTTP URLs are rejected.
- Handle all event types - Your handler should gracefully ignore event types it doesn’t recognize, allowing for future expansion.
Testing webhooks
In sandbox mode, you can trigger test webhook events from the dashboard:- Navigate to Settings > Webhooks
- Click Send test event
- Select an event type
- Review the payload delivered to your endpoint
Sandbox webhook events include
"environment": "sandbox" in the payload to distinguish them from production events.