Skip to content

Query Max Tradable Quantity ​

GET /api/v1.0/accounts/{acc_id}/acctradinginfo

Query the maximum quantity that can be bought or sold under a specific trading account, and you can also query the maximum changeable quantity of a specific order.

When to use

  • Before place: pass the same code and order_type you will use on place; for non-market orders, also pass price. Use max_cash_buy / max_cash_and_margin_buy / max_position_sell (and related fields) to cap order size.
  • Before modify: pass the original order_id to get the max replaceable quantity. Wait briefly after a successful place (see the order_id parameter note below).
  • Japan accounts: sub_acc_id is required and must match place order.
  • Close by position: with position_id, max_position_sell / max_buy_back are computed for that position; without it, they aggregate by symbol.
  • This API only estimates size — it does not place an order. Actual fills still depend on place and later order state.

Path Parameters ​

ParameterTypeRequiredDescription
acc_idstringYesTrading business account ID.

Request Parameters ​

ParameterTypePositionRequiredDescription
codestringQueryYesSymbol code. Format: market.symbol, e.g. US.AAPL
pricestringQueryNoPrice of a non-market order. For futures accounts, accurate to 9 decimal places. For forex accounts, accurate to 5 decimal places. For securities accounts, accurate to 4 decimal places. Excess will be rounded.
order_typestringQueryYesOrder type. See Naming Dictionary
sessiontrading_sessionQueryNoTrading session (US stocks only).
order_idstringQueryNoOrder ID. Leave empty to query max size for a new order; when set, returns the max replaceable quantity for that order. After a successful place, wait briefly before querying (0.5 seconds or more is commonly recommended).
position_idstringQueryNoOptional. Controls close-quantity granularity. When provided, returns the max closeable quantity for the specified position (max_position_sell / max_buy_back computed at position level); must be a valid position ID. When omitted, returns the quantity aggregated by symbol.
sub_acc_idstringQueryConditionalSub-account id. Pass this value as sub_acc_id when placing an order. Required for JP accounts.

Response Parameters ​

FieldTypeDescription
max_cash_buystringBuy on cash
max_cash_and_margin_buystringBuy on margin
max_position_sellstringSell on position
max_sell_shortstringShort sell
max_buy_backstringShort positions
long_required_imstringInitial margin change when buying one contract of an asset
short_required_imstringInitial margin change when selling one contract of an asset

Response Example ​

json
{
  "s": "ok",
  "d": {
    "max_cash_buy": "3700",
    "max_cash_and_margin_buy": "3900",
    "max_position_sell": "2100",
    "max_sell_short": "4300",
    "max_buy_back": "0",
    "long_required_im": "0",
    "short_required_im": "0"
  }
}

Error Response:

json
{
  "s": "error",
  "errcode": 485210001,
  "errmsg": "invalid order_type"
}