Webhooks & Events
Time: ~10 minutes | Difficulty: Beginner Use the TagadaPay Node SDK to register HTTPS endpoints for real-time notifications, verify deliveries cryptographically, and query the event log for debugging and analytics.What webhooks are (and why use them)
Webhooks are HTTP callbacks TagadaPay sends to your server when something happens on the platform — for example, a successful payment or a subscription change. Your endpoint receives a JSON payload so you can update your database, trigger fulfillment, notify internal tools, or sync with Zapier/n8n without polling the API.Webhooks run asynchronously after the triggering action. Design your handler to respond quickly (e.g. validate the signature, enqueue work, return
2xx). Heavy work should happen in a background job.Create a webhook
Register a URL and the event types you care about. The API returns the endpoint id, URL, signing secret, subscribed types, and whether the endpoint is enabled.The signing secret
Each webhook endpoint has a unique secret. TagadaPay uses it to compute an HMAC-SHA256 signature over the raw JSON body of each delivery. Your server must verify that signature before trusting the payload.Event type strings in
eventTypes must exactly match the names TagadaPay dispatches (see the table below). If a string does not match a fired event, no delivery occurs for that subscription.List webhooks
Delete a webhook
Common event types
These are representative types you can subscribe to. The platform may emit additional types over time; useevents.list or events.recent to see what your account is actually recording.
| Event type | Typical use |
|---|---|
order.created | Order record created (confirm in your tenant — paid checkout often surfaces as order.paid) |
order.paid | Order successfully paid; trigger fulfillment or CRM updates |
payment.completed | Crypto / alternative payment flows marking completion |
payment.expired | Payment window expired without completion |
subscription.created | New subscription started |
subscription.canceled | Subscription canceled (US spelling in API) |
subscription.rebill_upcoming | Upcoming rebill notification |
subscription.updated | Plan or status changed |
subscription.paused / subscription.resumed | Pause lifecycle |
subscription.rebill | Successful rebill charge (renewal) |
subscription.renewed | Some integrations use this name; TagadaPay may emit subscription.rebill instead — verify in events.recent |
refund.created | Refund initiated or recorded |
Some docs or examples may use aliases like
order.created or subscription.cancelled. Always use the exact string your environment dispatches. When in doubt, inspect eventType on records returned by events.recent or events.list.Events API (query & analytics)
Use the Events resource to audit activity, build dashboards, or debug webhook payloads.Recent events
Statistics
List with filters and pagination
appEvents.createdAt / appEvents.processedAt, customer.email, appEvents.draft, and free-text search.
Webhook subscriptions use dispatch names like
order.paid and subscription.created. Events list responses may use different internal eventType strings (for example s_order_paid). Inspect events.recent() or a sample events.list() response to see the exact values for your account.Webhook signature verification (HMAC-SHA256)
TagadaPay signs the exact JSON string sent as the request body.- Read the raw body as a string (do not parse JSON before verifying).
- Compute
HMAC-SHA256(secret, rawBody)and hex-encode the digest. - Compare to the
X-TagadaPay-Signatureheader value after thesha256=prefix.
X-TagadaPay-Timestamp and User-Agent: TagadaPay-Webhooks/1.0. You can use the timestamp for optional replay protection.
SDK methods reference
| Resource | Method | Description |
|---|---|---|
webhooks | create(params) | Create endpoint; params: storeId, url, eventTypes, optional description |
webhooks | list(storeId) | List all webhooks for a store |
webhooks | del(id) | Delete webhook; returns { success, id } |
events | recent(limit?) | Most recent events |
events | statistics(params?) | Aggregates; optional storeId, startDate, endDate |
events | list(params?) | Filtered list with filters, pagination, sortBy, search |
events | retrieve(eventId) | Single event by id |
Next steps
Node SDK Quick Start
Install the SDK, authenticate, and explore core resources
Sandbox Testing
Exercise payments and webhook-style flows without live processors
Merchant Quick Start
End-to-end store, funnel, and checkout setup
Subscriptions
Recurring billing and subscription lifecycle
