Place an order
-X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Authorization: Bearer {token here}'
-d '{ \
"account_number": "12345678@vision", \
"symbol": "BAC", \
"quantity": 1, \
"price": 20, \
"time_in_force": "day", \
"order_type": "limit", \
"side": "buy", \
"exchange": "auto", \
"client_order_id": "01HWYX297HG2J9V607VSY4GQ3S", \
"tag": "order #12" \
}' 'https://api.lime.co/orders/place'
Single order request example
{
"account_number": "12345678@vision",
"symbol": "BAC",
"quantity": 1,
"price": 20.0,
"time_in_force": "day",
"order_type": "limit",
"side": "buy",
"exchange": "auto",
"client_order_id": "01HWYX297HG2J9V607VSY4GQ3S",
"tag": "order #12"
}
Multi-leg order request example
{
"account_number": "12345678@vision",
"symbol": "BAC",
"quantity": 2,
"price": 20,
"time_in_force": "day",
"order_type": "limit",
"side": "buy",
"exchange": "auto",
"client_order_id": "01JA8H7SQ6HYCPYQPNSGWB8NWH",
"tag": "BAC debit call spread #1",
"legs": [
{
"symbol": "BAC 250117C00032000",
"quantity": 1,
"side": "buy"
},
{
"symbol": "BAC 250117C00035000",
"quantity": 1,
"side": "sell"
}
]
}
Response example
{
"success": true,
"data": "201710041710516537"
}
The order is accepted immediately, the method returns an assigned id. The order is still validated with exactly the same logic as the Validate an order method and is sent to the market on a successful validation pass. Otherwise, the order will be rejected asynchronously, and you can query its status by calling the Get order details method.
Request
name | type | description |
---|---|---|
account_number | string | Required. The account number in the format of 123456578@vision |
symbol | string | Required. The security symbol, stocks in CQS or CMS convention, options in OCC |
quantity | number | Required. Positive integer, number of shares, options contracts or multi-leg orders |
price | number | Required. Positive decimal if the order_type is limit |
time_in_force | string | Optional, day by default. Specifies how long the order remains in effect. Possible values are day - regular hours, ext - extended hours, on-open - opening auction, on-close - closing auction, ioc - immediate or cancel, fok - fill or kill |
order_type | string | Optional, market by default. Possible values are market , limit . More values to come |
side | string | Optional, buy by default. Available values are buy and sell . buy opens long position, sell closes the position. The system will detemine the proper side according to the current position, but you are still required to place two orders to revert the position from long to short and the other way around.For multi-leg order use buy , if net debit or even. Use sell , if net credit |
exchange | string | Optional, auto by default. The routing instructions for order execution. The actual values are dynamic and depend on the account settings. Use Get account routes method to get a list of all available routes and their properties |
client_order_id | string | Optional, automatically generated if not set. A unique order identifier that is used to prevent duplicate orders from being submitted. Maximum length of 32 alphanumeric characters |
tag | string | Optional. Any comment to specify with an order. Maximum length of 32 characters: 0-9 , a-z , A-Z , , ! , # , $ , ( , ) , * , + , - , . , , , / , : , ; , = and _ |
legs | array | Required for a multi-leg order, array of leg elements |
Legs array element:
name | type | description |
---|---|---|
symbol | string | Required. Leg security symbol, stocks in CQS or CMS convention, options in OCC |
quantity | number | Required. Positive integer, leg ratio quantity. The total leg quantity will be calculated as the product of the leg ratio quantity by the order quantity |
side | string | Required. Available values are buy and sell |
Response
name | type | description |
---|---|---|
success | boolean | Place order status: true or false |
data | string | The id assigned to the order |