- Webhooks push events to you the moment they happen — a sale completes, a subscription’s initial payment or a renewal succeeds, a payment fails, a refund is issued.
- The HTTP API lets you read and write on demand — list orders and payments, fetch subscribers, create products and checkout sessions, register webhooks, and more.
Open the interactive API reference
Browse every endpoint and try calls live at api.pocketsflow.com/docs
(OpenAPI JSON at
/docs.json).What you can do with webhooks
Use events to keep external systems in step with Pocketsflow:- Fulfil purchases and grant access the instant
order.completedfires. - Manage memberships — provision on
customer.subscription.created(it fires exactly once, on activation), keep access on eachinvoice.payment_succeededrenewal, and revoke oncustomer.subscription.deleted. - React to changes —
customer.subscription.updatedfires on every change after activation (past due, recovery, cancel-scheduled, pause, resume). - Run dunning — email or pause access on
invoice.payment_failed, and warn ahead of a renewal withinvoice.upcoming(3 days before the card is hit). - Handle pauses —
customer.subscription.pausestops billing but the buyer keeps access;customer.subscription.resumedwhen billing restarts. - Sync your CRM — capture new buyers on
customer.created. - Trigger refunds/returns workflows on
order.refunded.
How delivery works
1
Register an endpoint
Create a webhook in the dashboard or via
POST /webhooks with an HTTPS url
and the events you want. You get back a signing secret.2
Pocketsflow POSTs the event
When a subscribed event occurs, Pocketsflow sends a JSON
POST to your URL
with X-Pocketsflow-Event, X-Pocketsflow-Signature, and
X-Pocketsflow-Timestamp headers.3
You verify and process
Verify the HMAC-SHA256 signature against the raw body, then process the
event idempotently.
4
You acknowledge
Return a
2xx within 5 seconds. Every attempt is recorded in your webhook
delivery log.Deliveries are a single attempt with a 5-second timeout — there is no
automatic retry of the outbound call. Acknowledge fast, process
asynchronously, and reconcile via the API (for example
GET /payments) so a missed delivery
never leaves you out of sync. You can also re-send a sample event any time
with POST /webhooks/{id}/test.Test vs live
Webhook endpoints are scoped to the mode your account is in when you create them. A test-mode endpoint only receives events frompk_test_… sales; a
live-mode endpoint only receives live events. Keep separate endpoints (and
secrets) per mode.
Where to go next
- API reference — base URL, API keys, pagination, errors, and the complete endpoint catalog.
- Authentication & security — verifying webhook signatures and securing your endpoint.
- Webhook events — every event, when it fires, and its payload.
- Consuming webhooks — delivery, idempotency, and reconciliation best practices.
- Webhook examples — ready-to-adapt handler code.
- Integrations — connect Pocketsflow to platforms like WooCommerce.