Public integration guide. API base URL: https://api.toknex.space. Confirm network settings and one-time fees in your merchant account.

API reference

Base URL: https://api.toknex.space. All requests and responses are JSON over HTTPS. The machine-readable spec is at /docs/openapi.yaml.

Authentication

Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Create and revoke keys in your dashboard under API keys. Keys are secret: use them from your server only. If an IP allow-list is set under Account, requests from other IPs are rejected with 403.

Note: sk_test_ keys behave exactly like live keys on this deployment: the label is only there to help you organise keys. For a sandbox on BSC testnet, ask us for the staging URL.

Conventions

Errors

{ "error": { "code": "validation_failed", "message": "Validation failed.", "fields": { "email": "Enter a valid email address." } } }
HTTPcodeWhen
401unauthenticatedMissing, malformed or revoked key
403forbiddenAccount suspended or not yet active, or IP not in the allow-list
404not_foundUnknown user, deposit or route
409idempotency_in_progressThe same Idempotency-Key is still being processed
422validation_failed, invalid_request, idempotency_conflictBad input
429rate_limitedToo many requests
5xxserver_errorRetry with exponential back-off

Status

GET /api/v1/status

Public (no key). Network and service status.

{ "network": "BSC", "network_name": "BNB Smart Chain", "chain_id": 56, "token": "USDT", "token_standard": "BEP-20",
  "token_contract": "0x55d3…", "required_confirmations": account-configured confirmations, "minimum_deposit": "account-configured min deposit", "collection_paused": false }

When collection_paused is true, show customers a notice and ask them not to send funds until it is false again.

Users

POST /api/v1/users

Create a customer and (by default) their deposit address. If external_id already exists, the existing user is returned with 200 instead of 201.

FieldType
namestring, requiredmax 150
external_idstringyour customer id, [A-Za-z0-9_.:-], max 100. Strongly recommended.
emailstringunique per merchant
metadataobjectup to 20 keys, stored as-is
create_walletbooleandefault true

Response 201: the user object plus deposit_wallet (see below).

GET /api/v1/users/{id}

{ "id": 4821, "external_id": "10025", "name": "Asha Patel", "email": "[email protected]", "status": "ACTIVE", "created_at": "2026-10-25T09:00:00+00:00" }

POST /api/v1/users/{id}/deposit-wallet · GET /api/v1/users/{id}/deposit-wallet

POST creates the address if the user has none (201), otherwise returns it (200). GET returns 404 if none exists yet.

{ "user_id": 4821, "external_id": "10025", "network": "BSC", "network_name": "BNB Smart Chain", "chain_id": 56,
  "token": "USDT", "token_standard": "BEP-20", "token_contract": "0x55d398326f99059fF775485246999027B3197955",
  "deposit_address": "0x3fA1…", "deployed": false, "status": "ACTIVE",
  "minimum_deposit": "account-configured min deposit", "required_confirmations": account-configured confirmations, "qr_payload": "0x3fA1…" }

GET /api/v1/users/{id}/balance

{ "user_id": 4821, "token": "USDT",
  "confirmed_balance": "500.000000000000000000", "confirmed_balance_raw": "500000000000000000000",
  "pending_confirmation": "0.000000000000000000", "pending_confirmation_raw": "0",
  "awaiting_collection": "500.000000000000000000", "awaiting_collection_raw": "500000000000000000000" }

confirmed_balance is the total of all confirmed, credited deposits for this customer (lifetime). Keep your own spendable balance in your system.

GET /api/v1/users/{id}/deposits

A list of deposit objects for one customer (pagination and status filter supported).

GET /api/v1/users/{id}/collections

Sweeps of this customer's address to the treasury: id, tx_hash, amount, amount_raw, treasury_address, status, block_number, confirmed_at.

POST /api/v1/users/{id}/portal-link

One-time link to the hosted deposit page (valid 30 minutes, single use).

{ "url": "https://api.toknex.space/portal/link/…", "expires_at": "2026-10-25T09:30:00+00:00" }

Deposits

GET /api/v1/deposits

All deposits across your customers. Query: status, limit, starting_after, since_id.

GET /api/v1/deposits/{depositId}

The deposit object

FieldDescription
idDeposit id (use it to de-duplicate)
user_id, external_idThe customer
network, tokenBSC, USDT
deposit_addressCustomer's address
from_addressSender (may be an exchange hot wallet)
tx_hash, log_index, block_numberOn-chain location; explorer_url links to BscScan
amount, amount_rawAmount received
confirmations, required_confirmationsProgress
statusDETECTED, CONFIRMING, CONFIRMED, COLLECTION_PENDING, COLLECTION_SUBMITTED, COLLECTED, REORGED, FAILED
creditedtrue once credited to your merchant balance
below_minimumtrue if under account-configured min deposit USDT (not credited)
detected_at, confirmed_at, collected_atTimestamps

Merchant balance

GET /api/v1/balance

{ "token": "USDT", "balance": "1234.500000000000000000", "balance_raw": "1234500000000000000000", "available_for_settlement": "1234.500000000000000000" }

Payouts are requested in the dashboard under Settlements. See Fees & settlements.

Webhooks

Event types: deposit.detected, deposit.confirmed, deposit.collected, settlement.approved, settlement.paid, ping. See Webhooks for the payloads, signature verification and retries.