Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.swiftpay.finance/llms.txt

Use this file to discover all available pages before exploring further.

SwiftPay provides a complete sandbox environment for development and testing. Build with confidence — test all payment flows, error scenarios, and edge cases before deploying to production.

Quick Reference

ItemSandboxProduction (coming soon)
API URLhttps://sandbox-api.swiftpay.financehttps://api.swiftpay.finance
Portaldev.cockpit.swiftpay.financecockpit.swiftpay.finance
API Key Prefixsk_test_...sk_live_...
Publishable Keypk_test_...pk_live_...
Webhook Secrettest_whsec_...whsec_...

Getting Started with Sandbox

1. Access the Sandbox Portal

Visit the Sandbox Developer Portal to:
  • Create a sandbox merchant account
  • Generate API keys (sk_test_* and pk_test_*)
  • View test transactions and webhooks
  • Configure webhook endpoints
Use a different account or separate workspace for sandbox vs. production to avoid mixing test and live data.

2. Get Test Funds

Test payments require testnet USDC. Get test funds from public testnet faucets:

Ethereum Sepolia

Get test ETH, then wrap as USDC

Polygon Mumbai

Get test MATIC and USDC

Base Sepolia

Get test ETH and tokens

Solana Devnet

Get test SOL

Circle Faucet

Get test USDC on multiple chains

Google Web3 Faucet

Get test tokens for various testnets

3. Make Your First Test API Call

curl -X GET "https://sandbox-api.swiftpay.finance/v1/utils/chains" \
  -H "Content-Type: application/json"
Response:
[
  {
    "id": "ethereum-sepolia",
    "name": "Ethereum Sepolia",
    "chainId": 11155111,
    "isTestnet": true
  },
  {
    "id": "polygon-mumbai",
    "name": "Polygon Mumbai",
    "chainId": 80001,
    "isTestnet": true
  }
]

4. Create a Test Invoice

import { SwiftPay } from '@swiftpayfi/api-client';

const client = new SwiftPay({
  secretKey: 'sk_test_your_sandbox_key',
  baseUrl: 'https://sandbox-api.swiftpay.finance',
});

const { invoice } = await client.invoices.create({
  amount: '10.00',
  token: 'USDC',
  network: 'ethereum-sepolia',
  recipients: { evm: '0xYourTestWallet...' },
  externalRef: 'test_order_001',
});

console.log(`Test invoice: ${invoice.id}`);

Key Differences from Production

Testnet Networks

Sandbox uses testnet versions of blockchains:
  • Ethereum Sepolia (chainId: 11155111)
  • Polygon Mumbai (chainId: 80001)
  • Solana Devnet
  • Tron Shasta
All transactions are on test networks and have no real value.

Test Data Isolation

  • Sandbox and production accounts are completely separate
  • Sandbox invoices, webhooks, and keys don’t affect production
  • Test transactions won’t appear in production dashboards

Webhook Testing

Test webhook deliveries in the Sandbox Portal:
  1. Go to Settings → Webhooks
  2. Create a webhook endpoint (e.g., https://localhost:3000/webhooks)
  3. Use the test_whsec_* secret to verify signatures
  4. Click Send Test Event to simulate payment events
Quick testing services:
  • webhook.site — Instantly get a unique webhook URL for testing (no setup required)
  • ngrok — Tunnel your local server to a public URL for production-like testing
For local development, webhook.site is the fastest way to start inspecting webhook payloads.

Best Practices

🔑 Manage Keys Safely

Store API keys in environment variables, never in code or version control. Keep sk_test_* and sk_live_* separate.

🧪 Test All Flows

Use sandbox to test happy paths, error handling, timeouts, and edge cases before production.

🔄 Use Different Wallets

Use different test wallet addresses for different payment scenarios (success, timeout, low-balance, etc).

📊 Monitor Webhooks

Verify webhook signatures and test retry behavior with the Sandbox Portal’s webhook logs.

Switching to Production

When ready to go live:
  1. Generate production keys in cockpit.swiftpay.finance
  2. Update environment variables to use sk_live_* and pk_live_*
  3. Change API URL to https://api.swiftpay.finance
  4. Update network from testnet (e.g., ethereum-sepolia) to mainnet (e.g., ethereum)
  5. Test in production with small amounts before full deployment
// Environment-based configuration
const client = new SwiftPay({
  secretKey: process.env.SWIFTPAY_SECRET_KEY,
  baseUrl: process.env.SWIFTPAY_API_URL || 'https://api.swiftpay.finance',
});

const network = process.env.NODE_ENV === 'production' 
  ? 'ethereum'  // mainnet
  : 'ethereum-sepolia';  // testnet

Sandbox Limitations

  • No real money transfers — all transactions are on test networks
  • Rate limits may be higher than production
  • Data retention — sandbox data may be reset periodically
  • Testnet faucets may have daily limits — plan test cycles accordingly

Support

  • 📖 See API Reference for detailed endpoint documentation
  • 🆘 Contact support at support@swiftpay.finance for sandbox-specific issues
  • 🐛 Report bugs with test data to help us improve the sandbox experience