Skip to content

Test environments and local mocks

https://api.zwipe.co is production. https://sandbox.api.zwipe.co is the partner sandbox. Only the base URL decides which one you call: an example email, a small amount, or a key name never makes a production request a simulation.

Use DEMO_PUBLISHABLE_KEY (zw_pk_demo_restaurant) with the runnable example. The verification code is 123456 for both SMS and email. The example runs on iOS, Android and Expo Web.

The demo keeps its account, balance, transactions and Community interactions locally. Payments, card issuance, Wallet setup and gift purchases are simulated; no money moves and no messages are sent. Restaurant order and reservation buttons open the configured restaurant websites.

Use your restaurant publishable key for a hosted integration. Partner API credentials and mobile SDK publishable keys are separate credentials.

The sandbox runs the same API and contract as production against a simulated issuer. Nothing in it moves money or creates a real card. Ask your Zwipe contact for sandbox credentials; they are separate from production credentials and work only there.

The order amount’s cents choose the issuer’s answer, so you can rehearse each card status. Chain loads follow the same rule (failed / in_doubt / succeeded), and a load that would take the card’s balance above $5,000.00 fails with balance_limit; a sandbox balance includes every succeeded load. A chain card’s transactions list its first load and its succeeded loads only, since nothing spends a sandbox card. A wallet link points at the example host and provisions nothing:

amount_cents ends in Result
13 (for example 2513) failed, with error_code mock_refused
14 (for example 2514) in_doubt, with error_code provider_timeout: the issuer did not answer in time
anything else issued

Card IDs, balances, and wallet and collect links are simulated, and the example link hosts do not provision a real wallet card. Any code confirms a cardholder email, and no email is delivered. Confirmed emails are forgotten whenever the sandbox restarts or is redeployed, so confirm again if /v1/cardholders/email/verification/status reports verified: false. The email check always answers registered: false, and no other card error_code occurs. If your Zwipe contact sets a webhook URL on your sandbox account and gives you its signing secret, the sandbox sends real signed card.* events, so you can test your handler against card.failed and card.in_doubt. Sandbox data is test data with no backups.

Download these two files into the same directory:

With Node.js 22+, run:

Terminal window
node mock-demo.mjs

Expected output begins with:

Order accepted: pending
Order confirmed: issued
Balance: { ... balance_cents: 2500, currency: 'USD', ... }

The demo injects a fake fetch function and makes no network requests. Its credentials and card identifiers are inert local values. Change the fake responses to exercise your UI; the scenario guide lists the important cases.

Mock Zwipe behind your backend while using real application sessions and your test database. Verify that order references survive page refreshes, worker restarts, and response loss. Exercise your own customer ownership checks with two different test users.

For mobile work, mock your application routes or point the app at your development backend. Do not embed partner credentials in a mobile build even for development.

Agree with Zwipe on credentials, scopes, a funded restaurant, a permitted test customer/email, amount, and the expected operational reconciliation before making a live call. Use one persisted reference per purchase and record the returned IDs. Follow the go-live checklist.