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
| Header | Description |
|---|---|
X-PentrraWallet-Secret | Your secret key — use this to verify the webhook comes from PentrraWallet |
User-Agent | PentrraWallet-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
| Field | Type | Description |
|---|---|---|
event | string | Always usdt.payment.validated |
mode | string | live or sandbox |
tx_hash | string | The validated transaction hash |
from_address | string | Sender wallet address (live only) |
to_address | string | PentrraWallet deposit address |
amount_sent | float | Gross amount received in USDT |
fixed_fee | float | Fixed platform fee ($1.50) |
variable_fee | float | Variable fee (3% of amount sent) |
fee | float | Total fee deducted (fixed_fee + variable_fee) |
amount_credited | float | Net amount credited to your balance |
network | string | Always TRC-20 |
trx_id | string | Internal PentrraWallet transaction ID |
block | integer | TRON block number (live only) |
secret_key | string | Your secret key for verification |
simulated | boolean | Present and true in sandbox only |
platform | string | Always PentrraWallet |
timestamp | string | ISO 8601 datetime |
Important: Never expose your
secret_keypublicly. Store it securely as an environment variable on your server.
