Skip to Content

Replace Order

This API is used to replace order, modify quantity or price.

CLI
# Replace the order ID below with your actual order ID
longbridge order replace 693664675163312128 --qty 200 --price 255.00

Request

HTTP MethodPUT
HTTP URL/v1/trade/order

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
order_idstringYESOrder ID
quantitystringYESReplaced quantity, example: 100
pricestringNOReplaced price, example: 388.5

LO / ELO / ALO / ODD / LIT Order Required
trigger_pricestringNOTrigger price, example: 388.5

LIT / MIT Order Required
limit_offsetstringNOLimit offset amount

TSLPAMT / TSLPPCT Order Required whenlimit_depth_level is set to 0
trailing_amountstringNOTrailing amount

TSLPAMT Order Required
trailing_percentstringNOTrailing percent

TSLPPCT Order Required
remarkstringNORemark (Maximum 64 characters)
limit_depth_levelint32NOSpecifies the bid/ask depth level. TSLPAMT / TSLPPCT Order Required
monitor_pricestringNOMonitoring price. TSLPAMT / TSLPPCT Order Required
trigger_countint32NONumber of triggers. LIT / MIT / TSLPAMT / TSLPPCT Order Required
attached_paramsobjectNOAttached order parameters (take-profit / stop-loss)
attached_params.attached_order_typestringNOAttached order type

Enum Value:
PROFIT_TAKER - Take Profit
STOP_LOSS - Stop Loss
BRACKET - Bracket Order
attached_params.profit_taker_pricestringNOTake-profit trigger price
attached_params.stop_loss_pricestringNOStop-loss trigger price
attached_params.time_in_forcestringNOAttached order time in force type

Enum Value:
Day - Day Order
GTC - Good Til Canceled Order
GTD - Good Til Date Order (inherits the main order's expire_date in this case)
attached_params.expire_timeint64NOExpire time (Unix timestamp, in seconds)
attached_params.profit_taker_idint64NOTake-profit order ID, fill in when modifying an existing take-profit order
attached_params.stop_loss_idint64NOStop-loss order ID, fill in when modifying an existing stop-loss order
attached_params.cancel_all_attachedboolNOWhether to cancel all attached orders
attached_params.main_idint64NOMain order ID
attached_params.quantitystringNOAttached order quantity
attached_params.market_pricestringNOMarket price
attached_params.activate_order_typestringNOOrder type submitted after triggering, e.g. LIT (limit-if-touched) or MIT (market-if-touched)
attached_params.profit_taker_submit_pricestringNOTake-profit limit order submitted price, required when activate_order_type is LIT
attached_params.stop_loss_submit_pricestringNOStop-loss limit order submitted price, required when activate_order_type is LIT
attached_params.activate_rthstringNOWhether the order submitted after triggering allows pre/post market trading

Enum Value:
RTH_ONLY - Regular trading hours only
ANY_TIME - Any time

Request Example

Response

Response Headers

  • Content-Type: application/json

Response Example

json
{
  "code": 0,
  "message": "success",
  "data": {}
}

Response Status

StatusDescriptionSchema
200The submission was successful and the order was commissioned.None
400The replace was rejected with an incorrect request parameter.None