StratwiseLedger

Справочник API

Передайте токен в заголовке Authorization. Первый запрос вернёт доступные счета и категории.

curl -H "Authorization: Bearer $LEDGER_TOKEN" \
  https://ledger.stratwise.ai/v1/accounts

Чтение данных

curl -G -H "Authorization: Bearer $LEDGER_TOKEN" \
  "https://ledger.stratwise.ai/v1/accounts/$ACCOUNT_ID/trade/fills-history" \
  --data-urlencode instType=SPOT --data-urlencode limit=10

Ответ содержит массив data. Параметры, пагинация и доступная глубина истории описаны по ссылке каждого метода. Код 401 означает недействительный токен, 404 — недоступный ресурс, 429 — превышение лимита.

Архивные выписки

Для account/bills-history-archive и asset/monthly-statement запрос POST с параметрами в строке запроса заказывает отчёт. GET с теми же параметрами возвращает статус. Добавьте download=1 к GET для скачивания готового файла.

Методы

account/instrumentsaccount

GET /v1/accounts/{id}/account/instruments

Параметры: instType, seriesId, instFamily, instId

Описание OKX ↗
account/balancebalances

GET /v1/accounts/{id}/account/balance

Параметры: ccy

Описание OKX ↗
account/positionspositions

GET /v1/accounts/{id}/account/positions

Параметры: instType, instId, posId

Описание OKX ↗
account/positions-historypositions

GET /v1/accounts/{id}/account/positions-history

Параметры: instType, instId, mgnMode, type, posId, after, before, limit

Описание OKX ↗
account/account-position-riskbalances

GET /v1/accounts/{id}/account/account-position-risk

Параметры: instType

Описание OKX ↗
account/billsledger

GET /v1/accounts/{id}/account/bills

Параметры: instType, instId, ccy, mgnMode, ctType, type, subType, after, before, begin, end, limit

Описание OKX ↗
account/bills-archiveledger

GET /v1/accounts/{id}/account/bills-archive

Параметры: instType, instId, ccy, mgnMode, ctType, type, subType, after, before, begin, end, limit

Описание OKX ↗
account/configaccount

GET /v1/accounts/{id}/account/config

Параметры: нет

Описание OKX ↗
account/max-sizeaccount

GET /v1/accounts/{id}/account/max-size

Параметры: instId, tdMode, ccy, px, leverage, tradeQuoteCcy, outcome

Описание OKX ↗
account/max-avail-sizeaccount

GET /v1/accounts/{id}/account/max-avail-size

Параметры: instId, ccy, tdMode, reduceOnly, px, tradeQuoteCcy

Описание OKX ↗
account/leverage-infopositions

GET /v1/accounts/{id}/account/leverage-info

Параметры: instId, ccy, mgnMode

Описание OKX ↗
account/max-loanaccount

GET /v1/accounts/{id}/account/max-loan

Параметры: mgnMode, instId, ccy, mgnCcy, tradeQuoteCcy

Описание OKX ↗
account/trade-feeaccount

GET /v1/accounts/{id}/account/trade-fee

Параметры: instType, instId, instFamily, groupId

Описание OKX ↗
account/interest-accruedledger

GET /v1/accounts/{id}/account/interest-accrued

Параметры: type, ccy, instId, mgnMode, after, before, limit

Описание OKX ↗
account/interest-rateaccount

GET /v1/accounts/{id}/account/interest-rate

Параметры: ccy

Описание OKX ↗
account/max-withdrawalaccount

GET /v1/accounts/{id}/account/max-withdrawal

Параметры: ccy

Описание OKX ↗
account/risk-stateaccount

GET /v1/accounts/{id}/account/risk-state

Параметры: нет

Описание OKX ↗
account/interest-limitsaccount

GET /v1/accounts/{id}/account/interest-limits

Параметры: type, ccy

Описание OKX ↗
account/spot-borrow-repay-historyledger

GET /v1/accounts/{id}/account/spot-borrow-repay-history

Параметры: ccy, type, after, before, limit

Описание OKX ↗
account/greekspositions

GET /v1/accounts/{id}/account/greeks

Параметры: ccy

Описание OKX ↗
account/position-tierspositions

GET /v1/accounts/{id}/account/position-tiers

Параметры: instType, instFamily

Описание OKX ↗
account/collateral-assetsaccount

GET /v1/accounts/{id}/account/collateral-assets

Параметры: ccy, collateralEnabled

Описание OKX ↗
trade/orderorders

GET /v1/accounts/{id}/trade/order

Параметры: instId, ordId, clOrdId

Описание OKX ↗
trade/orders-pendingorders

GET /v1/accounts/{id}/trade/orders-pending

Параметры: instType, instFamily, instId, ordType, state, after, before, limit

Описание OKX ↗
trade/orders-historyorders

GET /v1/accounts/{id}/trade/orders-history

Параметры: instType, instFamily, instId, ordType, state, category, after, before, begin, end, limit

Описание OKX ↗
trade/orders-history-archiveorders

GET /v1/accounts/{id}/trade/orders-history-archive

Параметры: instType, instFamily, instId, ordType, state, category, after, before, begin, end, limit

Описание OKX ↗
trade/fillsfills

GET /v1/accounts/{id}/trade/fills

Параметры: instType, instFamily, instId, ordId, subType, after, before, begin, end, limit

Описание OKX ↗
trade/fills-historyfills

GET /v1/accounts/{id}/trade/fills-history

Параметры: instType, instFamily, instId, ordId, subType, after, before, begin, end, limit

Описание OKX ↗
trade/easy-convert-historyledger

GET /v1/accounts/{id}/trade/easy-convert-history

Параметры: after, before, limit

Описание OKX ↗
trade/one-click-repay-historyledger

GET /v1/accounts/{id}/trade/one-click-repay-history

Параметры: after, before, limit

Описание OKX ↗
trade/one-click-repay-history-v2ledger

GET /v1/accounts/{id}/trade/one-click-repay-history-v2

Параметры: after, before, limit

Описание OKX ↗
trade/order-algoorders

GET /v1/accounts/{id}/trade/order-algo

Параметры: algoId, algoClOrdId

Описание OKX ↗
trade/orders-algo-pendingorders

GET /v1/accounts/{id}/trade/orders-algo-pending

Параметры: ordType, algoId, instType, instId, after, before, limit

Описание OKX ↗
trade/orders-algo-historyorders

GET /v1/accounts/{id}/trade/orders-algo-history

Параметры: ordType, state, algoId, instType, instId, after, before, limit

Описание OKX ↗
tradingBot/grid/orders-algo-pendingbots

GET /v1/accounts/{id}/tradingBot/grid/orders-algo-pending

Параметры: algoOrdType, algoId, instId, instType, after, before, limit

Описание OKX ↗
tradingBot/grid/orders-algo-historybots

GET /v1/accounts/{id}/tradingBot/grid/orders-algo-history

Параметры: algoOrdType, algoId, instId, instType, after, before, limit

Описание OKX ↗
tradingBot/grid/orders-algo-detailsbots

GET /v1/accounts/{id}/tradingBot/grid/orders-algo-details

Параметры: algoOrdType, algoId

Описание OKX ↗
tradingBot/grid/sub-ordersbots

GET /v1/accounts/{id}/tradingBot/grid/sub-orders

Параметры: algoOrdType, algoId, type, groupId, after, before, limit

Описание OKX ↗
tradingBot/grid/positionsbots

GET /v1/accounts/{id}/tradingBot/grid/positions

Параметры: algoOrdType, algoId

Описание OKX ↗
tradingBot/dca/ongoing-listbots

GET /v1/accounts/{id}/tradingBot/dca/ongoing-list

Параметры: algoOrdType, algoId, after, before, limit

Описание OKX ↗
tradingBot/dca/history-listbots

GET /v1/accounts/{id}/tradingBot/dca/history-list

Параметры: algoOrdType, algoId, after, before, limit

Описание OKX ↗
tradingBot/dca/ordersbots

GET /v1/accounts/{id}/tradingBot/dca/orders

Параметры: algoId, algoOrdType, cycleId, after, before, limit

Описание OKX ↗
tradingBot/dca/position-detailsbots

GET /v1/accounts/{id}/tradingBot/dca/position-details

Параметры: algoId, algoOrdType

Описание OKX ↗
tradingBot/dca/cycle-listbots

GET /v1/accounts/{id}/tradingBot/dca/cycle-list

Параметры: algoId, algoOrdType, instId, after, before, limit

Описание OKX ↗
tradingBot/recurring/orders-algo-pendingbots

GET /v1/accounts/{id}/tradingBot/recurring/orders-algo-pending

Параметры: algoId, after, before, limit

Описание OKX ↗
tradingBot/recurring/orders-algo-historybots

GET /v1/accounts/{id}/tradingBot/recurring/orders-algo-history

Параметры: algoId, after, before, limit

Описание OKX ↗
tradingBot/recurring/orders-algo-detailsbots

GET /v1/accounts/{id}/tradingBot/recurring/orders-algo-details

Параметры: algoId

Описание OKX ↗
tradingBot/recurring/sub-ordersbots

GET /v1/accounts/{id}/tradingBot/recurring/sub-orders

Параметры: algoId, ordId, after, before, limit

Описание OKX ↗
asset/balancesbalances

GET /v1/accounts/{id}/asset/balances

Параметры: ccy

Описание OKX ↗
asset/non-tradable-assetsbalances

GET /v1/accounts/{id}/asset/non-tradable-assets

Параметры: ccy

Описание OKX ↗
asset/asset-valuationbalances

GET /v1/accounts/{id}/asset/asset-valuation

Параметры: ccy

Описание OKX ↗
asset/billsfunding

GET /v1/accounts/{id}/asset/bills

Параметры: ccy, type, thirdPartyType, clientId, after, before, limit

Описание OKX ↗
asset/bills-historyfunding

GET /v1/accounts/{id}/asset/bills-history

Параметры: ccy, type, thirdPartyType, clientId, after, before, limit, pagingType

Описание OKX ↗
asset/deposit-addressfunding

GET /v1/accounts/{id}/asset/deposit-address

Параметры: ccy

Описание OKX ↗
asset/deposit-historyfunding

GET /v1/accounts/{id}/asset/deposit-history

Параметры: ccy, depId, fromWdId, txId, type, state, after, before, limit

Описание OKX ↗
asset/withdrawal-historyfunding

GET /v1/accounts/{id}/asset/withdrawal-history

Параметры: ccy, wdId, clientId, txId, type, state, after, before, limit

Описание OKX ↗
asset/convert/historyfunding

GET /v1/accounts/{id}/asset/convert/history

Параметры: clTReqId, after, before, limit, tag

Описание OKX ↗
finance/staking-defi/orders-activeearn

GET /v1/accounts/{id}/finance/staking-defi/orders-active

Параметры: productId, protocolType, ccy, state

Описание OKX ↗
finance/staking-defi/orders-historyearn

GET /v1/accounts/{id}/finance/staking-defi/orders-history

Параметры: productId, protocolType, ccy, after, before, limit

Описание OKX ↗
finance/staking-defi/eth/balanceearn

GET /v1/accounts/{id}/finance/staking-defi/eth/balance

Параметры: нет

Описание OKX ↗
finance/staking-defi/eth/purchase-redeem-historyearn

GET /v1/accounts/{id}/finance/staking-defi/eth/purchase-redeem-history

Параметры: type, status, after, before, limit

Описание OKX ↗
finance/staking-defi/sol/balanceearn

GET /v1/accounts/{id}/finance/staking-defi/sol/balance

Параметры: нет

Описание OKX ↗
finance/staking-defi/sol/purchase-redeem-historyearn

GET /v1/accounts/{id}/finance/staking-defi/sol/purchase-redeem-history

Параметры: type, status, after, before, limit

Описание OKX ↗
finance/stable-rewards/balanceearn

GET /v1/accounts/{id}/finance/stable-rewards/balance

Параметры: ccy

Описание OKX ↗
finance/okusd/accountearn

GET /v1/accounts/{id}/finance/okusd/account

Параметры: нет

Описание OKX ↗
finance/okusd/subscribe/historyearn

GET /v1/accounts/{id}/finance/okusd/subscribe/history

Параметры: limit, begin, end

Описание OKX ↗
finance/okusd/redeem/historyearn

GET /v1/accounts/{id}/finance/okusd/redeem/history

Параметры: limit, begin, end, type

Описание OKX ↗
finance/okusd/rewards/historyearn

GET /v1/accounts/{id}/finance/okusd/rewards/history

Параметры: limit, begin, end

Описание OKX ↗
finance/savings/balanceearn

GET /v1/accounts/{id}/finance/savings/balance

Параметры: ccy

Описание OKX ↗
finance/savings/lending-historyearn

GET /v1/accounts/{id}/finance/savings/lending-history

Параметры: ccy, after, before, limit

Описание OKX ↗
finance/flexible-loan/loan-infoearn

GET /v1/accounts/{id}/finance/flexible-loan/loan-info

Параметры: ordId

Описание OKX ↗
finance/flexible-loan/loan-historyearn

GET /v1/accounts/{id}/finance/flexible-loan/loan-history

Параметры: type, after, before, limit, ordId

Описание OKX ↗
finance/flexible-loan/interest-accruedearn

GET /v1/accounts/{id}/finance/flexible-loan/interest-accrued

Параметры: ccy, after, before, limit, ordId

Описание OKX ↗
finance/sfp/dcd/order-statusearn

GET /v1/accounts/{id}/finance/sfp/dcd/order-status

Параметры: ordId

Описание OKX ↗
finance/sfp/dcd/order-historyearn

GET /v1/accounts/{id}/finance/sfp/dcd/order-history

Параметры: ordId, productId, uly, state, beginId, endId, begin, end, limit

Описание OKX ↗
account/bills-history-archiveledger

GET /v1/accounts/{id}/account/bills-history-archive

Параметры: year, quarter, type, download

Описание OKX ↗
asset/monthly-statementfunding

GET /v1/accounts/{id}/asset/monthly-statement

Параметры: month, download

Описание OKX ↗