Environments

PayDirect provides two environments: Sandbox for testing and Live for production. Both use the same API endpoints but behave differently.

Environment Overview
FeatureSandboxLive
Key Prefixpd_test_pd_live_
Base URLhttps://paydirect.com/api/v1 (same for both)
On-chain TransactionsNo (simulated)Yes (real Base mainnet)
Fee DeductionCalculated but not collectedCollected on-chain to treasury
Payment LifecycleInstant (auto-completes all stages)Real-time (waits for on-chain confirmations)
WebhooksFired instantly for all eventsFired when actual status changes occur
Rate LimitsSame 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 returns verified: 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); // true
Live
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 pending and 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.