Trade

Estimate Maximum Purchase Quantity

GEThttps://openapi.longbridge.com/v1/trade/estimate/buy_limit

Authorization

Signed mode: every request is signed with your App Key/Secret. Header set:

NameTypeRequiredDescription
Authorizationstring · headerRequiredThe account Access Token from the OpenAPI dashboard — passed as the raw token (no Bearer prefix) and included in the signature calculation.
X-Api-Keystring · headerRequiredYour App Key.
X-Timestampstring · headerRequiredRequest timestamp in seconds (Unix epoch).
X-Api-Signaturestring · headerRequiredHMAC-SHA256 signature. Format: HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=.

This API is used for estimating the maximum purchase quantity for Hong Kong and US stocks, warrants, and options.

>_ CLI
longbridge max-qty TSLA.US

Request

Query parameters

NameTypeRequiredDescription
symbolstringRequiredStock code, using ticker.region format, for example: `AAPL.US`
order_typestringRequiredOrder Type. One of: `LO`, `ELO`, `MO`, `AO`, `ALO`, `ODD`, `LIT`, `MIT`, `TSLPAMT`, `TSLPPCT`, `SLO`.
pricestringOptionalEstimated order price, for example: `388.5`
sidestringRequiredOrder side. **Enum Value**, `Buy` - Buy, `Sell` - Sell (Short selling is only supported for US stocks)
currencystringOptionalSettlement currency
order_idstringOptionalOrder ID, required when estimating the maximum purchase quantity for a modified order

Response

Response properties

NameTypeRequiredDescription
cash_max_qtystringRequiredCash available quantity, default value is empty string.
margin_max_qtystringRequiredMargin available quantity, default value is empty string.

Response JSON example

{
  "code": 0,
  "message": "success",
  "data": {
    "cash_max_qty": "100",
    "margin_max_qty": "100"
  }
}

Error code

See the Error Codes page for the full list of error codes.