Skip to content

Place Order ​

POST /api/v1.0/accounts/{acc_id}/orders

Place a new order.

How to read the place result

  • This endpoint requires OAuth trade:write. If you get insufficient permission, confirm the token scope includes it — see Getting Started · Scopes.
  • s is ok: accepted; order ID is in d.order_id.
  • 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.
  • Other errors: handle via errcode / errmsg.

need_order_confirm, confirm_id, and jump_url are top-level fields, not inside d. See Order Confirm.

Path Parameters ​

ParameterTypeRequiredDescription
acc_idstringYesBusiness account ID.

Request Parameters ​

ParameterTypePositionRequiredDescription
codestringbodyConditionalTradable symbol. Format: market.symbol, e.g. US.AAPL, US.AAPL250926C235000. Required for regular orders; omit when order_class is MLEG (synthesized from multi_leg_info.leg_infos).
qtystringbodyYesOrder quantity. The unit of options and futures is "contract".
pricestringbodyNoOrder price. 9 decimal places for futures accounts, 5 for forex accounts, 4 for securities accounts; excess is rounded.
sidetrd_sidebodyYesTrading direction
order_typeorder_typebodyYesOrder type
time_in_forcetime_in_forcebodyYesValid period
expire_timeuint64bodyConditionalUnix timestamp in microseconds. Required when time_in_force is GTD.
sessiontrading_sessionbodyNoTrading session (US stocks only). Market orders only support RTH.
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_typebodyNoTrailing stop type. Only for TRAILING_STOP and TRAILING_STOP_LIMIT orders.
trail_valuestringbodyNoTrailing amount or percentage. Only for trailing stop orders.
trail_spreadstringbodyNoTrailing spread. Only for TRAILING_STOP_LIMIT orders.
lot_typelot_typebodyNoLot type, default round lot. Used for HK / JP stock trading.
remarkstringbodyNoRemark. Maximum length after converting to UTF-8 is 64 bytes.
order_classorder_classbodyNoOrder class. Specify as MLEG for multi-leg orders. Combo options are not supported for JP brokers.
multi_leg_infomulti_leg_infobodyNoMulti-leg order info. Required when placing multi-leg orders.
sub_acc_idstringbodyConditionalRequired for JP accounts. Sub-account id, selected by the client from the account's sub_accounts[] (returned by the Get Authorized Trading Accounts interface). Ignored by non-JP brokers.
position_idstringbodyConditionalRequired for forex close orders (SELL / BUY_BACK). Optional elsewhere: closes the specified position when provided; if omitted, quantity is allocated automatically across positions of the same symbol.
position_open_typeposition_open_typebodyNoOpen type. Only for trailing stop orders (TRAILING_STOP, TRAILING_STOP_LIMIT), controls whether opening new positions is allowed.
algo_infoalgo_infobodyNoAlgo params. Required when order_type is an algo type. Structure mirrors the response algo_info; the twap/vwap/pov/slicer/peg/iceberg sub-structures contain algo-specific required fields, see Naming Dictionary.

Supported order types ​

Supported order_type values are grouped below (full list: Naming Dictionary · order_type). Whether an order can be placed still depends on the account market, symbol, and trading permissions; unsupported requests return an error.

Multi-leg combo options use order_class=MLEG with multi_leg_info; that is not a separate order_type. JP brokers do not support combo options.

Basic ​

order_typeMeaningKey extra fields
LIMITLimitUsually send price
MARKETMarketUsually omit price; US session supports RTH only
AUCTIONAt-auction marketOften HK auction
AUCTION_LIMITAt-auction limitSame, usually with price

Stop / if-touched ​

order_typeMeaningKey extra fields
STOPStop marketRequired aux_price
STOP_LIMITStop limitRequired aux_price, usually also price
MARKET_IF_TOUCHEDMarket if touchedRequired aux_price
LIMIT_IF_TOUCHEDLimit if touchedRequired aux_price, usually also price

Trailing stop ​

order_typeMeaningKey extra fields
TRAILING_STOPTrailing stop marketRequired trail_type, trail_value; optional position_open_type
TRAILING_STOP_LIMITTrailing stop limitAbove + required trail_spread

Algo ​

Algo order_type values require algo_info. Type-specific sub-structures: Naming Dictionary · algo_info.

order_typeMeaningType-specific constraints (summary)
TWAP / TWAP_LIMITTWAP market / limitalgo_info.twap.participation_rate
VWAP / VWAP_LIMITVWAP market / limitalgo_info.vwap.participation_rate
POV / POV_LIMITPOV market / limit (% of volume)algo_info.pov.participation_rate
SLICER / SLICER_LIMITSlicer market / limitalgo_info.slicer; at least one of slice_interval or display_qty
PEG / PEG_LIMITPeg market / limitdisplay_qty, peg_offset
ICEBERG_LIMITIceberg limitalgo_info.iceberg.display_qty; non-US also needs start_time / end_time (US may omit)

Request Example ​

Limit buy. Buy 100 shares of US.AAPL at 150 USD, valid for the day.

bash
curl -X POST 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/orders' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <AccessToken>' \
  -d '{
    "code": "US.AAPL",
    "qty": "100",
    "price": "150.00",
    "side": "BUY",
    "order_type": "LIMIT",
    "time_in_force": "DAY"
  }' | jq

Market sell. Sell 100 shares of HK.00700, valid for the day. A market order omits price.

bash
curl -X POST 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/orders' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <AccessToken>' \
  -d '{
    "code": "HK.00700",
    "qty": "100",
    "side": "SELL",
    "order_type": "MARKET",
    "time_in_force": "DAY"
  }' | jq

Stop limit. STOP_LIMIT requires trigger price aux_price and limit price price. GTC stays open until you cancel it.

bash
curl -X POST 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/orders' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <AccessToken>' \
  -d '{
    "code": "US.NVDA",
    "qty": "100",
    "price": "999.00",
    "aux_price": "1000.00",
    "side": "SELL",
    "order_type": "STOP_LIMIT",
    "time_in_force": "GTC"
  }' | jq

Trailing stop limit. TRAILING_STOP_LIMIT requires trail_type, trail_value, and trail_spread. GTD requires expire_time in microseconds, later than now. With RATIO, trail_value 0.5 means 0.5%.

bash
curl -X POST 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/orders' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <AccessToken>' \
  -d '{
    "code": "US.NVDA",
    "qty": "100",
    "side": "SELL",
    "order_type": "TRAILING_STOP_LIMIT",
    "time_in_force": "GTD",
    "expire_time": 1814313600000000,
    "trail_type": "RATIO",
    "trail_value": "0.5",
    "trail_spread": "1.2"
  }' | jq

TWAP limit algo order. algo_info is required, with start_time and end_time (end_time later than start_time) and twap.participation_rate. A limit-style algo order also sends price.

bash
curl -X POST 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/orders' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <AccessToken>' \
  -d '{
    "code": "US.AAPL",
    "qty": "100",
    "side": "BUY",
    "order_type": "TWAP_LIMIT",
    "time_in_force": "DAY",
    "price": "150.00",
    "algo_info": {
      "start_time": 1798761600000000,
      "end_time": 1798765200000000,
      "pricing_strategy": "ADAPTIVE",
      "layering": "AUTO",
      "twap": {
        "participation_rate": "20"
      }
    }
  }' | jq

Response Parameters ​

FieldTypeDescription
order_idstringOrder ID of the newly created order.

Top-level fields need_order_confirm, confirm_id, and jump_url may also be returned; see the examples and notes below.

Response Example ​

json
{
  "s": "ok",
  "d": {
    "order_id": "FH1D5B797DAC864000"
  }
}

Failure:

Business error:

json
{
  "s": "error",
  "errcode": 344,
  "errmsg": "Trading for this market not activated.",
  "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"
}

Authentication failure. An invalid Access Token returns this body on every API. The fields are code and trace_id, not s / errcode:

json
{
  "code": -12006,
  "trace_id": "385e116c10c8d386334acfc839f63251"
}