cryptoinfraDocs

#Balances & deposits

Read spendable balances and incoming deposit history

Open as MarkdownFor AI assistants

2 endpoints. Generated from docs/openapi.yaml v1.0.0.

EndpointSummary
GET /v1/users/{externalId}/balancesGet a user's spendable balances
GET /v1/users/{externalId}/depositsList a user's deposits

#GET/v1/users/{externalId}/balances

Get a user's spendable balances · Auth: bearer API key · operationId: getUserBalances

Spendable, always net of holds. A pending withdrawal places its hold at REQUEST time — the held amount (plus fees) leaves the user's balance immediately and sits in a pending account until the operation confirms or is refunded.

The guarantee runs in one direction and is safe to rely on: while an operation is in flight this endpoint reads lower than the user's eventual balance, never higher. It cannot report a surplus that a queued payout is about to consume. If the operation fails, the hold is reversed and the balance returns.

Assets with no activity are absent from the response. So is an empty account on a chain the platform no longer serves (Chain) — a user from before a chain was retired keeps such rows, and they are listed only while they hold a balance.

on_chain is what the user's own address holds at this moment, for comparison with a block explorer. It is not the spendable figure and the two differ by design (see the Balance schema).

#Parameters

NameInTypeRequiredDescription
externalIdpathstringyesYour external_user_id for the user.

#Responses

StatusBodyMeaning
200object[]Per-asset balances.
401ErrorMissing, malformed or unknown API key.
404ErrorUnknown externaluserid for this tenant.

200 response body

FieldTypeDescription
[].asset_id requiredstring—
[].symbol requiredstring—
[].chain requiredstringThe chain an address or asset is on. TRON is the only network the platform serves: btc, eth, bsc and sol were retired — historical addresses on them are never handed out again and nothing scans them. Read the value as an open string rather than a closed list, so a chain added later does not break your client. (one of tron)
[].amount requiredstringA monetary value as a decimal string. Always paired with a *_base field that carries the exact integer base-unit value; compute with the _base string.
[].amount_base requiredstringExact integer amount in the asset's smallest unit. (pattern ^[0-9]+$)
[].on_chain requiredstringWhat the user's own deposit address holds right now, read live from the chain. Informational: amount is the balance the platform enforces. The two differ by design — fees leave the address for the platform's profit wallet as they settle, earnings (commission, a merchant's own fees) are credited from there, and a balance from before 4 September 2026 lives in the platform's wallets. null when the address could not be read in time.
[].on_chain_base requiredstringExact integer amount in the asset's smallest unit. (pattern ^[0-9]+$)
json
[
  {
    "asset_id": "usdt_trc20",
    "symbol": "USDT",
    "chain": "tron",
    "amount": "1.5",
    "amount_base": "1500000000",
    "on_chain": "1.5",
    "on_chain_base": "1500000000"
  }
]

#Example request

bash
curl -X GET 'https://api.cryptoinfra.build/v1/users/string/balances' \
  -H 'Authorization: Bearer ck_live_your_key'

#GET/v1/users/{externalId}/deposits

List a user's deposits · Auth: bearer API key · operationId: getUserDeposits

Most recent deposits first.

The optional range filters on when the deposit was FIRST SEEN on-chain, not on when it was credited — so a still-pending deposit cannot fall out of a window that covers it. from/to accept either a bare IST calendar day (YYYY-MM-DD, both ends included) or a full RFC 3339 instant with an offset.

#Parameters

NameInTypeRequiredDescription
externalIdpathstringyesYour external_user_id for the user.
limitqueryintegerno— (default 50; min 1; max 200)
offsetqueryintegerno— (default 0; min 0)
fromquerystringnoOnly deposits first seen on/after this IST day (or instant).
toquerystringnoOnly deposits first seen on/before this IST day (or before this instant).

#Responses

StatusBodyMeaning
200object[]Deposit history.
400ErrorBody/params failed validation, or a domain rule was violated. error is one of: validationerror, unknownasset, assetdisabled, invalidamount, amountbelowminimum, badamount, invalidaddress, invalid_request.
401ErrorMissing, malformed or unknown API key.
404ErrorUnknown externaluserid for this tenant.

200 response body

FieldTypeDescription
[].id requiredinteger—
[].chain requiredstringThe chain an address or asset is on. TRON is the only network the platform serves: btc, eth, bsc and sol were retired — historical addresses on them are never handed out again and nothing scans them. Read the value as an open string rather than a closed list, so a chain added later does not break your client. (one of tron)
[].asset_id requiredstring—
[].symbol requiredstring—
[].address requiredstring—
[].from_addressstringWho paid it. For a token, the from of the Transfer event to address, not the transaction's signer; for TRX, the sender. null only for an old deposit whose sender could not be read.
[].txid requiredstring—
[].output_index requiredintegerPosition of the transfer inside its transaction (the log index of a TRC20 transfer; 0 for a native TRX transfer).
[].amount requiredstringGross on-chain amount.
[].amount_base requiredstringExact integer amount in the asset's smallest unit. (pattern ^[0-9]+$)
[].fee requiredstringPlatform deposit fee. Deposits are free, so this is 0 on every deposit since 2026-09-04.
[].fee_base requiredstringExact integer amount in the asset's smallest unit. (pattern ^[0-9]+$)
[].amount_credited requiredstringNet credited to the user (amount - fee).
[].amount_credited_base requiredstringExact integer amount in the asset's smallest unit. (pattern ^[0-9]+$)
[].status requiredstring(one of seen, confirming, credited, orphaned, ignored_dust)
[].block_heightinteger | null—
[].confirmations requiredinteger—
[].first_seen_at requiredstring<date-time>—
[].credited_atstring<date-time> | null—
json
[
  {
    "id": 1,
    "chain": "tron",
    "asset_id": "string",
    "symbol": "string",
    "address": "string",
    "from_address": "string",
    "txid": "string",
    "output_index": 1,
    "amount": "1.5",
    "amount_base": "1500000000",
    "fee": "1.5",
    "fee_base": "1500000000",
    "amount_credited": "1.5",
    "amount_credited_base": "1500000000",
    "status": "seen",
    "block_height": 1,
    "confirmations": 1,
    "first_seen_at": "2026-08-31T09:15:00.000Z",
    "credited_at": "2026-08-31T09:15:00.000Z"
  }
]

#Example request

bash
curl -X GET 'https://api.cryptoinfra.build/v1/users/string/deposits?from=2026-08-01&to=2026-08-31' \
  -H 'Authorization: Bearer ck_live_your_key'