zendfi webhooks
zendfi listen
Options
How It Works
1
Start local server
The CLI starts an Express server on the specified port (default 3000) with two endpoints:
2
Detect tunnel service
The CLI checks for
ngrok and cloudflared on your system. If both are available, it prompts you to choose. If neither is installed, it shows installation links:- ngrok: ngrok.com/download
- cloudflared: Cloudflare Tunnel docs
3
Create tunnel
Launches the selected tunnel service pointing to your local port. The CLI waits up to 30 seconds for the tunnel URL to become available.
4
Display configuration
Shows the public webhook URL and setup instructions:
5
Log incoming events
Each webhook event is logged with a timestamp, event counter, event type, payment ID, status, and amount:
Forwarding
Use--forward-to to relay webhook payloads to your application’s actual webhook endpoint. This lets you test your real webhook handler while still seeing events in the CLI:
localhost:3000/api/webhooks/zendfi.
Tunnel Services
ngrok
The most popular option. The CLI reads the tunnel URL from ngrok’s stdout output. Free tier supports one tunnel at a time.Cloudflare Tunnel (cloudflared)
Free, no-signup alternative. Creates a*.trycloudflare.com URL automatically.
Shutdown
PressCtrl+C to gracefully shut down. The CLI closes the local server, kills the tunnel process, and shows the total number of webhooks received during the session.
Testing Workflow
A typical local webhook testing session:payment.created and payment.confirmed webhooks. The CLI logs them, forwards them to your app, and your webhook handler processes them as it would in production.