{"__v":1,"_id":"569511bcfe18811700c9bf59","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-12T14:46:20.448Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"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-20T20:50:48.680Z\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\":\"1\",\n    \"side\":\"B\",\n    \"instrumentID\":\"06926627-e950-48f3-9c53-b679f61120ec\",\n    \"orderQty\":1.4312,\n    \"comment\":\"\"\n}","language":"http"},{"language":"curl","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-20T20:50:48.680Z\" -d '{\n    \"accountID\":\"02e57c7d-d071-4c63-b491-1194a9939ea5.1452548617456\",\n    \"accountNo\":\"DWTE000005\",\n    \"userID\":\"02e57c7d-d071-4c63-b491-1194a9939ea5\",\n    \"accountType\":2,\n    \"ordType\":\"1\",\n    \"side\":\"B\",\n    \"instrumentID\":\"06926627-e950-48f3-9c53-b679f61120ec\",\n    \"orderQty\":1.4312,\n    \"comment\":\"\"\n}' \"http://api.drivewealth.io/v1/orders\""}]},"results":{"codes":[{"name":"New","code":"{\n    \"orderID\": \"DB.f88c392e-4d0a-4893-9623-baf72ac0296a\",\n    \"instrumentID\": \"06926627-e950-48f3-9c53-b679f61120ec\",\n    \"leavesQty\": 1.4312,\n    \"ordType\": \"1\",\n    \"side\": \"B\",\n    \"limitPrice\": 0,\n    \"timeInForce\": \"0\",\n    \"expireTimestamp\": \"2016-02-08T21:00:00.000Z\",\n    \"statusPath\": \"/v1/orders/DB.f88c392e-4d0a-4893-9623-baf72ac0296a\"\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: `\"1\"` - Market order.","default":"1","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":"Number of shares up to four decimal places.","default":"1.0000","type":"double","name":"orderQty"},{"_id":"571f8c3459debc2b00f726e5","ref":"","in":"body","required":false,"desc":"The dollar amount of shares to purchase.","default":"20","type":"string","name":"amountCash"},{"_id":"569511bcfe18811700c9bf5b","ref":"","in":"body","required":false,"desc":"User generated comment.","default":"Generated by Me","type":"string","name":"comment"},{"_id":"569511bcfe18811700c9bf5a","ref":"","in":"body","required":false,"desc":"Auto-generated stop order placed this percentage below VWAP. The stop order is placed after this market order is executed.<br />**\"Auto-Stop\" Calculation:** AP - (AP x `autoStop`).","default":"20","type":"int","name":"autoStop"}],"url":"/orders/"},"isReference":true,"order":0,"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 - Market Order](doc:get_market).\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`orderID`\",\n    \"1-0\": \"`instrumentID`\",\n    \"2-0\": \"`leavesQty`\",\n    \"3-0\": \"`ordType`\",\n    \"4-0\": \"`side`\",\n    \"5-0\": \"`ordStatus`\",\n    \"6-0\": \"`expireTimestamp`\",\n    \"0-1\": \"Order ID that will be used to query it's status via [Get - Market Order](doc:get_market).\",\n    \"1-1\": \"Instrument ID.\",\n    \"2-1\": \"Quantity still needing to be executed. will always be the requested order quantity in response.\",\n    \"3-1\": \"Type of order: `\\\"1\\\"` - market order.\",\n    \"4-1\": \"Order side: either `\\\"B\\\"` - Buy or `\\\"S\\\"` - Sell.\",\n    \"5-1\": \"Order status. will always be `\\\"0\\\"` to response.\",\n    \"6-1\": \"ISO time stamp of when the order will expire.\",\n    \"7-0\": \"`statusPath`\",\n    \"7-1\": \"Path to check status of order\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Market Order Notes\"\n}\n[/block]\n#### Buy Market Order Notes\nIf a user wants to buy an instrument, the following rules apply:\n\n1.  Use the Ask when calculating or displaying market rate.\n2.  Must have sufficient cash to cover the amount requested plus commission. \n    -  Commission rate attached to a user's account and is available when the user logs in via [Create Session](doc:create-session).\n3.  Practice buy market orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays).\n4.  For live market, buy market orders are only executed when the market is open. Between 4:00pm - 4:15 EST, market orders are rejected. After 4:15pm EST, market orders are accepted for next market open.\n\n#### Sell Market Order Notes\nIf a user wants to sell an instrument , the following rules apply:\n\n1.  Use the Bid when calculating or display market rate.\n2.  User must own the shares before selling. Short selling is currently not permitted.\n3.  Practice sell market orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays).\n4.  For live market, sell market orders are only executed when the market is open. Between 4:00pm - 4:15 EST, market orders are rejected. After 4:15pm EST, market orders are accepted for next market open.","excerpt":"Add a new market order.","slug":"add-market-order","type":"post","title":"Create Order (Market Order)"}

postCreate Order (Market Order)

Add a new market 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
string1
Type of order: `"1"` - Market order.
side:
required
stringB
Side of order: `"B"` - Buy or `"S"` - Sell.
orderQty:
required
double1.0000
Number of shares up to four decimal places.
amountCash:
string20
The dollar amount of shares to purchase.
comment:
stringGenerated by Me
User generated comment.
autoStop:
integer20
Auto-generated stop order placed this percentage below VWAP. The stop order is placed after this market order is executed.<br />**"Auto-Stop" Calculation:** AP - (AP x `autoStop`).

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 - Market Order](doc:get_market). [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Description", "0-0": "`orderID`", "1-0": "`instrumentID`", "2-0": "`leavesQty`", "3-0": "`ordType`", "4-0": "`side`", "5-0": "`ordStatus`", "6-0": "`expireTimestamp`", "0-1": "Order ID that will be used to query it's status via [Get - Market Order](doc:get_market).", "1-1": "Instrument ID.", "2-1": "Quantity still needing to be executed. will always be the requested order quantity in response.", "3-1": "Type of order: `\"1\"` - market order.", "4-1": "Order side: either `\"B\"` - Buy or `\"S\"` - Sell.", "5-1": "Order status. will always be `\"0\"` to response.", "6-1": "ISO time stamp of when the order will expire.", "7-0": "`statusPath`", "7-1": "Path to check status of order" }, "cols": 2, "rows": 8 } [/block] [block:api-header] { "type": "basic", "title": "Market Order Notes" } [/block] #### Buy Market Order Notes If a user wants to buy an instrument, the following rules apply: 1. Use the Ask when calculating or displaying market rate. 2. Must have sufficient cash to cover the amount requested plus commission.  - Commission rate attached to a user's account and is available when the user logs in via [Create Session](doc:create-session). 3. Practice buy market orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays). 4. For live market, buy market orders are only executed when the market is open. Between 4:00pm - 4:15 EST, market orders are rejected. After 4:15pm EST, market orders are accepted for next market open. #### Sell Market Order Notes If a user wants to sell an instrument , the following rules apply: 1. Use the Bid when calculating or display market rate. 2. User must own the shares before selling. Short selling is currently not permitted. 3. Practice sell market orders are accepted 24/7 except between 4:00 - 4:15pm EST on [trading days](https://www.nyse.com/markets/hours-calendars#holidays). 4. For live market, sell market orders are only executed when the market is open. Between 4:00pm - 4:15 EST, market orders are rejected. After 4:15pm EST, market orders are accepted for next market open.

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