Configuration
Configure the webhook in your organization:
| Field | Description |
|---|---|
webhookUrl | HTTPS URL that will receive the events |
webhookSecret | Secret key for signature validation |
Configuration example
Example — replace with your actual credentials:Event types
The plugin emits four event types:
| Event | Triggered when |
|---|---|
transfer.completed | TED OUT or P2P transfer completed |
transfer.failed | Transfer failed or was rejected |
transfer.incoming | TED IN transfer received and credited |
transfer.cancelled | Transfer cancelled by user |
Payload structure
All webhooks follow the same base structure:
| Field | Type | Description |
|---|---|---|
event | String | Event type |
timestamp | ISO 8601 | When the event occurred |
organizationId | UUID | Organization the event belongs to |
data | Object | Event-specific data |
Detailed events
transfer.completed
Sent when a TED OUT or P2P transfer is completed.transfer.failed
Sent when a transfer fails or is rejected.failureCode field contains the SPB error code when applicable.
transfer.incoming
Sent when a TED IN transfer is received and credited.transfer.cancelled
Sent when a transfer is cancelled by the user.Signature validation
All webhooks include an HMAC-SHA256 signature in the
X-Signature header. Validate this signature to ensure the webhook is authentic.
Signature header
Validation in code
JavaScript
JavaScript
Python
Python
Go
Go
Retry policy
If your endpoint doesn’t respond with 2xx status, the plugin resends the webhook with exponential backoff:
| Attempt | Interval |
|---|---|
| 1 | Immediate |
| 2 | 5 seconds |
| 3 | 25 seconds |
| 4 | 60 seconds |
| 5 | 120 seconds |
Endpoint requirements
To ensure reliable delivery:- Respond with 2xx status within 30 seconds
- Use HTTPS with valid certificate
- Avoid heavy processing in handler (use queues)
Idempotency
Webhooks may be delivered more than once in retry scenarios. Implement idempotency using the
transferId:
Monitoring
The plugin exposes metrics about webhook delivery:
Testing webhooks
During development, you can use tools like:
- webhook.site — temporary endpoint for testing
- ngrok — exposes localhost to the internet
- RequestBin — inspects received requests
Best practices
| Practice | Description |
|---|---|
| Validate signature | Always verify the X-Signature header |
| Respond quickly | Return 200 before processing; use queues |
| Implement idempotency | Same webhook may arrive more than once |
| Monitor DLQ | Set up alerts for undelivered webhooks |
| Use HTTPS | Webhooks are only sent to secure endpoints |
| Handle all events | Even if ignoring some, return 200 |

