---
title: "New Order Preview"
method: POST
path: "/iserver/account/{accountId}/orders/whatif"
tags: ["tradingOrders"]
---

# New Order Preview

`POST /iserver/account/{accountId}/orders/whatif`

Preview the projected effects of an order ticket or bracket of orders, including cost and changes to margin and account equity.

## Path parameters

- `accountId` string, required

## Request body

- OrdersSubmissionRequest
  - `orders` SingleOrderSubmissionRequest[] — Array of order tickets objects. Only one order ticket object may be submitted per request, unless constructing a bracket.
    - `acctId` string — Receiving account of the order ticket.
    - `conid` integer, required — IB contract ID of the instrument.
    - `conidex` string — Contract ID and routing destination together in format 123456@EXCHANGE.
    - `secType` string — IB asset class identifier.
    - `cOID` string — Client-configurable order identifier. The value must be unique for a 24 hour span. The value can be no longer than 64 characters. Should not be set for the child of a bracket order.
    - `parentId` string — If the order ticket is a child order in a bracket, the parentId field must be set equal to the cOID provided for the parent order.
    - `listingExchange` string — The listing exchange of the instrument.
    - `isSingleGroup` boolean — Indicates that all orders in the containing array are to be treated as an OCA group.
    - `outsideRTH` boolean — Instructs IB to permit the order to execute outside of regular trading hours.
    - `allOrNone` boolean — Instructs IB to execute the order entirely or not execute at all.
    - `auxPrice` number, double — Additional price value used in certain order types, such as stop orders.
    - `ticker` string — Ticker symbol of the instrument.
    - `trailingAmt` number, double — Offset used with Trailing orders.
    - `trailingType` 'amt' | '%' — Specifies the type of trailing used with a Trailing order.
    - `referrer` string — IB internal identifier for order entry UI element.
    - `cashQty` number, double — Quantity of currency used with cash quantity orders.
    - `useAdaptive` boolean — Instructs IB to apply the Price Management Algo.
    - `isCcyConv` boolean — Indicates that a forex order is for currency conversion and should not entail a virtual forex position in the account, where applicable.
    - `orderType` string, required — IB order type identifier.
    - `price` number, double — Price of the order ticket, where applicable.
    - `side` 'BUY' | 'SELL', required — Side of the order ticket.
    - `tif` 'DAY' | 'IOC' | 'GTC' | 'OPG' | 'PAX', required — Time in force of the order ticket.
    - `quantity` number, double, required — Quantity of the order ticket in units of the instrument.
    - `strategy` string — The name of an execution algorithm.
    - `strategyParameters` SingleOrderSubmissionRequestStrategyParameters — Parameters governing the selected algorithm, if applicable.
      - `PLACEHOLDER` string — Placeholder -- these vary by algo (and not always type string, sometimes bool)
    - `extOperator` string — ExtOperator is used to identify external operator
    - `manualIndicator` boolean — For all orders for US Futures products, clients must submit this flag to indicate whether the order was originated manually (by a natural person) or automatically (by an automated trading system transmitting orders without human intervention). Submit a True value to indicate a manually originated order, and submit a False value to indicate an automated order. Orders for USFUT products that do not include this field will be rejected.
    - `taxOptimizerId` string — Identifies set of tax lots selected, for gains and losses management.
    - `jsonPayload` SingleOrderSubmissionRequestJsonPayload
      - `allocation_profile` SingleOrderSubmissionRequestJsonPayloadAllocationProfile — The assigned contents for how the order should be allocated amongst subaccount(s).
        - `alloc_type` 'SHARE' | 'CASH' — The allocation type to define how shares should be distributed. A warning message to be pre-approved. * `SHARE` - Designate the allocation amounts as a quantity of shares. * `CASH` - Designate the allocation amounts as a quantity of a cash quantity to allocate.
        - `allocations` SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocationsItems[] — List of accounts to allocate a trade and the affiliated quantity.
          - `account` string — Account to allocate trades to.
          - `amount` number, double — Allocation to the given account based on the alloc_type.

## Response `200`

Order Preview

- OrderPreview — Projected costs and changes to margin and equity values in the account, if the order ticket were executed in full.
  - `amount` OrderPreviewAmount — Describes the projected costs associated with the order ticket.
    - `amount` string — Projected cost of the order, current reference price times total quantity.
    - `commission` string — Projected commissions and fees associated with the order.
    - `total` string — Sum of projected cost and commission values for the order.
  - `equity` OrderPreviewEquity — Describes the projected change to the account's equity.
    - `current` string — Current equity.
    - `change` string — Difference between current and projected equity values.
    - `after` string — Projected equity after execution of the order.
  - `initial` OrderPreviewInitial — Describes the projected change to initial margin.
    - `current` string — Current initial margin.
    - `change` string — Difference between current and projected initial margin values.
    - `after` string — Projected initial margin after execution of the order.
  - `maintenance` OrderPreviewMaintenance — Describes the projected change to maintenance margin.
    - `current` string — Current maintenance margin.
    - `change` string — Difference between current and projected maintenance margin values.
    - `after` string — Projected maintenance margin after execution of the order.
  - `position` OrderPreviewPosition — Describes the projected change to the account's position in the instrument.
    - `current` string — Current position in the instrument.
    - `change` string — Difference between current and projected position sizes.
    - `after` string — Projected position size after execution of the order.
  - `warn` string — Human-readable text of warning message, if applicable. Otherwise null.
  - `error` string, nullable — Human-readable text of an error message, if applicable. Otherwise null.

## Other responses

- `400` — Missing, empty, non-numeric, or out-of-range parameter. The `error` field is always prefixed with `Bad Request:`.
- `401` — Missing, invalid, or unparseable Authorization token.
- `500` — internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests. For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
- `503` — service is unavailable. For example if request takes more than 10s due to some internal service unavailability, request aborted and this status returned

---

[API](https://skmtc.net/interactivebrokers/apis/api-reference.md) · [All operations](https://skmtc.net/interactivebrokers/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/interactivebrokers/api-reference/revisions/67f9f562c2c6/schema)
