{"__v":1,"_id":"56951873dcaf0d1700cb86a3","category":{"__v":8,"_id":"56940bc2d8c04d1700e5adb6","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":4,"slug":"orders","title":"Orders"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"563cc7119799fb0d00047685","user":"563cc6fa8894d20d00014ea3","version":{"__v":16,"_id":"563cc7119799fb0d00047688","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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Model T","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-12T15:14:59.731Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"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\":\"3\",\n    \"side\":\"B\",\n    \"instrumentID\":\"675cc7c2-e24b-42fa-9d1f-4b3a97ae8d2f\",\n    \"orderQty\":90,\n    \"price\":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\":\"3\",\n    \"side\":\"B\",\n    \"instrumentID\":\"675cc7c2-e24b-42fa-9d1f-4b3a97ae8d2f\",\n    \"orderQty\":\"90\",\n    \"price\":4\n}' 'http://api.drivewealth.io/v1/orders'","language":"curl"}]},"method":"post","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},{"status":400,"language":"json","code":"{\n  \"code\": 400,\n  \"message\": \"Invalid value: instrumentID\"\n}"}]},"settings":"","auth":"required","params":[{"_id":"56940ce773f48f0d0075c9e0","ref":"","in":"body","required":true,"desc":"Instrument ID.","default":"a67422af-8504-43df-9e63-7361eb0bd99e","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: `\"3\"` - Stop 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":"double","name":"orderQty"},{"_id":"569511bcfe18811700c9bf5a","ref":"","in":"body","required":true,"desc":"Price to buy or sell.","default":"100.25","type":"double","name":"price"},{"_id":"569511bcfe18811700c9bf5b","ref":"","in":"body","required":false,"desc":"User generated comment.","default":"User generated comment","type":"string","name":"comment"}],"url":"/orders/"},"isReference":true,"order":1,"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 - Stop Order](doc:get_stop).\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 - Stop Order](doc:get_stop).\",\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: `\\\"3\\\"` - stop order.\",\n    \"8-1\": \"Order side: either `\\\"B\\\"` - Buy or `\\\"S\\\"` - Sell.\",\n    \"9-1\": \"Order status. will always be `\\\"0\\\"` to response.\"\n  },\n  \"cols\": 2,\n  \"rows\": 10\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Stop Order Notes\"\n}\n[/block]\n#### Buy Stop Order Notes\nIf a user enters a buy stop order, they will enter the market (if executed) above the current ask price. The following rules apply:\n\n1.  User must enter a price that's $0.05 above the current ask price.\n2.  Practice buy stop orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays).\n3.  For live market, buy stop orders are always accepted except between 4:00pm - 4:15 EST, stop orders are rejected.\n4.  The buy stop order is successfully accepted when the `leavesQty` is set to the quantity entered and `ordStatus` is set to `\"0\"`. If the order is rejected, `ordStatus` would be set to `\"8\"`.\n    -  If either `leavesQty` or `ordStatus` is not equal to the above values, query the [Get - Stop Order](doc:get_stop) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio.\n5.  Buy stop orders are good until cancelled.\n\n#### Sell Stop Order Notes\nIf a user enters a sell stop order, they will sell their position (some or all) to the market below the current bid price. The following rules apply:\n\n1.  User must enter a price that's $0.05 below the current bid price.\n2.  Practice buy stop orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays).\n3.  For live market, buy stop orders are always accepted except between 4:00pm - 4:15 EST, stop orders are rejected.\n4.  The sell stop 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 - Stop Order](doc:get_stop) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio.\n5.  Sell stop orders are good until cancelled.","excerpt":"Add a new stop order.","slug":"add-stop-order","type":"endpoint","title":"Create Order (Stop Order)"}

postCreate Order (Stop Order)

Add a new stop order.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

instrumentID:
required
stringa67422af-8504-43df-9e63-7361eb0bd99e
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: `"3"` - Stop order.
side:
required
stringB
Side of order: `"B"` - Buy or `"S"` - Sell.
orderQty:
required
double1
Whole number of shares.
price:
required
double100.25
Price to buy or sell.
comment:
stringUser generated comment
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 - Stop Order](doc:get_stop). [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 - Stop Order](doc:get_stop).", "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: `\"3\"` - stop order.", "8-1": "Order side: either `\"B\"` - Buy or `\"S\"` - Sell.", "9-1": "Order status. will always be `\"0\"` to response." }, "cols": 2, "rows": 10 } [/block] [block:api-header] { "type": "basic", "title": "Stop Order Notes" } [/block] #### Buy Stop Order Notes If a user enters a buy stop order, they will enter the market (if executed) above the current ask price. The following rules apply: 1. User must enter a price that's $0.05 above the current ask price. 2. Practice buy stop orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays). 3. For live market, buy stop orders are always accepted except between 4:00pm - 4:15 EST, stop orders are rejected. 4. The buy stop order is successfully accepted when the `leavesQty` is set to the quantity entered and `ordStatus` is set to `"0"`. If the order is rejected, `ordStatus` would be set to `"8"`. - If either `leavesQty` or `ordStatus` is not equal to the above values, query the [Get - Stop Order](doc:get_stop) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio. 5. Buy stop orders are good until cancelled. #### Sell Stop Order Notes If a user enters a sell stop order, they will sell their position (some or all) to the market below the current bid price. The following rules apply: 1. User must enter a price that's $0.05 below the current bid price. 2. Practice buy stop orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays). 3. For live market, buy stop orders are always accepted except between 4:00pm - 4:15 EST, stop orders are rejected. 4. The sell stop 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 - Stop Order](doc:get_stop) every 2 seconds for a total of 10 seconds. After 10 seconds, display a message to check portfolio. 5. Sell stop orders are good until cancelled.

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 }}