Make Your First Test Payment

Create a test invoice in sandbox, send testnet USDT, and verify the webhook.

Make Your First Test Payment

Create a test invoice, pay it with testnet USDT, and verify the webhook.


Prerequisites

  • Sandbox account at https://sandbox.3pa-y.com/
  • Sandbox API key (from Settings > API Keys)
  • Testnet USDT + gas tokens (Sepolia ETH or Nile TRX)

Step 1: Create a Test Invoice

const response = await axios.post(
  "https://sandbox-api-url/api/v1/transaction/create",
  { email: "[email protected]", firstName: "Test", lastName: "User" },
  {
    params: { currencyType: "USDT-TRC20", amount: 5, timer: 30 },
    headers: { apikey: "your-sandbox-api-key" }
  }
);

console.log("Payment URL:", response.data.url);
console.log("Transaction ID:", response.data.transactionId);

Step 2: Send Testnet USDT

  1. Open the payment URL
  2. Send at least 5 USDT to the displayed address on the correct testnet
  3. Page polls every 5 seconds and updates on confirmation

Step 3: Receive & Verify Webhook

Your webhook endpoint receives a POST with the transaction details. Verify the X-Webhook-Signature header using your webhook secret.

Get your secret: POST /api/v1/webhook/secret/rotate (shown once) Verification code examples: Webhook Handling


Step 4: Verify via API (Optional)

const status = await axios.get(
  "https://sandbox-api-url/api/v1/public/transaction/verify",
  {
    params: { transactionId: "your-transaction-id", type: "deposit" },
    headers: { apikey: "your-sandbox-api-key" }
  }
);
// "confirmed", "initiated", or "failed"

Checklist

  • Payment page shows "Confirmed"
  • Webhook received with status: "confirmed"
  • Webhook HMAC signature validates
  • GET /transaction/verify returns confirmed

Troubleshooting

IssueSolution
Payment not detectedConfirm correct testnet (Nile / Sepolia)
Invoice expiredCreate new invoice with longer timer
Webhook not receivedSet URL in Dashboard > Settings > Webhooks
Signature mismatchRotate secret, update verification code

Next