Skip to content

Modify Order ​

PUT /api/v1.0/accounts/{acc_id}/orders/{order_id}

Modify an existing order.

How to read the modify result

  • s is error and need_order_confirm is true: confirmation is still required (not a final failure); call Order Confirm with the top-level confirm_id.
  • jump_url is present: open it in a browser to continue.
  • These fields are top-level, not inside d. See Order Confirm.

exchange is required. Use the value returned by Open Orders or Order Details (e.g. SEHK for many HK orders). Do not infer it from the symbol (e.g. HK.00700). After a partial fill, the new quantity must not be less than the filled quantity. To estimate replaceable size, call Get Max Qty with order_id.

Path Parameters ​

ParameterTypeRequiredDescription
acc_idstringYesBusiness account ID.
order_idstringYesOrder ID.

Request Parameters ​

ParameterTypePositionRequiredDescription
exchangeexchangebodyYesExchange. See Naming Dictionary - exchange.
qtystringbodyYesThe quantity after the order is changed. The unit of options and futures is "contract".
pricestringbodyNoThe price after the order is changed. 9 decimal places for futures accounts, 5 for forex accounts, 4 for securities accounts; excess is rounded.
aux_pricestringbodyNoTrigger price. Required when order type is STOP, STOP_LIMIT, MARKET_IF_TOUCHED, or LIMIT_IF_TOUCHED. Rounded to 9 decimals for futures accounts, 5 for forex accounts, 3 for securities accounts.
trail_typetrail_typebodyNoNew trailing stop type (only for trailing stop orders).
trail_valuestringbodyNoNew trailing amount or percentage (only for trailing stop orders).
trail_spreadstringbodyNoNew trailing spread (only for TRAILING_STOP_LIMIT orders).
algo_infoalgo_infobodyNoAlgo params. Required when the original order is an algo order and algo params need to be modified. Structure mirrors the response algo_info.

Request Example ​

bash
curl -X PUT 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/orders/{order_id}' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <AccessToken>' \
  -d '{
    "exchange": "US",
    "qty": "200",
    "price": "155.00"
  }' | jq

Response Parameters ​

FieldTypeDescription
sstringRequest result. ok on success; error on failure.
errcodeintegerError code, returned on failure only.
errmsgstringError message, returned on failure only.
need_order_confirmbooleanWhether order confirmation is required.
confirm_idstringConfirmation ID, used by the Order Confirm API.
jump_urlstringTarget URL when the broker requires opening a web page.

Response Example ​

json
{
  "s": "ok"
}

Failure:

Missing required qty:

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

Business error:

json
{
  "s": "error",
  "errcode": 1013,
  "errmsg": "Action failed. This order is partially filled. The new order quantity can't be less than the filled amount. Please adjust the quantity and try again.",
  "need_order_confirm": false
}

Order confirmation required:

json
{
  "s": "error",
  "errcode": 108330261,
  "errmsg": "Due to liquidity and market conditions, you may be unable to open or close positions for this security. Do you want to continue?",
  "need_order_confirm": true,
  "confirm_id": "0a1984f400616ae1b2100008eb430000"
}