Webhooks
Webhooks let you receive real-timepayment.succeeded notifications whenever a buyer pays for any of your resources — endpoints, products, components, or agent endpoints.
Plan Requirement: Webhooks are available on Pro and Business plans only. Free plan accounts receive a 403 response.
How It Works
Webhooks are account-level (seller-level), not per-resource. You register one webhook URL and it receives events for all resources you own.- 💰 Payment Happens — Buyer pays for any of your resources
- 📡 Webhook Fires — Signed POST request to your URL
- ✅ You Act — Fulfill order, grant access, log it
Setup via Dashboard
- Go to Dashboard → Webhooks
- Click Create Webhook
- Enter your HTTPS endpoint URL
- A signing secret is generated automatically — copy and store it securely
Event: payment.succeeded
Every webhook delivery is a POST request with this JSON body:
| Field | Description |
|---|---|
source | Resource type: endpoint, product |
source_slug | The slug of the resource that was paid for |
amount / currency | Payment amount and asset (e.g. USDC) |
tx_hash | On-chain transaction hash |
network | base or solana |
Verifying Signatures
Every delivery includes two headers for HMAC verification:X-X402-Signature— HMAC-SHA256 hex digest of the raw bodyX-X402-Timestamp— Unix timestamp of when the event was sent
Node.js
Python
Coverage Matrix
| Source | Route | Status |
|---|---|---|
| Endpoint payments | /e/:slug | ✅ Live |
| Product payments | /p/:slug | ✅ Live |
| Components (via endpoints) | — | ✅ Live |
| Agent endpoint create | /agent/endpoints | ✅ Live |
| Agent endpoint top-up | /agent/endpoints | ✅ Live |
Best Practices
- 🔐 Always verify signatures — Never trust unverified payloads.
- ⚡ Respond quickly (< 5s) — Process asynchronously and return
200immediately. Queue heavy work. - 🔄 Handle duplicates — Use the event
idfor idempotency. - 🔑 Rotate secrets periodically — Use Dashboard → Webhooks → Rotate Secret.
Webhook API Reference
| Method | Endpoint | Description |
|---|---|---|
GET | /api/webhooks | List your webhooks |
POST | /api/webhooks | Create a new webhook |
PATCH | /api/webhooks/:id | Toggle active / rotate secret |
DELETE | /api/webhooks/:id | Delete a webhook |
