New Order Example
The following workflow describes the submission of a new order ticket.
Values needed:
- Contract ID (“conid”) for the desired instrument(s)
- Your desired order handling instructions
A POST request to the /iserver/account/{accountId}/orders endpoint is used to submit a new order ticket to the account referenced by {accountId} in the path. This endpoint takes one required path parameter:
accountId: The account ID of the account to which the order will be placed.
This endpoint also requires a JSON body. The specific keys required to successfully submit a given order ticket will vary depending on a variety of factors, including order type. More information on the construction of order tickets can be found on our Order Types page.
However, at a minimum, any new order ticket submitted via the Web API will require in its body:
conid: The instrument’s conidorderType: The Order Type of the new order ticketside: The side of the order being placed (e.g., “BUY” or “SELL”)tif: Time in force, the duration for which the order will work.quantity: A number of units of the instrument
Please consult our Reference Material for a list of all JSON keys available when submitting new order tickets.
Suppose we have trading permissions for account DU123456. We’d like submit a new order to this account to buy 100 shares of AAPL, with a limit price of USD 165, to work for the remainder of today’s regular trading hours (an unmodified “day” order).
First we must have obtained IB’s conid for AAPL stock, trading in the US in USD, which is 265598. We must also know how to represent our desired handling instructions to the Web API:
- A buy order is
"side":"BUY" - A quantity of 100 shares is
"quantity":100 - A limit order is
"orderType":"LMT" - A limit price of USD 165 is
"price":165 - A day order is
"tif":"DAY" - And finally, AAPL’s conid is
"conid":265598
Note that both the keys and values above are case-sensitive.
Care must also be taken to ensure the correct JSON data types are used, as detailed in our Reference Material. We may then construct the following request:
POST https://api.ibkr.com/v1/api/iserver/account/DU123456/orders
Note also that the body of this POST request requires a JSON array containing the order ticket object. This array is used to submit order brackets, as detailed below. For now, we will submit only a single order ticket by way of a single object element in this array.
If we are successful in submitting our order, we will receive a response that includes an order_id value that can be used to keep track of the status of the order, as well as an indication of its current status at the time of submission:

