Documentation
The Questrade API allows developers to create their own fully featured trading and analytical applications through their brokerage account.
REST operations
Error handling
Error format
In case of not being able to successfully service a request the API will return an error response.
The API offers two categories of errors:
General Error – errors that do NOT result in creation of an order with an internal identifier.
Order Processing Error – errors that occur during processing of trade calls (e.g., placing, replacing, canceling an order) that result in an order being created in the platform.
General error response
General error message will consist of properties specified in the table below.
| Property | Type | Description |
|---|---|---|
| Propertycode | TypeString | DescriptionError code. |
| Propertymessage | TypeString | DescriptionError description. |
Sample
HTTP/1.1 400 Bad Request
Content-Length: 63
Content-Type: application/json; charset=utf-8
Date: Fri, 18 Aug 2014 22:17:16 GMT
{
"code": 3139 ,
"message": "Invalid route"
}Order processing error response
Whenever a trading call results in the creation of an order with a unique internal identifier, the platform will return an error response with additional properties (orderId and orders) in addition to standard error fields (code and message) in the response.
| Property | Type | Description |
|---|---|---|
| Propertycode | TypeString | DescriptionError code. |
| Propertymessage | TypeString | DescriptionError description. |
| PropertyorderId | TypeInteger | DescriptionInternal unique identifier assigned to the order |
| Propertyorders | TypeComplex | DescriptionList of Order records |
| Property Nested property, level 2. orders | Type Complex | Description See Order record in the above sections of this document |
Sample order error response (no order created)
HTTP/1.1 400 Bad Request
Content-Length: 63
Content-Type: application/json; charset=utf-8
Date: Fri, 18 Aug 2014 22:17:16 GMT
{
"code": 3139,
"message": "Invalid route"
}Sample order error response (order created)
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json; charset=utf-8
Date: Fri, 18 Aug 2014 22:17:16 GMT
{
"code": 3054 ,
"message": "Order was rejected by the exchange" ,
"orderId": 134353223 ,
"orders": [
...
]
}| HTTP status code | HTTP status message | Error code | Error message |
|---|---|---|---|
| HTTP status code404 | HTTP status messageNot Found | Error code1001 | Error messageInvalid endpoint. |
| HTTP status code400 | HTTP status messageBad Request | Error code1002 | Error messageInvalid or malformed argument. |
| HTTP status code400 | HTTP status messageBad Request | Error code1003 | Error messageArgument length exceeds imposed limit. |
| HTTP status code400 | HTTP status messageBad Request | Error code1004 | Error messageMissing required argument. |
| HTTP status code413 | HTTP status messageRequest Entity Too Large | Error code1005 | Error messageRequest length exceeds imposed limit. |
| HTTP status code429 | HTTP status messageToo Many Requests | Error code1006 | Error messageRate limit exceeded. |
| HTTP status code500 | HTTP status messageInternal Server Error | Error code1007 | Error messageIQ servers responded with a business error. |
| HTTP status code500 | HTTP status messageInternal Server Error | Error code1008 | Error messageIQ servers responded with a technical error. |
| HTTP status code500 | HTTP status messageInternal Server Error | Error code1009 | Error messageIQ servers responded with an unexpected error. |
| HTTP status code502 | HTTP status messageBad Gateway | Error code1010 | Error messageIQ servers produced an invalid response. |
| HTTP status code503 | HTTP status messageGateway Timeout | Error code1011 | Error messageIQ servers did not produce a response before a timeout. |
| HTTP status code405 | HTTP status messageMethod Not Allowed | Error code1012 | Error messageMethod unsupported by endpoint (e.g., GET vs. POST). |
| HTTP status code400 | HTTP status messageBad Request | Error code1013 | Error messageRequesting anything other than ‘application/json’. |
| HTTP status code401 | HTTP status messageUnauthorized | Error code1014 | Error messageMissing authorization header. |
| HTTP status code400 | HTTP status messageBad Request | Error code1015 | Error messageMalformed authorization header. |
| HTTP status code403 | HTTP status messageForbidden | Error code1016 | Error messageRequest is out-of-allowed OAuth scopes. |
| HTTP status code401 | HTTP status messageUnauthorized | Error code1017 | Error messageAccess token is invalid. |
| HTTP status code404 | HTTP status messageNot Found | Error code1018 | Error messageAccount number not found. |
| HTTP status code404 | HTTP status messageNot Found | Error code1019 | Error messageSymbol not found. |
| HTTP status code404 | HTTP status messageNot Found | Error code1020 | Error messageOrder not found. |
| HTTP status code500 | HTTP status messageInternal Server Error | Error code1021 | Error messageUnexpected error (with undefined handling). |
Downloads

C ++
| Dec 18, 2015 | Version 1.1.0 |
|---|---|
| Release notes | Download API (opens in a new tab) |

C #/Active X
| Dec 18, 2015 | Version 1.1.0 |
|---|---|
| Release notes | Download API (opens in a new tab) |
Already a Questrade client?
Create your first application using your Questrade account.
Integrate your application with Questrade API
Support
If you are using an api app developed by a third party, you are required to read, understand and accept the end-user license agreement for application program interface. If you are utilizing api access for an api-enabled app you built, you are required to read, understand and accept the Questrade personal application program interface ("api") license agreement ("license agreement"). This agreement can be found below. You may be bound by both agreements.


