Why should I use webhooks?
Pandabase webhooks can help you build real-time systems and facilitate payment acceptance. If you intend to provide something to a user immediately after a purchase, you can leverage webhook events.Event Overview
We generate event data and send it to your webhook. There are different event types as mentioned in events. For example, when a payment is completed successfully, apayment.success event is sent to your endpoint with the order and transaction data. We automatically send this immediately once a resource is updated in our system.
The event object payload
Every webhook delivery is a JSONPOST request with the following structure:
Headers
Every webhook delivery includes the following headers:| Header | Description |
|---|---|
X-Pandabase-Signature | HMAC-SHA256 hex digest of the JSON body, signed with your webhook secret |
X-Pandabase-Timestamp | Unix timestamp (milliseconds) of when the delivery was sent |
X-Pandabase-Idempotency | Unique delivery identifier for deduplication |
Retries
We retry up to 5 times, with each attempt delayed using exponential backoff starting at 1 second. If we receive a2xx status from your application, we mark the delivery as successful. Any other status code or a timeout (15 seconds) is treated as a failure and triggers a retry.
Verification
To ensure security, always verify webhooks. Webhooks can be verified to ensure they were actually sent by Pandabase and not by a malicious entity. To verify a webhook, you will need your webhook secret to confirm theSHA256 HMAC signature. Check the X-Pandabase-Signature header in the webhook request headers.
Here are several examples:
X-Pandabase-Signature header to verify authenticity.