> For AI agents: the complete documentation index is available at [llms.txt](https://docs.snaptrade.com/llms.txt). Markdown versions of documentation pages are available by appending .md to the URL path.

# Get option order impact

POST https://api.snaptrade.com/accounts/{accountId}/trading/options/impact

Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it.
Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for more information on which brokerages support this endpoint.


Reference: https://docs.snaptrade.com/reference/Trading/Trading_getOptionImpact

## Code Examples

### TypeScript

```typescript

import { Snaptrade } from "snaptrade-typescript-sdk";

const snaptrade = new Snaptrade({
  clientId: "PARTNER_CLIENT_ID",
  consumerKey: "CONSUMER_KEY",
});

const response =
  await snaptrade.trading.getOptionImpact({
    accountId:
      "917c8734-8470-4a3e-a18f-57c3f2ee6631",
    userId: "snaptrade-user-123",
    userSecret:
      "adf2aa34-8219-40f7-a6b3-60156985cc61",
    order_type: "MARKET",
    time_in_force: "Day",
    price_effect: "DEBIT",
    legs: [
      {
        instrument: {
          symbol: "PBI   250718C00006000",
          instrument_type: "INSTRUMENT_TYPE",
        },
        action: "BUY_TO_OPEN",
        units: 1,
      },
    ],
  });
console.log(response.data);

```

### Python

```python

from pprint import pprint
from snaptrade_client import SnapTrade

snaptrade = SnapTrade(
    client_id="PARTNER_CLIENT_ID",
    consumer_key="CONSUMER_KEY"
)

response = snaptrade.trading.get_option_impact(
    account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631",
    user_id="snaptrade-user-123",
    user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61",
    order_type="MARKET",
    time_in_force="Day",
    price_effect="DEBIT",
    legs=[
        {
            "instrument": {
                "symbol": "PBI   250718C00006000",
                "instrument_type": "INSTRUMENT_TYPE"
            },
            "action": "BUY_TO_OPEN",
            "units": 1
        }
    ]
)
pprint(response.body)

```

## OpenAPI Specification

```yaml

openapi: 3.0.0
info:
  description: Connect brokerage accounts to your app for live positions and trading
  version: 1.0.0
  title: SnapTrade
  termsOfService: N/A
  contact:
    email: api@snaptrade.com
  x-konfig-ignore:
    potential-incorrect-type: true
  x-readme:
    explorer-enabled: false
paths:
  /accounts/{accountId}/trading/options/impact:
    post:
      tags:
        - Trading
      summary: Get option order impact
      description: >
        Simulates an option order with up to 4 legs and returns the estimated
        cost and transaction fees without placing it.

        Only supported for certain enabled brokerages. Please refer to the
        [brokerage trading support
        page](https://support.snaptrade.com/brokerages) for more information on
        which brokerages support this endpoint.
      operationId: Trading_getOptionImpact
      parameters:
        - in: query
          required: true
          name: userId
          schema:
            description: >-
              SnapTrade User ID. This is chosen by the API partner and can be
              any string that is a) unique to the user, and b) immutable for the
              user. It is recommended to NOT use email addresses for this
              property because they are usually not immutable.
            type: string
            example: snaptrade-user-123
        - in: query
          required: true
          name: userSecret
          schema:
            description: >-
              SnapTrade User Secret. This is a randomly generated string and
              should be stored securely. If compromised, please rotate it via
              the [rotate user secret
              endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
            type: string
            example: adf2aa34-8219-40f7-a6b3-60156985cc61
        - in: path
          required: true
          name: accountId
          schema:
            description: >-
              Unique identifier for the connected brokerage account. This is the
              UUID used to reference the account in SnapTrade.
            type: string
            format: uuid
            example: 917c8734-8470-4a3e-a18f-57c3f2ee6631
      requestBody:
        required: true
        content:
          application/json:
            schema:
              description: Inputs for placing a multi-leg order with the brokerage.
              type: object
              required:
                - order_type
                - time_in_force
                - legs
              properties:
                order_type:
                  example: MARKET
                  type: string
                  enum:
                    - MARKET
                    - LIMIT
                    - STOP_LOSS_MARKET
                    - STOP_LOSS_LIMIT
                  description: The type of order to place.
                time_in_force:
                  description: >
                    The Time in Force type for the order. This field indicates
                    how long the order will remain active before it is executed
                    or expires. Here are the supported values:
                      - `Day` - Day. The order is valid only for the trading day on which it is placed.
                      - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled.
                      - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
                      - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled.
                  type: string
                  enum:
                    - FOK
                    - Day
                    - GTC
                    - IOC
                  example: Day
                limit_price:
                  description: >-
                    The limit price. Required if the order type is `LIMIT`,
                    `STOP_LOSS_LIMIT`.
                  type: string
                  format: decimal
                  example: ''
                  nullable: true
                stop_price:
                  description: >-
                    The stop price. Required if the order type is
                    `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`.
                  type: string
                  format: decimal
                  example: ''
                  nullable: true
                price_effect:
                  nullable: true
                  example: DEBIT
                  allOf:
                    - type: string
                      description: >-
                        The desired price_effect for `LIMIT` and
                        `STOP_LOSS_LIMIT` orders. Values are `CREDIT`, `DEBIT`,
                        `EVEN`
                      enum:
                        - CREDIT
                        - DEBIT
                        - EVEN
                      example: DEBIT
                legs:
                  type: array
                  items:
                    type: object
                    required:
                      - instrument
                      - action
                      - units
                    properties:
                      instrument:
                        type: object
                        required:
                          - symbol
                          - instrument_type
                        properties:
                          symbol:
                            description: >-
                              The security's trading ticker symbol. This
                              currently supports stock symbols and Options
                              symbols in the 21 character OCC format. For
                              example `AAPL  251114C00240000` represents a call
                              option on AAPL expiring on 2025-11-14 with a
                              strike price of $240. For more information on the
                              OCC format, see
                              [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format)
                            type: string
                            example: PBI   250718C00006000
                          instrument_type:
                            description: The instrument's type
                            type: string
                            enum:
                              - OPTION
                              - EQUITY
                      action:
                        description: >-
                          The action describes the intent and side of a trade.
                          For equities, this is either `BUY` or `SELL`. For
                          options, this is one of `BUY_TO_OPEN`, `BUY_TO_CLOSE`,
                          `SELL_TO_OPEN`, `SELL_TO_CLOSE`.
                        type: string
                        enum:
                          - BUY
                          - SELL
                          - BUY_TO_OPEN
                          - BUY_TO_CLOSE
                          - SELL_TO_OPEN
                          - SELL_TO_CLOSE
                        example: BUY_TO_OPEN
                      units:
                        description: >-
                          The quantity to trade. For options this represents the
                          number of contracts. For equity this represents the
                          number of shares.
                        type: integer
                        example: 1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: >-
                  Estimated cash change and fees for an option order before it
                  is placed.
                type: object
                properties:
                  estimated_cash_change:
                    description: Estimated cash change for the order, before fees.
                    type: string
                    example: '1.97'
                  cash_change_direction:
                    description: >-
                      Direction of the cash change. CREDIT means cash is
                      received, DEBIT means cash is paid out, EVEN means no cash
                      changes hands. UNKNOWN if the direction cannot be
                      determined from the request.
                    type: string
                    nullable: true
                    enum:
                      - CREDIT
                      - DEBIT
                      - EVEN
                      - UNKNOWN
                  estimated_fee_total:
                    description: >-
                      Estimated total transaction fees and commissions for the
                      order.
                    type: string
                    example: '0.50'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: Unable to verify data sent
                  default_code:
                    example: 1076
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: User does not have permission to access this resource
                  default_code:
                    example: 1066
        '501':
          description: Not Implemented - option impact is not supported for this brokerage

```