Skip to content

Testing & Sandbox

Testing & Sandbox

Use our sandbox environment to test your integration before going live. Test with real blockchain transactions on testnets—no real cryptocurrency required.

Testnet Mode

Sandbox mode is automatically enabled when using test API keys:

Key PrefixEnvironmentNetwork
pk_test_*, sk_test_* Sandbox Bitcoin Testnet, Ethereum Sepolia
pk_live_*, sk_live_* Production Bitcoin Mainnet, Ethereum Mainnet

Getting Test Coins

You'll need testnet coins to simulate payments:

Bitcoin Testnet

Search 'Bitcoin testnet faucet' for free tBTC

Sepolia ETH

Use Alchemy, Infura, or other Sepolia faucets

Testnet Stablecoins

Contact support for testnet USDT/USDC

Simulating Payments

  1. Create Test Checkout

    Use your test public key to create a checkout session

  2. Open Checkout

    Complete the checkout flow as a customer would

  3. Send Test Payment

    Use a testnet wallet to send the exact amount

  4. Verify Webhooks

    Confirm your webhook handler receives test events

Testing Webhooks

For local development, expose your webhook endpoint:

  • Use ngrok or similar to create a public URL
  • Configure the public URL in SanPay settings
  • Monitor incoming requests in your local logs

Pre-Production Checklist

  • ✅ Create payment and receive PAYMENT_CONFIRMED webhook
  • ✅ Handle PAYMENT_EXPIRED gracefully
  • ✅ Verify webhook signature validation works
  • ✅ Test underpayment and overpayment scenarios
  • ✅ Confirm order status updates correctly
  • ✅ Test error handling and user messaging