Environments
PayDirect provides two environments: Sandbox for testing and Live for production. Both use the same API endpoints but behave differently.
Environment Overview
| Feature | Sandbox | Live |
|---|---|---|
| Key Prefix | pd_test_ | pd_live_ |
| Base URL | https://paydirect.com/api/v1 (same for both) | |
| On-chain Transactions | No (simulated) | Yes (real Base mainnet) |
| Fee Deduction | Calculated but not collected | Collected on-chain to treasury |
| Payment Lifecycle | Instant (auto-completes all stages) | Real-time (waits for on-chain confirmations) |
| Webhooks | Fired instantly for all events | Fired when actual status changes occur |
| Rate Limits | Same limits apply (Free: 100/min, Pro: 1,000/min) | |
Sandbox
Sandbox Environment
For development and testing
When you create a payment with a pd_test_ key, the payment instantly progresses through the full lifecycle:
pending → detected → confirmed → forwarded (all within milliseconds)- No real cryptocurrency is moved. No blockchain transactions occur.
- Fee amounts are calculated and returned in the response, but not actually collected.
- Webhooks fire immediately for all subscribed events.
- Verification (
POST /api/v1/verify) immediately returnsverified: true.
// Sandbox: payment completes instantly
const { payment } = await client.createPayment({
tokenSymbol: "USDC",
amount: "50.00",
merchantWallet: "0xYourAddress...",
});
console.log(payment.status); // "forwarded" (already settled!)
const { verified } = await client.verifyPayment(payment.id);
console.log(verified); // trueLive
Live Environment
For production with real Base mainnet transactions
When you create a payment with a pd_live_ key, real on-chain settlement occurs on Base mainnet:
- Payment starts as
pendingand waits for a real on-chain transfer to the receiving address. - The blockchain monitor detects incoming transfers and updates the status to
detected. - After block confirmations, the status becomes
confirmed. - The forwarding service sends the net amount to the merchant wallet and the fee to the PayDirect treasury on Base.
- If no transfer arrives within the expiry window, the payment becomes
expired.
Switching Environments
Via Dashboard
Use the environment toggle in the Dashboard header to switch between Sandbox and Live mode. This updates the displayed API keys, stats, and payment data.
Via API
Simply use the appropriate API key. The key prefix determines the environment automatically:
# Sandbox
Authorization: Bearer pd_test_abc123...
# Live
Authorization: Bearer pd_live_xyz789...Data Isolation
- Sandbox and live payments are stored separately and filtered by environment.
- A
pd_test_key cannot access live payments and vice versa. - Workspace wallets are shared between environments (same receiving address), but the settlement behavior differs.
