Documentation Index
Fetch the complete documentation index at: https://docs.pandabase.io/llms.txt
Use this file to discover all available pages before exploring further.
Why use webhooks?
Webhooks let you react to events in real time. When something happens in your store — a payment is collected, a refund is issued, a dispute is opened — Pandabase sends aPOST request to your endpoint with the event data. This is how you deliver license keys, update your database, send notifications, or trigger any custom logic immediately after a purchase.
Event overview
Pandabase fires webhook events when payment-related state changes occur. Each event type maps to a specific moment in the payment lifecycle:| Event | When it fires |
|---|---|
PAYMENT_PENDING | Customer initiates payment at checkout |
PAYMENT_COMPLETED | Payment is successfully collected |
PAYMENT_FAILED | Payment fails, is canceled, or expires |
PAYMENT_REFUNDED | A charge is refunded |
PAYMENT_DISPUTED | Customer opens a chargeback dispute |
PAYMENT_DISPUTE_WON | Dispute resolved in your favor |
PAYMENT_DISPUTE_LOST | Dispute resolved against you |
Payload structure
Every webhook delivery is a JSONPOST request. The payload includes the event type, a unique event ID, a timestamp, and a data object containing the order, customer, and geo information.
Headers
Every webhook delivery includes headers for verification and deduplication:| Header | Description |
|---|---|
X-Pandabase-Signature | HMAC-SHA256 hex digest of the raw JSON body, signed with your webhook secret |
X-Pandabase-Timestamp | Unix timestamp (milliseconds) of when the delivery was sent |
X-Pandabase-Idempotency | Unique delivery ID — store this to deduplicate retried deliveries |
Content-Type | application/json |
User-Agent | Pandabase (https://pandabase.io) |
Retries
Failed deliveries are retried up to 5 times with exponential backoff (1s → 2s → 4s → 8s → 16s). A2xx response is treated as success. Anything else — a non-2xx status, a timeout (15 seconds), or a connection error — triggers a retry.
Verification
Always verify theX-Pandabase-Signature header before processing a webhook. This confirms the request came from Pandabase and hasn’t been tampered with.
The signature is an HMAC-SHA256 hex digest of the raw request body using your webhook secret as the key.
Best practices
- Return 200 immediately. Do heavy processing asynchronously. Pandabase times out after 15 seconds.
- Verify every request. Always check
X-Pandabase-Signaturebefore acting on a webhook. - Deduplicate with idempotency keys. Store
X-Pandabase-Idempotencyvalues and skip already-processed events. - Use HTTPS. Webhook URLs must use
https://. Pandabase rejects insecure endpoints. - Filter events. Only subscribe to the events you need to reduce noise.
- Handle out-of-order delivery. Events may occasionally arrive out of sequence. Use the order
statusfield rather than assuming event order.
