Skip to main content
Build and test everything in the sandbox first. Charges there are simulated, so no real money moves. This page gets you a sandbox key, the CLI, a server SDK and a working first request.

Switch to the sandbox

In your dashboard, open the organization switcher dropdown at the top left and select Sandbox. The dashboard reloads with your sandbox account and its own balance, charges and settings. To switch back, select your organization name from the same dropdown. The sandbox is entirely separate from your live account. None of these are shared between the two:
  • Balance and charge history
  • Customers and payment methods
  • Payout destinations
  • Webhook endpoints and event history
  • API keys
See Test your integration for the full sandbox reference.

Create a sandbox key

While you are in the sandbox, open the developer section of the dashboard and click Create secret key. Give the key a name and the scopes your integration needs. A key cannot reach any endpoint outside its scopes. Sandbox keys start with sk_sandbox_ and route to https://sandbox-api.bachs.io. Production keys start with sk_live_ and only work after your account is verified. Keep the key in an environment variable, never in source control or client code:
Set your key
See Get your API keys for scopes and security practices.

Install the CLI

The Bachs CLI is a single binary with no runtime to install first.
Then pair it with your sandbox account. The command prints a code and opens your browser; approve the request in the dashboard after checking the code matches.
Pair against sandbox
See Bachs CLI for other install options and how credentials are stored.

Install a server SDK

The official SDKs run on your server only. The Node.js SDK needs Node.js 22 or later, and the Python SDK needs Python 3.10 or later.
Create the client with your sandbox key and environment: "sandbox". See the Node.js SDK and the Python SDK for setup, including pnpm, yarn, uv and Poetry.

Forward webhooks to your machine

Bachs confirms payments with webhook events. While you build, forward live sandbox events to a local port. The connection opens outbound, so you need no public URL and no tunnel.
Forward every event
Add --events with a comma-separated list to forward only some event types. See Test webhooks locally for the signing secret and verifying a real signature.

Make your first request

Send your sandbox key as a Bearer token. This lists your products:
Sandbox
If the key works, you get a 200 and your products in items. A sandbox you have just created has none yet, so the list is empty until you create a product. A 401 means the key is wrong or missing; see Get your API keys. When you go live, the request is the same against https://api.bachs.io with an sk_live_ key.

Next steps

  • Accept a payment with Checkout: create a hosted checkout and confirm the payment with a webhook.
  • Test webhooks locally: receive live events on your machine and verify a real signature.
  • Bachs CLI: every command for working with your integration from the terminal.
  • SDKs: the official server SDKs, the browser checkout overlay and community SDKs.