Authentication
Every call from your backend is signed with HMAC-SHA256 over the method, path, body hash, time and a nonce.
Start here
Pick what you are building first: deposits, a deposit address or a payout, on our page or through your own UI.
Crypto payments for merchants: players deposit, you get told when the money settled, and you pay winnings back out. Nothing custodial happens on the payout side — the platform cannot move your funds without a signature from your own wallet.
Three products, each in two flavours. Hosted page: you make one signed call and send the player to our page. Host-to-host: you build the screens and call the API for every step. Each flow page has the call sequence, every method in order and the webhooks it sends.
Take a payment from the player's own wallet
Hosted pageOne call and a redirect or iframe. We render everything.Integration: an afternoon Host-to-hostYour UI, your backend drives every step.Integration: daysGive every player a permanent deposit address
Hosted pageA page with the address, QR code and incoming deposits.Integration: an hour Host-to-hostGet the address and show it on your own page.Integration: an afternoonPay a player out from your wallet
Hosted pageThe player enters their wallet; you authorize.Integration: an afternoon Host-to-hostYou create, sign and authorize the order.Integration: a day| Direct | Wallet | Payout | |
|---|---|---|---|
| Money moves | player's wallet → your wallet | player → an address we hold → you | your wallet → player |
| Amount agreed up front | optional | no, any amount any time | optional on the hosted page |
| Networks | EVM | EVM and Tron | EVM and Tron |
| Webhooks | payment.completed, payment.failed | deposit.confirmed | payout.requested, payout.completed, payout.failed |
Every call from your backend is signed with HMAC-SHA256 over the method, path, body hash, time and a nonce.
The outcome always arrives as a signed POST to your callback URL. Credit from it, never from a redirect.
Which calls are safe to repeat and on what key, and the limits on links and pages.
One error envelope, a short list of codes, and which of them a retry can fix.
The shortest path from nothing to a payment link a player can actually pay.
API_KEY_ID and an API_KEY_SECRET. One active key per merchant —
issuing a new one revokes the previous. Keep the secret on your backend; it never belongs in a
browser. Without a key you also receive no webhooks, because every
callback we send is signed with it.
client := &time2pay.Client{
BaseURL: os.Getenv("BASE_URL"),
KeyID: os.Getenv("API_KEY_ID"),
Secret: os.Getenv("API_KEY_SECRET"),
}
ctx := context.Background()$client = new Time2payClient(getenv('BASE_URL'), getenv('API_KEY_ID'), getenv('API_KEY_SECRET'));const client = createClient({ baseUrl: env.BASE_URL, keyId: env.API_KEY_ID, secret: env.API_KEY_SECRET });client = Time2payClient(os.environ["BASE_URL"], os.environ["API_KEY_ID"], os.environ["API_KEY_SECRET"])const client = new Time2payClient({
baseUrl: process.env.BASE_URL,
keyId: process.env.API_KEY_ID,
secret: process.env.API_KEY_SECRET,
});sign function against the
test vector before you debug anything else — a wrong
signature and a wrong key look identical from the outside. Then run the
smoke test: one read-only call that proves the key, the clock and
the IP allowlist.
link, err := client.Call(ctx, "POST", "/v1/direct/sessions", `{
"player_id": "player-123",
"external_order_id": "deposit-1001",
"amount": "125.50",
"network": "eth",
"token": "USDT",
"return_url": "https://shop.example/payments/return"
}`)
if err != nil {
return err
}
fmt.Println(link["url"])$link = $client->call('POST', '/v1/direct/sessions', [
'player_id' => 'player-123',
'external_order_id' => 'deposit-1001',
'amount' => '125.50',
'network' => 'eth',
'token' => 'USDT',
'return_url' => 'https://shop.example/payments/return',
]);
echo $link['url'];const link = await client.call("POST", "/v1/direct/sessions", {
player_id: "player-123",
external_order_id: "deposit-1001",
amount: "125.50",
network: "eth",
token: "USDT",
return_url: "https://shop.example/payments/return",
});
console.log(link.url);link = client.call("POST", "/v1/direct/sessions", {
"player_id": "player-123",
"external_order_id": "deposit-1001",
"amount": "125.50",
"network": "eth",
"token": "USDT",
"return_url": "https://shop.example/payments/return",
})
print(link["url"])const link = await client.call("POST", "/v1/direct/sessions", {
player_id: "player-123",
external_order_id: "deposit-1001",
amount: "125.50",
network: "eth",
token: "USDT",
return_url: "https://shop.example/payments/return",
});
console.log(link.url);{
"session": "sess_9f2c1e",
"token": "E59YRa6MDSiUunx2oZbU1C3-P_jufO18n7ZRj_xeVBE",
"url": "https://pay.time2pay.tech/direct/E59YRa6MDSiUunx2oZbU1C3-P_jufO18n7ZRj_xeVBE",
"expires_at": "2026-07-28T18:12:25Z"
}
X-Idempotency-Key and credit exactly
once.
external_order_id is what makes a retry safe. Repeating a create with the
same reference and the same parameters returns the order you already have instead of opening a
second one — and you cannot tell "the request never arrived" from "the response never came back",
so you will retry sooner or later.
Unauthenticated, for your load balancer rather than your integration.
| Endpoint | Purpose |
|---|---|
GET /healthz | The process is up. Returns {"status":"ok"}. |
GET /readyz | Dependencies are reachable. 503 means this instance should not receive traffic. |