Test mode (Sandbox)
A single deployment provides both live mode and test mode. Business systems integrate with a test API key: test orders are paid on testnets only, test events go to a separate test webhook, and test data and live data cannot see each other. Going live only requires replacing the API key and the webhook secret with the live ones; endpoints and event formats are identical.
Differences between the modes
Section titled “Differences between the modes”| Live mode | Test mode | |
|---|---|---|
| API key | fpk_live_… (early fpk_… keys are live as well) |
fpk_test_… |
| Networks | Mainnets (Ethereum, Base, BNB Smart Chain and others) | Testnets (Sepolia, Base Sepolia and others); local development chains serve both modes |
| Objects and events | livemode: true |
livemode: false |
| Webhook | Console, “Developers → Webhooks” (live) | The webhook settings shown after switching the console to test mode, with a separate endpoint and secret |
| Return signature | Live webhook secret | Test webhook secret |
| Checkout | — | A “test mode” banner at the top |
| Receipt emails | — | Subject prefixed with “[测试]” / “[Test]” |
| Amount limits | Applied | Not applied |
| Risk address screening | The merchant’s list, the OFAC list, URL feeds and named lists, sanctions oracles, third-party providers | Local lists only (the merchant’s list, OFAC, URL feeds and named lists; a test wallet can be listed to rehearse the refusal flow) |
| Risk address list API | Reads and writes every entry | Reads every entry; writes, replaces and removes only entries scoped to a testnet chain (403 testnet_only) |
| Alerts | Alert center and its channels | Marked as test data in the console’s alert list; system.* events go to the test webhook and not to alert channels |
Both modes share the configuration: chains and tokens, payees and split rules, plans, the risk address list, the checkout appearance and the legal pages. The same plan_id, payee_ref and split_rule_id work in either mode.
The risk address list is installation-wide configuration, so entries written by a test key must be scoped to a testnet (a chain_id whose network type is testnet). Exercising POST /v1/risk/addresses and the bulk import therefore does not change the screening of live payments, while test payers on testnets are still blocked or flagged by those entries. Local development chains accept payments in both modes and are not testnets, so a test key cannot write entries for them. merchant_order_no is unique within each mode, so a test order may reuse a live order’s number.
Reading a live order with a test key (or the reverse) answers 404. GET /v1/events lists only the key’s mode’s events (positions are shared by both modes, so numbers are skipped).
Obtaining a test API key
Section titled “Obtaining a test API key”- Console, “Developers → API keys”: choose “Test” when creating the key (step-up verification required).
- On the server:
flowpayra-lite apikey create --name ci --mode test. - Local development environment:
make devnetprints both a live and a test key (devnet/.state/api-key,devnet/.state/test-api-key).
Preparing a testnet
Section titled “Preparing a testnet”-
In the console under “Chains & tokens → Add chain”, enter the testnet’s chain ID. Built-in testnets fill in the name, block time and confirmations automatically and are marked as testnets:
Testnet Chain ID Native coin Faucet Sepolia 11155111 ETH Sepolia faucets by Google Cloud Web3, Alchemy, Infura and others Base Sepolia 84532 ETH Coinbase Developer Platform faucet, or bridge from Sepolia Arbitrum Sepolia 421614 ETH The official Arbitrum bridge (from Sepolia), Alchemy faucet OP Sepolia 11155420 ETH Superchain faucet Polygon Amoy 80002 POL Polygon faucet BNB Smart Chain Testnet 97 tBNB The official BNB Chain faucet Avalanche Fuji 43113 AVAX Avalanche Builder Hub faucet X Layer Testnet 1952 OKB OKX developer faucet For other chains, set the network type to testnet when adding the chain. A chain’s network type can also be changed on the “Chains & tokens” page (step-up verification required); new quotes, sponsored transactions and keeper charges are then routed by the new type.
-
Deploy the merchant contracts on the testnet as you would on a mainnet (the contract deployment checklist, or
flowpayra-lite deploy all --rpc …followed byflowpayra-lite signer verifyto record them) and list a test stablecoin (for example the test USDC that Circle issues on Sepolia and Base Sepolia, available from the Circle faucet). See Chains and contracts. -
Payee addresses apply per chain: a payee’s common address is used on testnets as well, or a separate address can be registered for a testnet.
-
If gas sponsorship is needed, fund the hot wallet with the testnet’s native coin.
The test mode webhook
Section titled “The test mode webhook”- Switch the mode to “Test” at the top of the console; a test mode notice appears at the top of the page.
- In the webhook settings shown in test mode, enter the test environment’s endpoint URL and replace the signing secret to obtain the test secret
whsec_…(shown once). - Verification is the same as for the live webhook (see Webhooks: signature verification), only with a different secret; the top-level
livemodeof the event body isfalse. - Return URLs of test orders are signed with the test secret.
Live and test events are each delivered in order: a failing receiver in one mode does not affect the other.
Deleting test data
Section titled “Deleting test data”The console page “Developers → Test mode” shows how much test data exists. “Delete all test data” removes every test order, subscription (including charge records), refund, help ticket, event and alert. The action requires the admin role and step-up verification, is recorded in the audit log, and notifies the other admins. Test API keys, the test webhook and the shared configuration are kept. On-chain test subscriptions remain on the testnet, and the system no longer charges them.

Local development chains
Section titled “Local development chains”The two local Anvil chains (31337 and 31338) are local development chains: both live and test mode accept payments on them, which allows rehearsing both modes without a public testnet. make devnet prints two keys and two webhook secrets; DEVNET_SEED_ARGS="--test-webhook-url http://127.0.0.1:9998/hook" also sets the test webhook endpoint.