Skip to main content

Pre-check Order

Description​

Pre-checks order margin requirements before execution. A successful pre-check only indicates that the pre-check passed and does not actually create an order. A formal order still requires a call to /api/v3/order/create, and the final validation result at the time of formal order submission shall prevail.

HTTP Request​

  • POST /api/v3/order/pre-check
  • Supported Products: linear
  • Rate Limit: 10 requests per second per UID

Request Parameters​

FieldTypeRequiredDescription
categorystringYesProduct type: linear
symbolstringYestrading pair, such as BTCUSDT
sidestringYesDirection: BUY / SELL
orderTypestringYesorder type: Market / Limit
qtystringYesOrder quantity. For a spot Market Buy, specify the amount in the quote asset.
pricestringNoLimit order price.
timeInForcestringNoValid methods: GTC, IOC, FOK, PostOnly, PO-COF (spot-only for skip-order, valid only in spot trading)
positionIdxint64NoFutures position mode: 0 one-way, 1 long, 2 short. Accounts in one-way mode can omit it. The default is 0.
orderLinkIdstringNocustom order ID, currently 36 characters long
triggerPricestringNoTrigger price for conditional order
triggerDirectionint32NoTrigger direction: triggered when 1 price increases / triggered when 2 price decreases
triggerBystringNoTrigger price type: LastPrice / MarkPrice
takeProfitstringNoTake-profit trigger price, take-profit type is market order
stopLossstringNoStop-loss trigger price, stop-loss type is market order
tpTriggerBystringNoTake-profit trigger price type. For contracts, default is LastPrice, LastPrice / MarkPrice.
slTriggerBystringNoTake-profit trigger price type. For contracts, default is LastPrice, LastPrice / MarkPrice.
reduceOnlyboolNoIs reduce-only only

Response Parameters​

FieldTypeDescription
orderIdstringPre-check order ID (not a real order)
orderLinkIdstringCustom Order ID
preImrE4int32Initial margin rate before order placement (×10⁻⁴)
preMmrE4int32Maintenance margin ratio before order (×10⁻⁴)
postImrE4int32Initial margin ratio after order (×10⁻⁴)
postMmrE4int32Maintenance margin ratio after order (×10⁻⁴)

Request Example​

POST /api/v3/order/pre-check HTTP/1.1
Host: openapi.lbank.com
Content-Type: application/json
ex-api-key: <your_api_key>
ex-timestamp: <current_unix_timestamp_ns>
ex-nonce: <unique_random_hex>
ex-signature: <your_signature>
ex-client-type: API

{
"category": "linear",
"symbol": "BTCUSDT",
"side": "BUY",
"orderType": "Limit",
"qty": "0.001",
"price": "60000",
"timeInForce": "GTC",
"positionIdx": 0,
"orderLinkId": "b320fe1a-478c-4d2e-a219-000000000001",
"reduceOnly": false
}

Response Example​

HTTP/1.1 200 OK
Content-Type: application/json

{
"code": 200,
"message": "Success",
"data": {
"orderId": "example_pre_check_order_id",
"orderLinkId": "b320fe1a-478c-4d2e-a219-000000000001",
"preImrE4": 1000,
"preMmrE4": 500,
"postImrE4": 1200,
"postMmrE4": 600
},
"extras": null
}