Learn how to accept USDT payments on the TRON blockchain with Pulse2Pay's payment gateway. This guide covers everything from account setup to production deployment.
Prerequisites
Before you begin, you'll need:
Step 1: Get Your API Credentials
pk_live_) and API Secret (sk_live_)Important: Your API Secret is shown only once. Store it securely and never expose it in client-side code.
Step 2: Create a Payment
To create a payment, send a POST request to our API:
curl -X POST https://api.pulse2pay.com/api/merchant/v1/payments \
-H "Content-Type: application/json" \
-H "X-Pulse2Pay-Key: pk_live_your_api_key" \
-H "X-Pulse2Pay-Signature: your_hmac_signature" \
-H "X-Pulse2Pay-Timestamp: 1705320000000" \
-d '{
"amount": "100.00",
"currency": "USDT",
"network": "TRON",
"tokenStandard": "TRC20",
"metadata": {
"customer_email": "[email protected]"
}
}'
The response includes a unique TRON address for the customer to send USDT:
{
"paymentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending",
"amount": "100.00",
"currency": "USDT",
"network": "TRON",
"generatedAddress": "TXyz...abc123",
"expiresAt": "2025-01-15T12:30:00.000Z"
}
Step 3: Display Payment Instructions
Show the customer:
Step 4: Handle Webhooks
When the payment is confirmed, we'll send a webhook to your endpoint:
{
"id": "evt_a1b2c3d4_1705078500000",
"type": "payment.confirmed",
"createdAt": "2025-01-15T12:05:00.000Z",
"data": {
"paymentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "confirmed",
"amount": "100.00",
"currency": "USDT",
"network": "TRON",
"netAmount": "99.00",
"feeAmount": "1.00",
"txHash": "abc123...",
"generatedAddress": "TXyz...abc123",
"confirmations": 19
}
}
Always verify the webhook signature before processing. See our webhook security guide for details.
Step 5: Verify Payment Status
You can also poll the payment status:
curl https://api.pulse2pay.com/api/merchant/v1/payments/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "X-Pulse2Pay-Key: pk_live_your_api_key" \
-H "X-Pulse2Pay-Signature: your_hmac_signature" \
-H "X-Pulse2Pay-Timestamp: 1705320000000"
Best Practices
idempotencyKey to prevent duplicate payments