Recipe

Test a webhook locally with a tunnel

Test webhooks against local code without deploying. Expose your local server through a tunnel, register the tunnel URL as a sandbox endpoint, then drive test-mode actions and watch the deliveries hit your handler.

2 min read

TunnelExpose localhost
SandboxTest-mode events
livemode:falseHow to tell

1. Tunnel localhost

Run any HTTPS tunnel that maps a public URL to your local port. Copy the public HTTPS URL it prints.

your-tunnel http 3000
# -> https://random-name.tunnel.example -> localhost:3000

2. Register the tunnel URL

Register it as an endpoint in test mode and subscribe to * so you see everything. See Register a webhook endpoint.

3. Drive test events

Trigger the corresponding action in the sandbox — submit a test enquiry, run a test decision. Deliveries arrive with livemode:false so you can safely branch test vs live.

4. Inspect and iterate

Log the raw body and the verification result. Once the handler is solid, register the real production URL. See Sandbox and test data.

Frequently asked questions

How do I tell test events from live?

The envelope livemode is false for sandbox events. A strong handler rejects livemode:true on a test endpoint and vice versa.

Is the signature still enforced in test mode?

Yes. Test endpoints get their own signing secret and every delivery is signed. Verify exactly as in production.

Funding for UK limited companies

Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.