Place Order
POST/api/v1.0/sim-trade/{acc_id}/ordersPlace a simulated trade order. Limit orders require price; quantity and price are strings.
Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
acc_id | string | path | Yes | Business account ID |
market | int | body | Yes | Market (from market_id in account list) |
symbol | string | body | Yes | Security symbol |
order_type | int | body | Yes | 1=Limit 3=Market |
order_side | int | body | Yes | 1=Buy 2=Sell 3=Short Sell 4=Buy Back |
qty | string | body | Yes | Quantity |
price | string | body | No | Price (required for limit orders) |
text | string | body | No | Remark (≤100 bytes) |
order_trade_time_type | int | body | No | Trading session: 0=unset, 1=regular session only, 2=include pre/post-market (supported by US margin accounts) |
Request Example
bash
curl -s -X POST "https://webapi.moomoo.com/api/v1.0/sim-trade/80303779/orders" \
-H "Authorization: Bearer <AccessToken>" \
-H "Content-Type: application/json" \
-d '{"market":1,"symbol":"00700","order_type":1,"order_side":1,"qty":"100","price":"400"}' | jqResponse Fields
| Field | Type | Description |
|---|---|---|
order_id | int64 | Order ID |
Response Example
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"order_id": 1270777
}
}Error response
HTTP status remains 200. A failed request returns ret_code != 0 and an error object.
json
{
"ret_code": -3,
"ret_msg": "invalid request",
"error": {"code": "invalid_parameter", "message": "invalid request"}
}