time2pay Developer Docs

Wallet flow

Deposit address · hosted page

One signed call gives you a link to a page with the player's own deposit address, QR code and incoming deposits.

How it works

The deposit-address flow without building the screen. One signed call gives you a link to a page that shows the player's own standing address for each network you offer, with a QR code, the coin to send and the deposits that already arrived. The address is the same one POST /v1/wallet/address returns, so you can mix both flows freely.

  1. Your backend
    Creates the link with POST /v1/wallet/sessions.
  2. Player
    Opens the url, picks a network, copies the address or scans the QR code.
  3. Player's wallet or exchange
    Sends the coin to the address, any amount, any time, as often as they like.
  4. time2pay
    Sees the transfer, waits for its confirmations and shows it on the page.
  5. Your backend
    Receives deposit.confirmed for every transfer and credits credited.
The link expires, the address does not. A player who saved the address can keep sending to it without opening the page again, and every transfer still arrives as deposit.confirmed.

Methods, in call order

Only the first is yours to call. The page polls the two browser calls on its own.

Wallet · hosted page

One signed call creates a link to a page that shows the player's standing deposit address with a QR code and incoming deposits.

POST /v1/wallet/sessions signed

Create a deposit-address page link

The only signed call in the hosted wallet flow. Returns a one-time link to a page that shows the player's standing deposit address with a QR code, the coin and network to send, and the deposits that already arrived. Credit the player from deposit.confirmed, exactly as in the host-to-host wallet flow.

Request body

FieldTypeRequiredDescription
player_id string yes Your id for the player. The page shows this player's standing addresses, the same ones POST /v1/wallet/address returns.
network string no Show only this network. Send network or networks, not both.
networks array no Offer these networks, in this order. Omit both to offer every network with deposit addresses switched on for you.
token string no Name the coin the player should send. Networks that do not accept it are left out.
amount string no A suggested amount shown on the page, in whole units. The address takes any amount: this is a hint for the player, not a limit.
return_url string no Absolute http(s) URL for the page's back button.
language string no Page language: az, de, en, es, fr, hy, it, ka, kk, ky, pl, pt, ru, tg, tr, uk or uz. Anything else falls back to English.
ttl_seconds integer no How long the link opens the page: 60 to 86400 seconds, default 3600. The addresses themselves never expire.

Request

curl -X POST "$BASE_URL/v1/wallet/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 '{"player_id":"player-123","networks":["tron","bsc"],"token":"USDT","return_url":"https://merchant.example/account","language":"en"}'
res, err := client.Call(ctx, "POST", "/v1/wallet/sessions", `{
	"player_id": "player-123",
	"networks": [
		"tron",
		"bsc"
	],
	"token": "USDT",
	"return_url": "https://merchant.example/account",
	"language": "en"
}`)
$res = $client->call('POST', '/v1/wallet/sessions', [
    'player_id' => 'player-123',
    'networks' => [
        'tron',
        'bsc',
    ],
    'token' => 'USDT',
    'return_url' => 'https://merchant.example/account',
    'language' => 'en',
]);
const res = await client.call("POST", "/v1/wallet/sessions", {
    "player_id": "player-123",
    "networks": [
        "tron",
        "bsc"
    ],
    "token": "USDT",
    "return_url": "https://merchant.example/account",
    "language": "en"
});
res = client.call("POST", "/v1/wallet/sessions", {
    "player_id": "player-123",
    "networks": [
        "tron",
        "bsc",
    ],
    "token": "USDT",
    "return_url": "https://merchant.example/account",
    "language": "en",
})
const res = await client.call("POST", "/v1/wallet/sessions", {
    "player_id": "player-123",
    "networks": [
        "tron",
        "bsc"
    ],
    "token": "USDT",
    "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": "wsess_4b1f0c",
  "token": "q8Hk2LxV0mZ7cN4pR1tY6wE3uI9oA5sD2fG8hJ0kL3",
  "url": "https://pay.time2pay.tech/wallet/q8Hk2LxV0mZ7cN4pR1tY6wE3uI9oA5sD2fG8hJ0kL3",
  "expires_at": "2026-11-18T10:00:00Z"
}

Errors

400 unsupported A missing player_id, a TTL out of range, both network and networks, or a network or coin without deposit addresses for you. Codes: validation, unsupported.
{
  "error": {
    "code": "unsupported",
    "message": "USDC is not accepted on any network with deposit addresses"
  }
}
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"
  }
}
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 /wallet/{token} no signature

The hosted deposit-address page

The page the link opens. Redirect the player to it or open it in an iframe. An unknown or expired token shows a short not-found page in the player's language.

Path parameters

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

Request

curl -X GET "$BASE_URL/wallet/{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/wallet/page/status no signature

Read the page state (browser)

Called by the page itself: the offered networks, the address and QR code for the chosen network. Scoped to the token, 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/wallet/page/status" \
  -H "Content-Type: application/json" \
  -d '{"token":"q8Hk2LxV0mZ7cN4pR1tY6wE3uI9oA5sD2fG8hJ0kL3","network":"tron"}'

Response 200

Page state.

Errors

404 not_found Unknown token.
{
  "error": {
    "code": "not_found",
    "message": "not found"
  }
}
410 expired The link expired.
{
  "error": {
    "code": "expired",
    "message": "this link has expired"
  }
}
POST /v1/wallet/page/deposits no signature

Deposits shown on the page (browser)

Called by the page itself to show transfers to the address and their confirmations. 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/wallet/page/deposits" \
  -H "Content-Type: application/json" \
  -d '{"token":"q8Hk2LxV0mZ7cN4pR1tY6wE3uI9oA5sD2fG8hJ0kL3","network":"tron"}'

Response 200

Recent deposits to the address.

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. Create a new link for every attempt rather than storing old ones.

Crediting

Crediting is the same as in the host-to-host flow: one deposit.confirmed per transfer, credit credited, deduplicate on deposit_id. A transfer at or below the processing fee is not credited and sends no webhook; the page shows the minimum next to the address.

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 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.