Reference
Webhooks
How you find out a payment settled when nobody is polling: delivery, signatures and every payload.
Payloads
A delivery on the wire, exactly as it arrives — the body is one line of JSON and it is those bytes
that are signed, so this is what your handler has to hash before it parses anything:
POST /time2pay/webhook HTTP/1.1
Host: api.shop.example
Content-Type: application/json
X-Webhook-Event: payment.completed
X-Webhook-Id: 01J8ZQ8A1B2C3D4E5F6G7H8J9K
X-Idempotency-Key: 2775f41a05cbb6a87521c01b933169ff389fce4b11e3b852ed7c36e724221956
X-Webhook-Timestamp: 1785933667
X-Webhook-Key-Id: ak_7f2c9d41
X-Webhook-Signature: 94470414565125a881752a41731333ffa067d57f81513dbcd95d5dc02e6b2495
{"event":"payment.completed","session_id":"01J8ZQ7K4M2X9F3B6D0T5R8W1C","merchant_id":"acme-shop","player_id":"player-77421","external_order_id":"ORD-2026-000188","network":"eth","token":"USDT","amount":"250.000000","status":"completed","tx_hash":"0x9f2c4e1a7b3d5f8e0c6a2b4d7e9f1c3a5b7d9e1f2c4a6b8d0e2f4a6c8b0d2e4f","order_ref":"a7f3c9d1","occurred_at":"2026-08-05T12:41:07Z"}
A payout delivery carries the same headers with X-Webhook-Event: payout.completed,
its own X-Idempotency-Key and X-Webhook-Id, and a timestamp and signature
of its own. The bodies of each event are below, formatted.
Which fields are always there. A deposit event always carries
event, session_id, merchant_id, status and
occurred_at; a payout event the same five with payout_id in place of
session_id; a wallet deposit event, deposit_id,
player_id, the amounts and occurred_at. Everything else is omitted when
empty rather than sent as null — payment.failed, for instance, usually
arrives with no tx_hash at all. Read them as optional and your handler survives an
event that never got that far.
POST
payment.completed
no signature
A deposit settled
Sent to your callback URL when a deposit session reaches the required confirmation depth. Signed with your API key secret. Deduplicate on X-Idempotency-Key.
Body
{
"event": "payment.completed",
"session_id": "01J8ZQ7K4M2X9F3B6D0T5R8W1C",
"merchant_id": "acme-shop",
"player_id": "player-77421",
"external_order_id": "ORD-2026-000188",
"network": "eth",
"token": "USDT",
"amount": "250.000000",
"status": "completed",
"tx_hash": "0x9f2c4e1a7b3d5f8e0c6a2b4d7e9f1c3a5b7d9e1f2c4a6b8d0e2f4a6c8b0d2e4f",
"order_ref": "a7f3c9d1",
"occurred_at": "2026-08-05T12:41:07Z"
}
Response 200
Any 2xx marks the delivery successful. Anything else is retried with backoff: 30s, 1m, 2m … 1h, up to 8 attempts.
POST
payment.failed
no signature
A deposit failed
Sent to your callback URL when a deposit session ends without a valid payment. failure_code is one of abandoned, not_found, stuck, reverted or rejected; failure_reason is human-readable and may change. Do not credit the player. Signed with your API key secret. Deduplicate on X-Idempotency-Key.
Body
{
"event": "payment.failed",
"session_id": "01J8ZQ9D2F6H0K3M7P1S4V8Y5B",
"merchant_id": "acme-shop",
"player_id": "player-77421",
"amount": "250.000000",
"status": "failed",
"failure_code": "abandoned",
"failure_reason": "session expired before a payment was seen",
"occurred_at": "2026-08-05T13:12:07Z"
}
Response 200
Any 2xx marks the delivery successful. Anything else is retried with backoff: 30s, 1m, 2m … 1h, up to 8 attempts.
POST
deposit.confirmed
no signature
A player funded their wallet address
Sent when a transfer to a player's wallet address is final on-chain. Tron is scanned only up to its solidified block, so this event means the funds cannot be reversed — there is no pending stage and no later reversal to handle. Signed with your API key secret. Deduplicate on deposit_id, which is stable for one transfer forever; a transaction carrying two transfers to the same address produces two events with different deposit_id values. Credit the player credited: it is amount, what arrived on chain, minus the processing fee for that token, which is in fee. Your merchant commission is not taken from the player and is not in this event; it is settled with you separately. A transfer at or below the processing fee is not credited and sends no event: the whole amount is kept as the fee. amount_raw is credited in base units.
Body
{
"event": "deposit.confirmed",
"deposit_id": "dep_9aa6260d-84ba-45a7-9cc0-1ac1acaa664a",
"merchant_id": "acme-shop",
"player_id": "player-1042",
"address": "TFbu1gKVsrs6c96r3FyuD9aUs3Gdi1HmH3",
"network": "tron",
"token": "USDT",
"amount": "50.5",
"amount_raw": "49500000",
"credited": "49.5",
"fee": "1",
"tx_hash": "3ac701fcbb54dab1f84fd9285cadd9beccdd0d72c6b2d950087f681a0db30bb1",
"block": 86395740,
"occurred_at": "2026-09-20T00:01:59Z"
}
Response 200
Any 2xx marks the delivery successful. Anything else is retried with backoff: 30s, 1m, 2m … 1h, up to 8 attempts.
POST
payout.requested
no signature
A player asked for a payout
Sent when a player submits their wallet on the hosted withdrawal page. The payout is pending: check external_id, amount and recipient against your own records, then authorize it before the order deadline. Nothing is paid until you do. Signed with your API key secret. Deduplicate on X-Idempotency-Key.
Body
{
"event": "payout.requested",
"payout_id": "sess_5c0e7b2a-91d4-4f7e-8a1b-2c3d4e5f6a7b",
"merchant_id": "acme-shop",
"external_id": "WD-2026-004417",
"network": "tron",
"token": "USDT",
"amount": "120",
"recipient": "TQ5nX8wKcJd2vB7hR3mF9pLzY4tGaU6eWq",
"status": "pending",
"occurred_at": "2026-11-17T19:05:12Z"
}
Response 200
Any 2xx marks the delivery successful. Anything else is retried with backoff: 30s, 1m, 2m … 1h, up to 8 attempts.
POST
payout.completed
no signature
A payout settled
Sent when a payout's relay transaction confirms. Carries the payout in place of the session. An item of a batch also carries batch_id and batch_index. Signed with your API key secret. Deduplicate on X-Idempotency-Key.
Body
{
"event": "payout.completed",
"payout_id": "01J8ZR2N7P5Y1H4K8M3Q6V0X2D",
"merchant_id": "acme-shop",
"external_id": "WD-2026-004417",
"network": "tron",
"token": "USDT",
"amount": "1200.000000",
"recipient": "TQ5nX8wKcJd2vB7hR3mF9pLzY4tGaU6eWq",
"status": "completed",
"tx_hash": "1a3b5c7d9e1f2a4b6c8d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8f0a2b",
"occurred_at": "2026-08-05T12:43:22Z"
}
Response 200
Any 2xx marks the delivery successful. Anything else is retried with backoff: 30s, 1m, 2m … 1h, up to 8 attempts.
POST
payout.failed
no signature
A payout failed
Sent when a payout's relay transaction reverts or the payout cannot be relayed; the funds did not leave your wallet. failure_reason says why. An item of a batch also carries batch_id and batch_index. Signed with your API key secret. Deduplicate on X-Idempotency-Key.
Body
{
"event": "payout.failed",
"payout_id": "01J8ZR4Q9S7A3J6M0P5T8X2Z4F",
"merchant_id": "acme-shop",
"external_id": "WD-2026-004418",
"network": "tron",
"token": "USDT",
"amount": "75.000000",
"recipient": "TQ5nX8wKcJd2vB7hR3mF9pLzY4tGaU6eWq",
"status": "failed",
"failure_reason": "reverted",
"occurred_at": "2026-08-05T12:47:51Z"
}
Response 200
Any 2xx marks the delivery successful. Anything else is retried with backoff: 30s, 1m, 2m … 1h, up to 8 attempts.