Skip to content
Order Modification

Modify Options Order

Modifies the price or quantity of an open options order and can adjust the attached take-profit and stop-loss orders at the same time. The price of a limit-type order cannot be 0. A successful response means only that the modification request was accepted; check the final state through the order details or order push updates. On success, refresh the order list and assets. On failure, show message; the original order remains unchanged.

When you call this operation through WhaleCore requestService(), set requiresTradeToken to true.

WhaleCore's orderService() wraps this endpoint as the typed method replaceOrder. If you use WhaleCore, prefer that method.

POSThttps://api.lbkrs.com/v1/tube/stock_contract/replace

Request body application/json

order_idstringrequired

ID of the order to modify

order_id_strstring

String form of the order ID; pass the same value as order_id

quantitystringrequired

New order quantity, in contracts

pricestring

New order price. It cannot be 0

attached_paramsobject

Parameters for modifying attached take-profit and stop-loss orders

Child attributes
attached_order_typeinteger

Attached order type:

  • 0 - No attached order; if the original order has attached orders, also pass cancel_all_attached=true to cancel them all
  • 1 - Take-profit order
  • 2 - Stop-loss order
  • 3 - Bracket order (both take-profit and stop-loss)
Values
0
1
2
3
profit_taker_pricestring

Take-profit trigger price

profit_taker_idstring

ID of the existing take-profit order; pass it when modifying that order

profit_taker_submit_pricestring

Order price after the take-profit order is activated; pass it when the activated order type is a limit type

stop_loss_pricestring

Stop-loss trigger price

stop_loss_idstring

ID of the existing stop-loss order; pass it when modifying that order

stop_loss_submit_pricestring

Order price after the stop-loss order is activated; pass it when the activated order type is a limit type

activate_order_typestring

Order type after the attached order is activated

activate_rthstring

Trading session after the attached order is activated:

  • 1 - Pre-market and after-hours not allowed
  • 2 - Pre-market and after-hours allowed
time_in_forceinteger

Time in force:

  • 0 - Day
  • 1 - Good till canceled (GTC)
  • 3 - Immediate or cancel (IOC)
  • 5 - Fill or kill (FOK)
  • 6 - Good till date (GTD); an expiry time is also required
Values
0
1
3
5
6
expire_timestring

Expiry time as a Unix timestamp in seconds; required when time_in_force=6

cancel_all_attachedboolean

Whether to cancel all attached orders of the main order

main_idstring

Main order ID; required when you modify only the attached orders

quantitystring

Total quantity of the main order; pass it when you modify only the attached orders

market_pricestring

Current market price, including pre-market and after-hours; pass it when you modify only the attached orders

Responses

HTTP 200The request succeeded. The response body contains the result of the “Modify Options Order” operation.
Standard response envelopecodemessagedata
dataobjectdata structure

No business fields

No nested fields

Whale Docs