Webhook For USDT


Receiving Webhooks

When a USDT payment is validated, PentrraWallet automatically sends a POST request to the webhook_url you have configured in your developer dashboard.


Webhook Request

Method: POST Content-Type: application/json

Headers

HeaderDescription
X-PentrraWallet-SecretYour secret key — use this to verify the webhook comes from PentrraWallet
User-AgentPentrraWallet-Webhook/1.0

Body

{
  "event": "usdt.payment.validated",
  "mode": "live",
  "tx_hash": "f5881ec15f8f8c3547ed82c4b6cd8d4e1d7aaa33f23fd4e2b1c9a7e6d3f0b85a",
  "from_address": "TXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "to_address": "TA5rWCgN7ByNjneX4vbQrVxk7h81ng5AzH",
  "amount_sent": 50.00,
  "fixed_fee": 1.50,
  "variable_fee": 1.50,
  "fee": 3.00,
  "amount_credited": 47.00,
  "network": "TRC-20",
  "trx_id": "RECVABC1234567",
  "block": 65123456,
  "secret_key": "sk_live_xxxxxxxxxxxx",
  "platform": "PentrraWallet",
  "timestamp": "2026-05-10T20:00:00+00:00"
}

Sandbox webhook body

{
  "event": "usdt.payment.validated",
  "mode": "sandbox",
  "tx_hash": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
  "amount_sent": 25.00,
  "fixed_fee": 1.50,
  "variable_fee": 0.75,
  "fee": 2.25,
  "amount_credited": 22.75,
  "network": "TRC-20",
  "trx_id": "SBRECVABC1234567",
  "secret_key": "sk_live_xxxxxxxxxxxx",
  "simulated": true,
  "platform": "PentrraWallet",
  "timestamp": "2026-05-10T20:00:00+00:00"
}

Verifying the Webhook

Always verify that the webhook comes from PentrraWallet before processing it. You can do this in two ways:

Option 1 — Check the header

$secret = $_SERVER['HTTP_X_PENTRRAWALLET_SECRET'] ?? '';

if ($secret !== 'sk_live_xxxxxxxxxxxx') {
    http_response_code(401);
    exit('Unauthorized');
}

Option 2 — Check the body

$body = json_decode(file_get_contents('php://input'), true);

if (($body['secret_key'] ?? '') !== 'sk_live_xxxxxxxxxxxx') {
    http_response_code(401);
    exit('Unauthorized');
}

Replace sk_live_xxxxxxxxxxxx with your actual secret key from your dashboard.


Responding to the Webhook

Your endpoint must return an HTTP 200 status within 10 seconds. If it does not respond in time, the webhook will not be retried — make sure your endpoint is fast and reliable.

http_response_code(200);
echo 'OK';

Field Reference

FieldTypeDescription
eventstringAlways usdt.payment.validated
modestringlive or sandbox
tx_hashstringThe validated transaction hash
from_addressstringSender wallet address (live only)
to_addressstringPentrraWallet deposit address
amount_sentfloatGross amount received in USDT
fixed_feefloatFixed platform fee ($1.50)
variable_feefloatVariable fee (3% of amount sent)
feefloatTotal fee deducted (fixed_fee + variable_fee)
amount_creditedfloatNet amount credited to your balance
networkstringAlways TRC-20
trx_idstringInternal PentrraWallet transaction ID
blockintegerTRON block number (live only)
secret_keystringYour secret key for verification
simulatedbooleanPresent and true in sandbox only
platformstringAlways PentrraWallet
timestampstringISO 8601 datetime

Important: Never expose your secret_key publicly. Store it securely as an environment variable on your server.