JamiDev

Sandbox

Test checkouts, webhooks and benefits end to end without moving real money.

Sandbox is a setting on an organization, not a separate server. A sandbox organization uses the same API, the same URLs and the same dashboard as production, but every payment is simulated. New organizations start in sandbox; switch in Settings → Environment.

Test phone numbers

Use these as customer.phone on a sandbox checkout:

PhoneResult
251900000001Pays instantly. The order is created, benefits are granted and webhooks fire.
251900000002Fails instantly. The session expires and no order is created.
Any other numbercheckoutUrl opens a simulator page with Approve payment, Fail payment and Cancel and go back.

The simulator drives the same order logic as a real payment notification. Approving twice still creates exactly one order.

What changes in sandbox

SurfaceIn a sandbox organization
CheckoutAlways returns mode: "redirect". With a gateway, checkoutUrl goes to the simulator, never to a real gateway. Without one, it's a payment link; the phone the buyer enters there picks the outcome the same way.
Orders and sessionsStamped environment: "sandbox" when created. Switching the organization later doesn't relabel them.
EarningsShown on the Overview, but can't be withdrawn and never mix with production numbers. GET /balance returns eligible: false.
API tokensIssued as jamidev_test_….
WebhooksDelivered normally, with "livemode": false.
EmailsBuyer receipts are suppressed. You, the owner, get a [TEST]-prefixed sale email.
SubscriptionsNo wallet money moves and no KYC is checked, so you can subscribe to your own plan. Run renewals on demand with simulateRenewal.

Switching environments

You can switch either way at any time, per organization. Only checkout sessions created after the switch are affected.

  • Sandbox → production. New checkouts charge real money. Existing test data stays labeled sandbox.
  • Production → sandbox. New checkouts on your live links become simulated, and buyers aren't charged. Production history is untouched.

Tokens are tied to an environment

A token keeps the environment it was created in. After a switch it returns 401 with a message telling you to create a new token, so a leftover test token can never touch live data. The SDK sets JamiAuthError.hint when this happens.

Testing webhooks locally

Your laptop isn't reachable from the internet, so for local work either:

  • tunnel a public URL to your machine (for example cloudflared tunnel --url http://localhost:3000) and register it under Automation → Webhooks in the sandbox organization, or
  • generate signed events yourself with jami_create_test_webhook from the MCP server, which can POST them straight to http://localhost:….

On this page