{"_id":"58dd181f8b9e10250039f301","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"},"parentDoc":null,"project":"563cc7119799fb0d00047685","category":{"_id":"563cc7129799fb0d00047689","project":"563cc7119799fb0d00047685","version":"563cc7119799fb0d00047688","pages":["563cc7139799fb0d0004768b","5693f483d8c04d1700e5ad74","56940c301005590d0062ca56","56b8b4ee43bbd10d0081d162"],"__v":4,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-11-06T15:28:18.256Z","from_sync":false,"order":0,"slug":"documentation","title":"Overview"},"__v":0,"user":"569574eccaa32519009c4202","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-03-30T14:37:19.364Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":true,"order":4,"body":"[block:api-header]\n{\n  \"title\": \"On-boarding of a Self-Directed Account\"\n}\n[/block]\nIn order to add a user to the system, you must first create a username and a password.\n\nBefore creating the username, you will have to check to see if the username is available.  You can use the “GET - [Check Username Availability](doc:check-username-availability)” API.\n\nIf the username is available, you will then use the “POST – [Create User](doc:create-user)” API to establish a username and password.  It is extremely important that you submit your six character referral code as part of this post.\n\nAfter you have created the username, you will now create the live account by using the “POST – [Create Live Account](doc:create-live-account)” API.  \n\nNOTE:  Citizens from certain countries are not eligible to open an account with DriveWealth.  You must reference the \"GET - [List All Countries](doc:list-all-countries)\" API to retrieve the active countries list for use in the application process.  This API should be called dynamically each time your native application is used to ensure you have the most up-to-date active country list.\n\nOnce you have created the live account, you will need to upload a user’s National ID card, Driver License, etc. to validate who they are and what their address.  You can do this by using the  “POST – [Add Document](doc:add-document)” API.\n\nYou can check the status of the documentation and the approval process by using the “GET – [User Status](doc:user-status)” API.\n[block:api-header]\n{\n  \"title\": \"Trading in a Self-Directed Account\"\n}\n[/block]\nRequest [Account Blotter](doc:account-blotter) API to see client cash positions, including Cash Available for Trading (Buying Power), open equity positions with real-time P&L, status of open orders (limit, stop, and pre-market market orders) and transactions for the trading day.  This API serves multiple purposes:\n\n  *   It will allow you to build a real-time portfolio view of client holdings\n  *   Build an open order blotter\n  *   Check Buying Power for funds available to trade with\n  *   Build a historical trade view.  \n\nWhen submitting orders, you will first want to do a local risk check to verify if the client has enough buying power to proceed with a trade.  You should provide an error message if the client’s notional value of the order exceeds their buying power and prevent submission of the order (the order gateway will do an additional check anyway, but we prefer if the first check is done by the submitting app).\n\nTo submit an order you will use the Create Order API [Create Order (Market Order)](doc:add-market-order) | [Create Order (Limit Order)](doc:add-limit-order) | [Create Order (Stop Order)](doc:add-stop-order).  You may post more than one order (shopping cart orders) at a time by adding the same code for each additional instrument to the array.\n\nOnce you submit the order, you can check the status of the order by either using the status link URL returned from the POST [Order Status (Market Order)](doc:get_market) | [Order Status (Limit Order)](doc:get-limit-order) | [Order Status (Stop Order)](doc:get_stop), or by again using the [Account Blotter](doc:account-blotter) API.\n\nThe Account Blotter will show the updated position or status of the order.","excerpt":"API workflows for common procedures","slug":"useful-workflows","type":"basic","title":"Useful Workflows"}

Useful Workflows

API workflows for common procedures

[block:api-header] { "title": "On-boarding of a Self-Directed Account" } [/block] In order to add a user to the system, you must first create a username and a password. Before creating the username, you will have to check to see if the username is available. You can use the “GET - [Check Username Availability](doc:check-username-availability)” API. If the username is available, you will then use the “POST – [Create User](doc:create-user)” API to establish a username and password. It is extremely important that you submit your six character referral code as part of this post. After you have created the username, you will now create the live account by using the “POST – [Create Live Account](doc:create-live-account)” API. NOTE: Citizens from certain countries are not eligible to open an account with DriveWealth. You must reference the "GET - [List All Countries](doc:list-all-countries)" API to retrieve the active countries list for use in the application process. This API should be called dynamically each time your native application is used to ensure you have the most up-to-date active country list. Once you have created the live account, you will need to upload a user’s National ID card, Driver License, etc. to validate who they are and what their address. You can do this by using the “POST – [Add Document](doc:add-document)” API. You can check the status of the documentation and the approval process by using the “GET – [User Status](doc:user-status)” API. [block:api-header] { "title": "Trading in a Self-Directed Account" } [/block] Request [Account Blotter](doc:account-blotter) API to see client cash positions, including Cash Available for Trading (Buying Power), open equity positions with real-time P&L, status of open orders (limit, stop, and pre-market market orders) and transactions for the trading day. This API serves multiple purposes: * It will allow you to build a real-time portfolio view of client holdings * Build an open order blotter * Check Buying Power for funds available to trade with * Build a historical trade view. When submitting orders, you will first want to do a local risk check to verify if the client has enough buying power to proceed with a trade. You should provide an error message if the client’s notional value of the order exceeds their buying power and prevent submission of the order (the order gateway will do an additional check anyway, but we prefer if the first check is done by the submitting app). To submit an order you will use the Create Order API [Create Order (Market Order)](doc:add-market-order) | [Create Order (Limit Order)](doc:add-limit-order) | [Create Order (Stop Order)](doc:add-stop-order). You may post more than one order (shopping cart orders) at a time by adding the same code for each additional instrument to the array. Once you submit the order, you can check the status of the order by either using the status link URL returned from the POST [Order Status (Market Order)](doc:get_market) | [Order Status (Limit Order)](doc:get-limit-order) | [Order Status (Stop Order)](doc:get_stop), or by again using the [Account Blotter](doc:account-blotter) API. The Account Blotter will show the updated position or status of the order.