Skip to main content
These handlers verify the X-Pocketsflow-Signature, acknowledge quickly, and route on the X-Pocketsflow-Event header. Adapt them — add persistence, a job queue, and real error handling for production. For the mechanics see Authentication & security and Consuming webhooks.
Verify against the raw request body. The signed body includes a webhookId field, so re-serializing parsed JSON can change the bytes and break the signature.

Node.js (Express)

Next.js (App Router route handler)

Python (Flask)

PHP

Testing your endpoint

Send a sample delivery any time with POST /webhooks/{id}/test — it signs and delivers a realistic payload for the endpoint’s first subscribed event, so you can confirm signature verification and routing end to end before going live.

Example repositories

Two complete, runnable examples on GitHub — clone one, drop in your IDs and signing secret, and you have a working checkout embed plus a signature-verifying webhook receiver.

Subscriptions example

Embed a subscription checkout and handle customer.subscription.*, invoice.*, and payment_intent.* webhooks.

One-time products example

Embed a product checkout and handle order.completed, order.refunded, and customer.created webhooks.