Testing Payments & Taxes
Use the sandbox environment to test payments and tax calculations.
Testing Payments & Taxes
Bag provides a full sandbox environment for testing payments, tax calculations, and payout flows before going live.
Sandbox Environment
The sandbox uses test networks and never moves real funds. Use sandbox API keys (bag_test_sk_*) to access it.
| Feature | Sandbox Behavior |
|---|---|
| Stablecoin payments | Testnet USDC on Base Sepolia and Solana Devnet |
| Tax calculation | Real tax engine with test data |
| Webhooks | Delivered with "livemode": false |
| Settlements | Simulated payout flows |
| Dashboard | Separate test mode toggle |
Getting Testnet Funds
To test stablecoin payments, you need testnet USDC:
- Base Sepolia — Use the Base Sepolia faucet for ETH, then swap for testnet USDC
- Solana Devnet — Use the Solana faucet for SOL, then obtain devnet USDC
Testing Tax Calculations
The sandbox connects to the same tax engine (Numeral) used in production. You can test:
- Tax quotes for different customer jurisdictions
- Tax-inclusive vs. tax-exclusive pricing
- B2B exemptions with test VAT IDs
- Cross-border tax scenarios
Use the POST /api/tax/quote endpoint with sandbox keys to get tax breakdowns before checkout.
Testing Webhooks
Sandbox webhooks behave identically to production, with one difference: all payloads include "livemode": false. Use a tool like ngrok to expose your local server for webhook testing.
What's next
For a complete end-to-end testing walkthrough, see the Test Payments End-to-End guide.