Create a USDT payment link and verify a webhook

Go from an API key to a hosted payment page in four steps.

1. Get your API key

Request beta access with your project name, website or short description, payment use case, estimated payments per day, and integration contact. Follow the application steps. After approval, store the API key in your backend environment as DEDYX_API_KEY. Keep it out of browser bundles, URLs and source control.

2. Configure your webhook

PUT/api/v1/merchant/webhook

Rate limit: 10 requests / 60 seconds (shared webhook settings · per merchant). Shared counters and additional IP limits.

cURL
curl -X PUT https://api.dedyx.com/api/v1/merchant/webhook \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://your-company.example/webhooks/dedyx"}'

A webhook is required before creating payments. Use a public HTTPS endpoint on port 443. The first response includes your own signing_key: save it securely now, because it is shown once. Configure the receiver to verify signatures before processing events.

3. Create a payment page

POST/api/v1/payments

Rate limit: 30 requests / 60 seconds (creation · per merchant). Shared counters and additional IP limits.

cURL
curl -X POST https://api.dedyx.com/api/v1/payments \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: order-1024' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": "49.00",
    "merchant_wallet": "TRzsBvFUhcvsy45ebmaKZ9EXw7zUorVkUm",
    "description": "Order #1024"
  }'

Use a TRON address you control, an exact decimal amount and a new Idempotency-Key for each order. For a retry, reuse the same key and request body.

201 Created · selected fields
{
  "payment_id": "pay_0123456789abcdef0123456789abcdef",
  "expected_amount": "49.00",
  "status": "PENDING",
  "payment_url": "https://pay.dedyx.com/checkout/pay_0123456789abcdef0123456789abcdef"
}

Redirect your customer to the returned payment_url. The default payment window is 30 minutes. The page handles the QR code and status updates.

4. Fulfil after a verified event

Receive the PAID webhook on your backend. Verify its HMAC signature, match the payment ID and amount to your order, and atomically record the event ID with your fulfilment action. Return 2xx for an already processed event.

Never fulfil an order based only on a browser redirect or a screenshot. Your backend can reconcile status using the authenticated payment details endpoint.

Next: Authentication

Test a payment without sending USDT

Use the test API key from your secure credentials delivery. Existing merchants can request sandbox access from support. Never put an API key in a browser or send it in Telegram.

The sandbox base URL is https://api.dedyx.com/api/v1/sandbox. Live endpoints accept only live keys; sandbox endpoints accept only sk_test_ keys.

Configure a separate public HTTPS test webhook on port 443. Save test_webhook_signing_key and test_webhook_key_id from your credentials file; they are different from the live signing key. Registration does not send a webhook.

Create a test payment with a decimal-string amount, optional description and required Idempotency-Key. No wallet is accepted. Open payment_url and press “Simulate successful payment”. Never send funds to a sandbox page.

Sandbox
curl -X PUT https://api.dedyx.com/api/v1/sandbox/merchant/webhook \
  -H "X-API-Key: $DEDYX_TEST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://merchant.example/webhooks/dedyx-test"}'

curl -X POST https://api.dedyx.com/api/v1/sandbox/payments \
  -H "X-API-Key: $DEDYX_TEST_API_KEY" \
  -H "Idempotency-Key: test-order-001" \
  -H "Content-Type: application/json" \
  -d '{"amount":"4.74","description":"Test order 001"}'

Simulation changes only the test payment to PAID and queues one signed event. Repeating simulation does not create another event. For an automated test, POST /payments/{test_payment_id}/simulate-paid.

Test events contain livemode: false, type: payment.paid, test_pay_ payment IDs, test_evt_ event IDs and transaction_id: null. Verify the original request bytes with the test signing key, validate timestamp and event ID, then deduplicate and commit before returning 2xx.

Use a separate test-order database or handler. A test webhook must never fulfil a real order. Sandbox does not verify TRON transfers, wallet compatibility, network fees or real funds.

Check GET /payments/{test_payment_id}/webhooks with your test API key. pending means queued or retrying; delivered means the receiver returned HTTP 2xx; failed means attempts were exhausted. PAID alone does not mean delivery. Confirm business processing in your receiver logs.

An exhausted undelivered test event can be retried with POST /merchant/webhook/events/{test_event_id}/retry. Event ID and payload stay unchanged. Pending and delivered events return 409.

Test payments expire after 30 minutes and are removed after seven days. Creation allows 10 requests per minute, 100 payments per rolling 24 hours and 1,000 retained payments per merchant. Read/public status: 60 per minute; simulation: 10 per minute; settings, rotations and retries: 5 per minute. Separate nginx IP limits also apply.

Sandbox payments do not consume live beta quotas, reserve wallets, scan TRON or enter financial statistics. The merchant must be active; sandbox creation does not require live beta activation.

Rotate test API credentials with POST /merchant/rotate-key and the test_secret_key in the secret-key header. Rotate test webhook signing keys with POST /merchant/webhook/rotate-key and X-API-Key. Securely save each returned secret; old API keys stop working immediately and new webhook attempts use the current test URL and signing key.