{"_id":"56951a76caa32519009c40f4","project":"563cc7119799fb0d00047685","editedParams":true,"editedParams2":true,"__v":1,"parentDoc":null,"user":"563cc6fa8894d20d00014ea3","version":{"_id":"563cc7119799fb0d00047688","__v":17,"project":"563cc7119799fb0d00047685","createdAt":"2015-11-06T15:28:17.683Z","releaseDate":"2015-11-06T15:28:17.683Z","categories":["563cc7129799fb0d00047689","566f37f37ffa002300c3cd5b","56914e9bd47b020d002225ac","5692b19ffe72e00d00e4f0a8","56940bc2d8c04d1700e5adb6","56940bc83e9d080d00f064f0","56951b2dfcb1032d0089df7a","569522aecaa32519009c410c","569523ce562335190016da97","569523fddcaf0d1700cb86bf","56980e4a8560a60d00e2c3c3","569921a41693520d002e1305","5699323b7465970d00650b82","569e6cc4fbee990d0072d927","56a2768a0aefae0d00b7fe66","5862e862b8b7fa23009665b7","592835c7bc8bca0f000cc9ff"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Model T","version_clean":"1.0.0","version":"1"},"category":{"_id":"56940bc2d8c04d1700e5adb6","__v":8,"pages":["56940ce773f48f0d0075c9df","56941dd246b943190027fdf8","5694325e5f1c951900644d0a","569443761005590d0062cacc","5694450e46b943190027fe45","569511bcfe18811700c9bf59","56951873dcaf0d1700cb86a3","56951a76caa32519009c40f4"],"project":"563cc7119799fb0d00047685","version":"563cc7119799fb0d00047688","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-11T20:08:34.666Z","from_sync":false,"order":5,"slug":"orders","title":"Orders"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-12T15:23:34.314Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"New","code":"{\n    \"execID\": \"0\",\n    \"orderID\": \"DA.14f198a0-6eea-4b46-80d4-f80b14260601\",\n    \"cumQty\": 0,\n    \"instrumentID\": \"675cc7c2-e24b-42fa-9d1f-4b3a97ae8d2f\",\n    \"execType\": \"0\",\n    \"grossTradeAmt\": 0,\n    \"leavesQty\": 90,\n    \"ordType\": \"3\",\n    \"side\": \"B\",\n    \"ordStatus\": \"0\",\n    \"limitPrice\": 0\n}","language":"json","status":200},{"code":"{\n  \"code\": 400,\n  \"message\": \"Invalid value: instrumentID\"\n}","status":400,"language":"json"}]},"settings":"","examples":{"codes":[{"language":"http","code":"POST /v1/orders HTTP/1.1\nHost: api.drivewealth.io\nAccept: application/json\nContent-Type: application/json\nx-mysolomeo-session-key: 02e57c7d-d071-4c63-b491-1194a9939ea5.2016-01-13T22:34:53.101Z\n\n{\n    \"accountID\":\"02e57c7d-d071-4c63-b491-1194a9939ea5.1452548617456\",\n    \"accountNo\":\"DWTE000005\",\n    \"userID\":\"02e57c7d-d071-4c63-b491-1194a9939ea5\",\n    \"accountType\":2,\n    \"ordType\":\"2\",\n    \"side\":\"B\",\n    \"instrumentID\":\"675cc7c2-e24b-42fa-9d1f-4b3a97ae8d2f\",\n    \"orderQty\":90,\n    \"limitPrice\":4\n}"},{"code":"curl -X POST -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"x-mysolomeo-session-key: 02e57c7d-d071-4c63-b491-1194a9939ea5.2016-01-13T22:34:53.101Z\" -d '{\n    \"accountID\":\"02e57c7d-d071-4c63-b491-1194a9939ea5.1452548617456\",\n    \"accountNo\":\"DWTE000005\",\n    \"userID\":\"02e57c7d-d071-4c63-b491-1194a9939ea5\",\n    \"accountType\":2,\n    \"ordType\":\"2\",\n    \"side\":\"B\",\n    \"instrumentID\":\"675cc7c2-e24b-42fa-9d1f-4b3a97ae8d2f\",\n    \"orderQty\":\"90\",\n    \"limitPrice\":4\n}' 'http://api.drivewealth.io/v1/orders'","language":"curl"}]},"method":"post","auth":"required","params":[{"_id":"56940ce773f48f0d0075c9e0","ref":"","in":"body","required":true,"desc":"Instrument ID.","default":"DA.5f674a8a-203e-49a3-b474-7bb271c61507","type":"string","name":"instrumentID"},{"_id":"569511bcfe18811700c9bf62","ref":"","in":"body","required":true,"desc":"Account ID.","default":"02e57c7d-d071-4c63-b491-1194a9939ea5.1452548617456","type":"string","name":"accountID"},{"_id":"569511bcfe18811700c9bf61","ref":"","in":"body","required":true,"desc":"Account Number.","default":"DWTE000005","type":"string","name":"accountNo"},{"_id":"569511bcfe18811700c9bf60","ref":"","in":"body","required":true,"desc":"User ID.","default":"02e57c7d-d071-4c63-b491-1194a9939ea5","type":"string","name":"userID"},{"_id":"569511bcfe18811700c9bf5f","ref":"","in":"body","required":true,"desc":"Type of account: `\"1\"` - Practice or `\"2\"` - Live.","default":"2","type":"int","name":"accountType"},{"_id":"569511bcfe18811700c9bf5e","ref":"","in":"body","required":true,"desc":"Type of order: `\"2\"` - Limit order.","default":"3","type":"string","name":"ordType"},{"_id":"569511bcfe18811700c9bf5d","ref":"","in":"body","required":true,"desc":"Side of order: `\"B\"` - Buy or `\"S\"` - Sell.","default":"B","type":"string","name":"side"},{"_id":"569511bcfe18811700c9bf5c","ref":"","in":"body","required":true,"desc":"Whole number of shares.","default":"1","type":"int","name":"orderQty"},{"_id":"569511bcfe18811700c9bf5a","ref":"","in":"body","required":true,"desc":"Price to buy or sell.","default":"150","type":"double","name":"limitPrice"},{"_id":"569511bcfe18811700c9bf5b","ref":"","in":"body","required":false,"desc":"User generated comment.","default":"Generated by Me","type":"string","name":"comment"}],"url":"/orders/"},"isReference":true,"order":2,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response\"\n}\n[/block]\nThe response will contain a single order object and is successfully accepted when there is a response (see \"Result Format\"). To get status of this order, see [Get - Limit Order](doc:get-limit-order) .\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Execution ID and will be always be `\\\"0\\\"` in response.\",\n    \"0-0\": \"`execID`\",\n    \"1-0\": \"`orderID`\",\n    \"2-0\": \"`cumQty`\",\n    \"3-0\": \"`instrumentID`\",\n    \"4-0\": \"`execType`\",\n    \"5-0\": \"`grossTradeAmt`\",\n    \"6-0\": \"`leavesQty`\",\n    \"7-0\": \"`ordType`\",\n    \"8-0\": \"`side`\",\n    \"9-0\": \"`ordStatus`\",\n    \"1-1\": \"Order ID that will be used to query it's status via [Get - Limit Order](doc:get-limit-order).\",\n    \"2-1\": \"Cumulative filled quantity that will always be `0` in response.\",\n    \"3-1\": \"Instrument ID.\",\n    \"4-1\": \"Execution type.  Will always be `\\\"0\\\"` to response.\",\n    \"5-1\": \"Gross trade amount.  Will always be `0` to response.\",\n    \"6-1\": \"Quantity still needing to be executed. will always be the requested order quantity in response.\",\n    \"7-1\": \"Type of order: `\\\"2\\\"` - limit order.\",\n    \"8-1\": \"Order side: either `\\\"B\\\"` - Buy or `\\\"S\\\"` - Sell.\",\n    \"9-1\": \"Order status. Will always be `\\\"0\\\"` to response.\",\n    \"10-0\": \"`limitPrice`\",\n    \"12-0\": \"`expireTimestamp`\",\n    \"12-1\": \"ISO time stamp of when the order will expire.\",\n    \"11-0\": \"`timeInForce`\",\n    \"11-1\": \"Time in force. Will always be `\\\"0\\\"` to response.\",\n    \"10-1\": \"Entered price.\"\n  },\n  \"cols\": 2,\n  \"rows\": 13\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Limit Order Notes\"\n}\n[/block]\n#### Buy Limit Order Notes\n\nA buy limit order will execute in the market when the market ask price is at or below the order limit price. The following rules apply:\n\n1.  The buy limit orders are only good for day.\n    -  Query the [Get - Limit Order](doc:get-limit-order) will respond when the order will expire in UTC time.\n2.  If the price entered is above the current ask price, the limit will be immediately executed (unless after market hours in live).\n3.  The buy limit order is successfully accepted when the `leavesQty` is set to the quantity entered and `ordStatus` is set to `\"0\"`.\n    -  If either `leavesQty` or `ordStatus` is not equal to the above values, query the [Get - Limit Order](doc:get-limit-order) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio.\n\n#### Sell Limit Order Notes\n\nA sell limit order will execute in the market when the market bid price is at or above the order limit price. The following rules apply:\n\n1.  The sell limit orders are only good for day.\n    -  Query the [Get - Limit Order](doc:get-limit-order) will respond when the order will expire in UTC time.\n2.  If the price entered is below the current ask price, the limit will be immediately executed (unless after market hours in live).\n3.  The sell limit order is successfully accepted when the `leavesQty` is set to the quantity entered and `ordStatus` is set to `\"0\"`.\n    -  If either `leavesQty` or `ordStatus` is not equal to the above values, query the [Get - Limit Order](doc:get-limit-order) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio.","excerpt":"Add a new limit order.","slug":"add-limit-order","type":"endpoint","title":"Create Order (Limit Order)"}

postCreate Order (Limit Order)

Add a new limit order.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

instrumentID:
required
stringDA.5f674a8a-203e-49a3-b474-7bb271c61507
Instrument ID.
accountID:
required
string02e57c7d-d071-4c63-b491-1194a9939ea5.1452548617456
Account ID.
accountNo:
required
stringDWTE000005
Account Number.
userID:
required
string02e57c7d-d071-4c63-b491-1194a9939ea5
User ID.
accountType:
required
integer2
Type of account: `"1"` - Practice or `"2"` - Live.
ordType:
required
string3
Type of order: `"2"` - Limit order.
side:
required
stringB
Side of order: `"B"` - Buy or `"S"` - Sell.
orderQty:
required
integer1
Whole number of shares.
limitPrice:
required
double150
Price to buy or sell.
comment:
stringGenerated by Me
User generated comment.

Examples


Result Format


Documentation

[block:api-header] { "type": "basic", "title": "Response" } [/block] The response will contain a single order object and is successfully accepted when there is a response (see "Result Format"). To get status of this order, see [Get - Limit Order](doc:get-limit-order) . [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Description", "0-1": "Execution ID and will be always be `\"0\"` in response.", "0-0": "`execID`", "1-0": "`orderID`", "2-0": "`cumQty`", "3-0": "`instrumentID`", "4-0": "`execType`", "5-0": "`grossTradeAmt`", "6-0": "`leavesQty`", "7-0": "`ordType`", "8-0": "`side`", "9-0": "`ordStatus`", "1-1": "Order ID that will be used to query it's status via [Get - Limit Order](doc:get-limit-order).", "2-1": "Cumulative filled quantity that will always be `0` in response.", "3-1": "Instrument ID.", "4-1": "Execution type. Will always be `\"0\"` to response.", "5-1": "Gross trade amount. Will always be `0` to response.", "6-1": "Quantity still needing to be executed. will always be the requested order quantity in response.", "7-1": "Type of order: `\"2\"` - limit order.", "8-1": "Order side: either `\"B\"` - Buy or `\"S\"` - Sell.", "9-1": "Order status. Will always be `\"0\"` to response.", "10-0": "`limitPrice`", "12-0": "`expireTimestamp`", "12-1": "ISO time stamp of when the order will expire.", "11-0": "`timeInForce`", "11-1": "Time in force. Will always be `\"0\"` to response.", "10-1": "Entered price." }, "cols": 2, "rows": 13 } [/block] [block:api-header] { "type": "basic", "title": "Limit Order Notes" } [/block] #### Buy Limit Order Notes A buy limit order will execute in the market when the market ask price is at or below the order limit price. The following rules apply: 1. The buy limit orders are only good for day. - Query the [Get - Limit Order](doc:get-limit-order) will respond when the order will expire in UTC time. 2. If the price entered is above the current ask price, the limit will be immediately executed (unless after market hours in live). 3. The buy limit order is successfully accepted when the `leavesQty` is set to the quantity entered and `ordStatus` is set to `"0"`. - If either `leavesQty` or `ordStatus` is not equal to the above values, query the [Get - Limit Order](doc:get-limit-order) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio. #### Sell Limit Order Notes A sell limit order will execute in the market when the market bid price is at or above the order limit price. The following rules apply: 1. The sell limit orders are only good for day. - Query the [Get - Limit Order](doc:get-limit-order) will respond when the order will expire in UTC time. 2. If the price entered is below the current ask price, the limit will be immediately executed (unless after market hours in live). 3. The sell limit order is successfully accepted when the `leavesQty` is set to the quantity entered and `ordStatus` is set to `"0"`. - If either `leavesQty` or `ordStatus` is not equal to the above values, query the [Get - Limit Order](doc:get-limit-order) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}