For the complete documentation index, see llms.txt. This page is also available as Markdown.

Ledger

GetAvailableBalances returns the user's available balance for each product

get
/ledger/v1/balances/{accountId}

Splits available vs locked amounts derived from the ledger entries, rather than returning the entries themselves

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Send 'Authorization: APIKey ' to authenticate with a API key.

Path parameters
accountIdstringRequired

account_id represents the account identifier

Responses
200

A successful response.

application/json
get/ledger/v1/balances/{accountId}
GET /ledger/v1/balances/{accountId} HTTP/1.1
Host: backend.pay.kiichain.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "balances": [
    {
      "available": "text",
      "locked": "text",
      "productId": "text"
    }
  ]
}

GetUserTradeHistory returns historical ticket trade data for a user (paginated)

get
/ledger/v1/trades/{accountId}

Each entry is a single ticket-linked trade (deposit, withdraw, swap) Use GetUserTradeHistoryGrouped for aggregated totals per time bucket instead

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Send 'Authorization: APIKey ' to authenticate with a API key.

Path parameters
accountIdstringRequired

account_id is the user's account identifier

Query parameters
limitinteger · int32Optional

limit is the maximum number of entries to return (defaults to 50)

pageinteger · int32Optional

page is the 1-indexed page number (defaults to 1)

Responses
200

A successful response.

application/json
totalstring · int64Required
get/ledger/v1/trades/{accountId}
GET /ledger/v1/trades/{accountId} HTTP/1.1
Host: backend.pay.kiichain.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "entries": [
    {
      "amount": "text",
      "amountUsd": "text",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "journalId": "text",
      "subType": "text",
      "symbol": "text",
      "ticketId": "text"
    }
  ],
  "total": "text"
}

GetUserTradeHistoryGrouped returns historical ticket trade data grouped by time frame for a user

get
/ledger/v1/trades/{accountId}/grouped

Buckets trades by day, week or month, aggregating amount and ticket count per bucket instead of returning individual trades

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Send 'Authorization: APIKey ' to authenticate with a API key.

Path parameters
accountIdstringRequired

account_id is the user's account identifier

Query parameters
timeFramestringRequired

time_frame specifies the grouping period: "day", "week", or "month"

Responses
200

A successful response.

application/json
get/ledger/v1/trades/{accountId}/grouped
GET /ledger/v1/trades/{accountId}/grouped?timeFrame=text HTTP/1.1
Host: backend.pay.kiichain.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "groups": [
    {
      "period": "2026-01-01T00:00:00.000Z",
      "subType": "text",
      "symbol": "text",
      "ticketCount": "text",
      "totalAmount": "text",
      "totalAmountUsd": "text"
    }
  ]
}

GetLedgerEntries returns all ledger entries for an account

get
/ledger/v1/{accountId}

Unfiltered and unpaginated. Use GetLedgerEntriesFiltered for large accounts or when scoping to a product/time range

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Send 'Authorization: APIKey ' to authenticate with a API key.

Path parameters
accountIdstringRequired

account_id represents the account identifier

Responses
200

A successful response.

application/json
get/ledger/v1/{accountId}
GET /ledger/v1/{accountId} HTTP/1.1
Host: backend.pay.kiichain.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "entries": [
    {
      "accountId": "text",
      "amount": "text",
      "amountUsd": "text",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "description": "text",
      "direction": "text",
      "id": "text",
      "journalId": "text",
      "productId": "text",
      "subType": "text",
      "type": "text"
    }
  ]
}

GetLedgerEntriesFiltered returns a user's entries filtered by product and time range

get
/ledger/v1/{accountId}/entries

product_id, start_date and end_date are all optional and independently combinable

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Send 'Authorization: APIKey ' to authenticate with a API key.

Path parameters
accountIdstringRequired

account_id represents the account identifier

Query parameters
productIdstringOptional

product_id optionally filters entries to a single product

startDatestring · date-timeOptional

start_date optionally filters entries created at or after this time

endDatestring · date-timeOptional

end_date optionally filters entries created at or before this time

Responses
200

A successful response.

application/json
get/ledger/v1/{accountId}/entries
GET /ledger/v1/{accountId}/entries HTTP/1.1
Host: backend.pay.kiichain.io
Authorization: YOUR_API_KEY
Accept: */*
{
  "entries": [
    {
      "accountId": "text",
      "amount": "text",
      "amountUsd": "text",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "description": "text",
      "direction": "text",
      "id": "text",
      "journalId": "text",
      "productId": "text",
      "subType": "text",
      "type": "text"
    }
  ]
}

Last updated