This guide assumes the CLI is installed and paired with your account. If it is not, install it and run
bachs login first. It takes about a minute.Start forwarding
Point the CLI at the port your handler listens on.Forward every event
Output
Forward two event types
Send yourself an event
Leavelisten running and open a second terminal. You do not need a real payment to exercise your handler:
Emit a sample event
collection.succeeded in production could have you fulfil an order nobody paid for.
You can also redeliver something that already happened:
Replay a past event
Terminal
✓ means your handler returned a 2xx. Anything else shows the status or the connection error inline, which is usually enough to find the problem without adding logging.
Verify the signature
This is the part worth getting right locally, because a handler that verifies incorrectly usually still looks fine until it starts rejecting live traffic. Each forwarded request carriesX-Bachs-Signature-V2 in the form t={timestamp},v1={signature}. Read the raw body before parsing it, because re-serializing JSON changes the bytes and breaks verification.
Verify a forwarded request
How it works
Your machine opens the connection outbound to Bachs, so nothing needs to reach you. There is no public URL, no inbound port, and no firewall change, and it works behind NAT and on corporate networks because it is an ordinary outgoing HTTPS connection. A session is a webhook destination like any other, so event filtering, delivery records, and the Events view all behave the same way. The only difference is the last step: instead of sending to a URL, Bachs hands the event to the connection your machine is holding, and the CLI sends it to your local port. PressCtrl-C and the session closes. Your registered destinations are untouched: starting a session changes nothing in your account, and stopping one leaves nothing behind. If your machine sleeps or loses its network, the CLI reconnects on its own and tells you while it is trying.
Replaying without the CLI
Replay is a plain API call and needs no session. It works against your registered destinations too, which makes it useful in production and not only while developing:Replay over HTTP
Response
Going live
Forwarding works against production too.bachs whoami tells you which environment you are paired with, and the CLI marks a live session so you can tell the two apart while forwarding.
Your customers’ real events reach your machine on a live session, so use the sandbox unless you have a reason not to.
Once your handler is deployed, register its URL as a destination and it receives events the same way, with retries. See Setting up webhooks.
Next steps
- Bachs CLI for everything else the CLI does, including calling any API operation from the terminal.
- Setting up webhooks for registering a destination your server can receive on.
- Replay webhook events for the full replay API, including lookup by charge or reference.
- Events to inspect deliveries and responses in the dashboard.

