Skip to main content
Polar delivers webhooks to public URLs, which your local server does not have. The CLI bridges that gap: polar listen streams your organization’s webhook events to a local URL, and polar trigger sends realistic sample events whenever you need one, without waiting for a real checkout or subscription.

Receive webhooks locally

1

Sign in and choose an organization

Terminal
Pick the organization you want to receive events for. See Authentication for details.
2

Start listening

Point the CLI at the URL your webhook handler listens on:
Terminal
3

Set the webhook secret

Events are signed with the secret shown in the banner, exactly like production deliveries. Configure your handler with it so signature verification passes:
.env
Every webhook event for the organization is now forwarded to your URL with the same headers and body a public endpoint would receive, and each delivery is logged with its status code and duration. The connection reconnects on its own if it drops. Press Ctrl+C to stop.
Events follow the active organization’s environment. Listen with a sandbox organization while developing, and switch with polar auth org when you need production events.

Trigger sample events

With polar listen running in one terminal, send a sample event from another:
Terminal
The CLI generates a realistic payload for the event, delivers it through your listen session, and reports where it went. Nothing is created in your organization. Run it without an event name to pick one from a list, or print the catalog:
Terminal

Shape the payload

Override any field with path=value, repeating the flag as needed. Values are sent as text unless you pass null, a JSON object, an array or a quoted string:
Terminal
Generated IDs and values are random on every run. Pass any integer as --seed to make them deterministic, so the same seed always produces the same payload, which is handy for scripted tests:
Terminal

Inspect without sending

Print the payload instead of delivering it:
Terminal

Next steps

  • Webhook events documents every event and its payload.
  • Delivery explains signatures, retries and timeouts for production endpoints.