Modify Order
PUT/api/v1.0/accounts/{acc_id}/orders/{order_id}Modify an existing order.
How to read the modify result
siserrorandneed_order_confirmistrue: confirmation is still required (not a final failure); call Order Confirm with the top-levelconfirm_id.jump_urlis 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
| Parameter | Type | Required | Description |
|---|---|---|---|
acc_id | string | Yes | Business account ID. |
order_id | string | Yes | Order ID. |
Request Parameters
| Parameter | Type | Position | Required | Description |
|---|---|---|---|---|
exchange | exchange | body | Yes | Exchange. See Naming Dictionary - exchange. |
qty | string | body | Yes | The quantity after the order is changed. The unit of options and futures is "contract". |
price | string | body | No | The price after the order is changed. 9 decimal places for futures accounts, 5 for forex accounts, 4 for securities accounts; excess is rounded. |
aux_price | string | body | No | Trigger 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_type | trail_type | body | No | New trailing stop type (only for trailing stop orders). |
trail_value | string | body | No | New trailing amount or percentage (only for trailing stop orders). |
trail_spread | string | body | No | New trailing spread (only for TRAILING_STOP_LIMIT orders). |
algo_info | algo_info | body | No | Algo 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"
}' | jqResponse Parameters
| Field | Type | Description |
|---|---|---|
s | string | Request result. ok on success; error on failure. |
errcode | integer | Error code, returned on failure only. |
errmsg | string | Error message, returned on failure only. |
need_order_confirm | boolean | Whether order confirmation is required. |
confirm_id | string | Confirmation ID, used by the Order Confirm API. |
jump_url | string | Target 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"
}