Place order¶
Buy or sell a US stock or ETF, or a UCITS ETF listed on the LSE. Every order is a live order on your account.
POST /v1/order/place · limit 5 per minute, and at most 5 per second
Request¶
| Field | Type | Required | Rule |
|---|---|---|---|
security_id | string | Yes | From Instruments, e.g. "116532" |
txn_type | string | Yes | BUY or SELL (any case) |
order_type | string | Yes | MARKET or LIMIT (any case) |
quantity | number | One of quantity / amount | Shares, whole or fractional |
amount | number | One of quantity / amount | USD to spend or receive, up to 2 decimals. MARKET + DAY only |
price | number | LIMIT only | Limit price. Leave it out for MARKET |
validity | string | Yes | DAY or GTC (good till cancelled) |
extended_hours | bool | No | Default false. true needs LIMIT + DAY |
sl_trigger_price | number | No | Stop-loss trigger. See bracket orders |
tgt_limit_price | number | No | Target price. See bracket orders |
remarks | string | No | Your own note, up to 100 characters |
Send exactly one of quantity or amount. Send numbers as JSON numbers, not strings. Fields not listed here are rejected.
Examples¶
LIMIT buy below the market¶
A LIMIT order priced well below the market stays open without filling, so you can cancel it. This makes it a good first order to try.
curl --location 'https://api.indmoneyglobal.com/v1/order/place' \
--header 'Authorization: YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"security_id": "116532",
"txn_type": "BUY",
"order_type": "LIMIT",
"quantity": 1,
"price": 20,
"validity": "DAY",
"remarks": "first-order"
}'
Note
A BUY LIMIT order blocks price × quantity + fees from your trading balance until it fills or is cancelled.
MARKET buy by dollar amount¶
This order executes at the market price.
{"security_id": "116532", "txn_type": "BUY", "order_type": "MARKET", "amount": 10, "validity": "DAY"}
MARKET sell of a fractional quantity¶
{"security_id": "116532", "txn_type": "SELL", "order_type": "MARKET", "quantity": 0.024789, "validity": "DAY"}
Response¶
202 Accepted
ACCEPTED means we've received your order. Save the order_id and check Get order to follow it to a final status.
Retrying an order
Each place request creates a new order. If a request times out or the connection drops before you get a response, check the order book to see whether the order was placed before you send it again.
Order rules¶
| Instruction | Rule |
|---|---|
amount (dollar order) | MARKET + DAY only |
Fractional quantity | DAY only; the instrument must have IS_FRACTIONABLE = true |
| GTC | Whole shares only; amount isn't allowed |
| Extended hours | LIMIT + DAY, without stop-loss or target; the instrument must have EXT_HOURS_ELIGIBLE = true |
| SELL | You must hold the stock |
| MARKET BUY by quantity outside regular hours | Not allowed |
Bracket orders¶
Add a stop-loss, a target or both to a MARKET order. LIMIT orders can't carry them.
| Field | Allowed on | Price must be |
|---|---|---|
sl_trigger_price | BUY and SELL | Below the last price: more than last price − 50% and less than last price − $0.01 |
tgt_limit_price | BUY | Above the last price: more than last price + $0.01 and less than last price + 50% |
- Whole shares only, regular hours only.
- On a MARKET SELL,
sl_trigger_priceon its own places a stop order (DAY only). - A price outside its range returns 400
invalid_order_payload.
This order executes at the market price:
{
"security_id": "116532",
"txn_type": "BUY",
"order_type": "MARKET",
"quantity": 1,
"validity": "DAY",
"sl_trigger_price": 360,
"tgt_limit_price": 400
}
Errors¶
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_order_payload | A rule above is broken, a field is missing or not recognised, a price is outside its range, or the stock can't be traded right now |
| 400 | invalid_payload | The body isn't valid JSON, or a number was sent as a string |
| 400 | invalid_security_id | Unknown security_id |
| 400 | no_position | SELL for a stock you don't hold |
| 400 | insufficient_balance | Not enough trading balance; the order is recorded as REJECTED |
| 403 | account_not_tradable | Your US stocks account isn't open for trading |
| 403 | trading_blocked | This order can't be placed right now, for example because the market is closed for this order type, a corporate action is in progress, or your account has a restriction |
| 403 | restricted_stock | This stock can't be bought |
| 403 | limit_orders_not_enabled | LIMIT orders aren't enabled for your account yet |
| 429 | rate_limit_exceeded | Over the limit; wait for Retry-After |
| 503 | order_outcome_unknown | We couldn't confirm whether the order was placed. Check the order book before you send it again |
| 503 | security_unavailable, order_unavailable, account_unavailable, position_unavailable | Temporarily unavailable; no order was placed. Try again after a short wait |
Full list: Errors.