EQGate sends webhooks to notify you of payment events in real-time.
Set your webhook URL in two ways:
- Default webhook - Configure in the Equidity Cloud dashboard
- Per-address webhook - Pass
callback_url when creating an address
Sent when a deposit is first detected:
{
"event": "deposit.detected",
"transaction_id": "tx_abc123",
"address": "TXabc123def456...",
"chain": "TRON",
"token": "USDT",
"amount": 100,
"tx_hash": "abc123def456...",
"timestamp": "2024-01-15T11:30:00.000Z"
}
Sent when deposit reaches required confirmations:
{
"event": "deposit.confirmed",
"transaction_id": "tx_abc123",
"address": "TXabc123def456...",
"amount": 100,
"fee": 1,
"net_amount": 99,
"confirmations": 19,
"timestamp": "2024-01-15T11:32:00.000Z"
}
Sent when funds are forwarded to your wallet:
{
"event": "deposit.completed",
"transaction_id": "tx_abc123",
"address": "TXabc123def456...",
"amount": 100,
"fee": 1,
"net_amount": 99,
"tx_hash": "abc123def456...",
"sweep_tx_hash": "def456ghi789...",
"timestamp": "2024-01-15T11:35:00.000Z"
}
All webhooks include a signature header for verification:
X-Webhook-Signature: sha256=abc123def456...
import crypto from 'crypto';
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return `sha256=${expected}` === signature;
}
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-webhook-signature'];
const payload = req.body.toString();
if (!verifyWebhook(payload, signature, process.env.EQGATE_API_SECRET)) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(payload);
// Handle event...
res.status(200).send('OK');
});
EQGate retries failed webhooks with exponential backoff:
| Attempt | Delay |
|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |