time2pay Developer Docs

Payout flow

Payout · hosted page

One signed call gives you a link where the player enters their own wallet. You authorize the payout it creates.

How it works

You know who is withdrawing and how much; the player knows their wallet. One signed call gives you a link where the player chooses a network and coin and enters their address. That creates a pending payout, and you authorize it exactly as in the host-to-host flow: the order is signed by your own wallet, so neither the page nor a leaked API key can pay anyone on its own.

  1. Your backend
    Creates the link with POST /v1/payout/sessions, with your withdrawal reference, the player and usually the amount.
  2. Player
    Opens the url, chooses a network and coin, enters their wallet address and confirms.
  3. time2pay
    Creates the payout in status pending and sends payout.requested with its payout_id.
  4. Your backend
    Checks the reference, amount and address against your records, then signs the order and calls POST /v1/payout/authorize before its deadline.
  5. Chain
    The payout is relayed and mined. The same link shows the player its progress.
  6. Your backend
    Receives payout.completed or payout.failed.
Nothing is paid until you authorize. payout.requested is a request, not a payment. An order you do not authorize before its deadline can no longer be authorized and is never paid; send the player a new link under a new reference if they still want the money.

Methods, in call order

Only the first is yours to call here; the authorization step is the one from the host-to-host flow. The page and its browser calls are listed so nothing is hidden.

Payout · hosted page

One signed call creates a link where the player enters their own wallet. You authorize the payout it creates with your wallet signature.

POST /v1/payout/sessions signed

Create a withdrawal page link

The only signed call before the player acts. Returns a one-time link to a page where the player chooses a network and coin and enters their wallet address. When they submit, a payout is created and you get payout.requested; authorize it with your wallet signature, as any other payout. The platform cannot pay out without that signature.

Request body

FieldTypeRequiredDescription
external_id string yes Your withdrawal reference. One link per reference: repeating the create returns the same session with a fresh link while the player has not submitted a wallet yet.
player_id string yes Your id for the player asking to withdraw.
amount string no The amount to pay out, in whole units. Omit it to let the player enter an amount on the page; check that amount when payout.requested arrives, before you authorize.
token string no Pay out in this coin. Omit it to let the player pick among the coins you pay out in.
network string no Pay out on this network only. Send network or networks, not both.
networks array no Offer these networks. Omit both to offer every network you pay out on.
callback_url string no Where payout webhooks for this withdrawal go, instead of your default callback URL.
return_url string no Absolute http(s) URL for the page's back button.
language string no Page language, same list as the deposit page.
ttl_seconds integer no How long the link stays usable: 60 to 86400 seconds, default 1800. A link whose player already submitted a wallet keeps showing the payout's progress.

Request

curl -X POST "$BASE_URL/v1/payout/sessions" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $API_KEY_ID" \
  -H "X-Timestamp: $TS" \
  -H "X-Nonce: $NONCE" \
  -H "X-Signature: $SIG" \
  -d '{"external_id":"WD-2026-004417","player_id":"player-123","amount":"120","token":"USDT","networks":["tron","bsc"],"return_url":"https://merchant.example/account","language":"en"}'
res, err := client.Call(ctx, "POST", "/v1/payout/sessions", `{
	"external_id": "WD-2026-004417",
	"player_id": "player-123",
	"amount": "120",
	"token": "USDT",
	"networks": [
		"tron",
		"bsc"
	],
	"return_url": "https://merchant.example/account",
	"language": "en"
}`)
$res = $client->call('POST', '/v1/payout/sessions', [
    'external_id' => 'WD-2026-004417',
    'player_id' => 'player-123',
    'amount' => '120',
    'token' => 'USDT',
    'networks' => [
        'tron',
        'bsc',
    ],
    'return_url' => 'https://merchant.example/account',
    'language' => 'en',
]);
const res = await client.call("POST", "/v1/payout/sessions", {
    "external_id": "WD-2026-004417",
    "player_id": "player-123",
    "amount": "120",
    "token": "USDT",
    "networks": [
        "tron",
        "bsc"
    ],
    "return_url": "https://merchant.example/account",
    "language": "en"
});
res = client.call("POST", "/v1/payout/sessions", {
    "external_id": "WD-2026-004417",
    "player_id": "player-123",
    "amount": "120",
    "token": "USDT",
    "networks": [
        "tron",
        "bsc",
    ],
    "return_url": "https://merchant.example/account",
    "language": "en",
})
const res = await client.call("POST", "/v1/payout/sessions", {
    "external_id": "WD-2026-004417",
    "player_id": "player-123",
    "amount": "120",
    "token": "USDT",
    "networks": [
        "tron",
        "bsc"
    ],
    "return_url": "https://merchant.example/account",
    "language": "en"
});

The client is the one on Signing requests: it signs, sends, and turns an error into an exception carrying its code.

Response 200

The hosted link.

{
  "session": "psess_7d3a9e21",
  "token": "Zt3nQ0vB8yW1xK6mL2pR9sD4fH7jG5cE0aU3iO8eT1",
  "url": "https://pay.time2pay.tech/payout/Zt3nQ0vB8yW1xK6mL2pR9sD4fH7jG5cE0aU3iO8eT1",
  "expires_at": "2026-11-17T19:30:00Z"
}

Errors

400 unsupported A missing external_id or player_id, a TTL out of range, both network and networks, or a network or coin you do not pay out in. Codes: validation, unsupported.
{
  "error": {
    "code": "unsupported",
    "message": "payouts of \"USDC\" are not enabled on \"tron\" for this merchant"
  }
}
401 unauthorized The signature, key, timestamp or nonce did not check out: a missing header, an unknown key id, a timestamp more than 5 minutes from ours, a signature that does not match, or a nonce already used inside the window. Do not retry without rebuilding the request — a retry needs a new timestamp, a new nonce and a new signature.
{
  "error": {
    "code": "unauthorized",
    "message": "invalid signature"
  }
}
403 forbidden The credential is valid but the caller's IP is not in the allowlist configured for your merchant. Not retryable.
{
  "error": {
    "code": "forbidden",
    "message": "client IP not allowed for this merchant"
  }
}
409 conflict This external_id already has a payout: the player submitted a wallet. Read the payout instead of making a new link.
{
  "error": {
    "code": "conflict",
    "message": "the payout session already has a payout"
  }
}
503 unavailable A dependency we need to answer safely is degraded, so the request was refused rather than served wrongly. Transient: retry with backoff, using a fresh timestamp, nonce and signature.
{
  "error": {
    "code": "unavailable",
    "message": "cannot verify request nonce"
  }
}
GET /payout/{token} no signature

The hosted withdrawal page

The page the link opens. After the player submits, the same link shows the payout's progress until it settles.

Path parameters

NameTypeRequiredDescription
token string yes The token from POST /v1/payout/sessions.

Request

curl -X GET "$BASE_URL/payout/{token}"

Response 200

HTML page.

Errors

404 Unknown or expired link.
429 The link was loaded more than 30 times in a minute.
POST /v1/payout/page/status no signature

Read the page state (browser)

Called by the page itself: offered networks and coins, the fixed amount if any, and the payout once the player submitted. No signature. You never call it.

Request body

FieldTypeRequiredDescription
token string yes The token from the page URL.
language string no

Request

curl -X POST "$BASE_URL/v1/payout/page/status" \
  -H "Content-Type: application/json" \
  -d '{"token":"Zt3nQ0vB8yW1xK6mL2pR9sD4fH7jG5cE0aU3iO8eT1"}'

Response 200

Page state.

Errors

410 expired The link expired before the player submitted.
{
  "error": {
    "code": "expired",
    "message": "this link has expired"
  }
}
POST /v1/payout/page/submit no signature

Submit the player's wallet (browser)

Called by the page when the player confirms. Creates the payout in status pending and sends payout.requested. No signature. You never call it.

Request body

FieldTypeRequiredDescription
token string yes The token from the page URL.
network_id string yes One of the offered networks.
token_symbol string yes The coin, when the link did not fix one.
recipient string yes The player's wallet address on that network.
amount string no The amount, when the link did not fix one.

Request

curl -X POST "$BASE_URL/v1/payout/page/submit" \
  -H "Content-Type: application/json" \
  -d '{"token":"Zt3nQ0vB8yW1xK6mL2pR9sD4fH7jG5cE0aU3iO8eT1","network_id":"tron","token_symbol":"USDT","recipient":"TQ5nX8wKcJd2vB7hR3mF9pLzY4tGaU6eWq"}'

Response 200

Page state with the payout.

Errors

400 unsupported A network or coin that was not offered, a missing address, or an amount different from the fixed one.
{
  "error": {
    "code": "unsupported",
    "message": "network \"eth\" is not offered for this withdrawal"
  }
}
410 expired The link expired.
{
  "error": {
    "code": "expired",
    "message": "this withdrawal link has expired"
  }
}

Authorizing what the player asked for

payout.requested carries payout_id, your external_id, the network, coin, amount and the player's recipient. Read the order with POST /v1/payout/status, check it against the withdrawal you approved, then sign it and authorize it as described in Signing the order. The first payout on a network also needs the one-time allowance.

  • Fix the amount on the create call whenever you can. If you let the player enter one, the amount in the webhook is theirs: check it before you sign.
  • One link per withdrawal. Repeating the create with the same external_id returns the same session with a fresh link until the player submits; after that it answers 409 and you follow the payout.
  • Deadline. The page shows the player how long you have to approve. After it, authorize answers expired and the order is never paid.

Language and the link

The page is shown in the language you send on the create call: az, de, en, es, fr, hy, it, ka, kk, ky, pl, pt, ru, tg, tr, uk and uz. Send it: the link carries nothing about the player, so a page created without one is shown in English whatever language your site was in. An unknown code is not an error, it falls back to English.

The link works until expires_at. An unknown or expired link opens a short page that says so and sends the player back to your site; one link can be loaded up to 30 times a minute. After the player submits, the same link keeps showing the payout's progress until it settles.

Webhooks in this flow

Each is a POST to your callback URL, signed with your API key secret. Verify it as described in Verifying the signature, deduplicate on X-Idempotency-Key and answer any 2xx.

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.