New Customer Offer: Pay 0% interest for up to six months on $5K USD when you join Questrade with code 0MARGIN. Open a new margin account.

Documentation

The Questrade API allows developers to create their own fully featured trading and analytical applications through their brokerage account.

POST accounts/:id/orders/bracket

Allows to (re)place or estimate impact of a bracket order against a certain account. The responses are the same for all bracket order insert and replace calls as the responses for old order calls (including impact). OrderGroupID and orderClass will be filled out for bracket orders in response.

Request

NameidTypeStringDescriptionAccount number against which order is being submitted. Can occur in the 'Location' header only.
NamesymbolIdTypeIntegerDescriptionInternal symbol identifier.
NameprimaryRouteTypeEnumerationDescriptionPrimary order route (e.g., "AUTO").
NamesecondaryRouteTypeEnumerationDescriptionSecondary order route (e.g., "NYSE").
NamecomponentsTypeComplexDescriptionList of bracket order components

Data for each component of a bracket order.

NameorderIdTypeIntegerDescriptionOrder ID of active order, or 0 for new order
NamequantityTypeDoubleDescriptionOrder quantity
NameactionTypeEnumerationDescriptionOrder (e.g., "Buy "), required only on initial insertion See Order Action section for all allowed values.
NamelimitPriceTypeDoubleDescriptionLimit price
NamestopPriceTypeDoubleDescriptionStop price
NameorderTypeTypeEnumerationDescriptionOrder type (e.g., "Market "). See Order Type section for all allowed values.
NametimeInForceTypeEnumerationDescriptionOrder duration (e.g., "DAY "). See Order Duration section for all allowed values.
NameorderClassTypeEnumerationDescriptionFor bracket order describes the type of component See Order Class section for all allowed values

New Bracket

Primary and only one of the exit orders are required.

Sample request

HTTP
POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/bracket

POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/bracket/impact

{
     "symbolId": 27426,
     "primaryRoute": "AUTO",
     "secondaryRoute": "AUTO",
     "components": [
          {
               "limitPrice": 2,
               "stopPrice":  3,
               "orderType": "StopLimit",
               "timeInForce": "Day",
               "orderClass": "Primary",
               "quantity": 100,
               "action": "Buy"
          },
          {
               "limitPrice": 1000,
               "orderType":  "Limit",
               "timeInForce":  "Day",
               "orderClass": "Limit",
               "quantity": 100,
               "action": "Sell"
          },
          {
               "limitPrice": 0.9,
               "stopPrice": 1,
               "orderType": "StopLimit",
               "timeInForce": "Day",
               "orderClass":  "StopLoss",
               "quantity":  100,
               "action": "Sell"
          }
     ]
}

New bracket on existing order

Primary orderId and one of the exit orders are required.

Sample request

HTTP
{
POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/bracket

POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/bracket/impact

{
     "symbolId":27426 ,
     "primaryRoute": "AUTO",
     "secondaryRoute": "AUTO",
     "components": [
        {
             "orderId": 123456789,
             "orderClass": "Primary"
        },
        {
             "limitPrice": 1000,
             "orderType": "Limit",
             "timeInForce": "Day",
             "orderClass": "Limit",
             "quantity": 100,
             "action": "Sell"
        },
        {
             "limitPrice": 0.9,
             "stopPrice": 1,
             "orderType": "StopLimit",
             "timeInForce": "Day",
             "orderClass":"StopLoss",
             "quantity": 100,
             "action": "Sell"
        }
    ]
}

New bracket on position

Both exit orders are required otherwise just place a single order.

Sample request

HTTP
{
POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/bracket

POST https://api01.iq.questrade.com/v1/accounts/90000004/orders/bracket/impact

{
     "symbolId": 27426,
     "primaryRoute": "AUTO",
     "secondaryRoute":"AUTO",
     "components": [
        {
             "limitPrice": 1000,
             "orderType": "Limit",
             "timeInForce": "Day",
             "orderClass": "Limit",
             "quantity": 100,
             "action": "Sell"
        },
        {
             "limitPrice": 0.9,
             "stopPrice": 1,
             "orderType":  "StopLimit",
             "timeInForce":  "Day",
             "orderClass":  "StopLoss",
             "quantity": 100,
             "action": "Sell"
        }
    ]
}

Already a Questrade client?

Create your first application using your Questrade account.

Integrate your application with Questrade API

Support

Report an issue

Have questions about Questrade's API? Tell us how we can help, send us an email.

Request a feature

We want your ideas on how we can improve our API. If you have a suggestion for a minor tweak, a major overhaul, or something brand new, please share it with us.

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.

See All