> 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.

# Check equity order impact

POST https://api.snaptrade.com/trade/impact

Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.

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

## 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.getOrderImpact({
    userId: "snaptrade-user-123",
    userSecret:
      "adf2aa34-8219-40f7-a6b3-60156985cc61",
    account_id:
      "917c8734-8470-4a3e-a18f-57c3f2ee6631",
    action: "ACTION",
    universal_symbol_id:
      "2bcd7cc3-e922-4976-bce1-9858296801c3",
    order_type: "Market",
    time_in_force: "Day",
    price: 31.33,
    stop: 31.33,
  });
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_order_impact(
    user_id="snaptrade-user-123",
    user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61",
    account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631",
    action="ACTION",
    universal_symbol_id="2bcd7cc3-e922-4976-bce1-9858296801c3",
    order_type="Market",
    time_in_force="Day",
    price=31.33,
    stop=31.33
)
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:
  /trade/impact:
    post:
      tags:
        - Trading
      summary: Check equity order impact
      description: >-
        Simulates an order and its impact on the account. This endpoint does not
        place the order with the brokerage. If successful, it returns a `Trade`
        object and the ID of the object can be used to place the order with the
        brokerage using the [place checked order
        endpoint](/reference/Trading/Trading_placeOrder). Please note that the
        `Trade` object returned expires after 5 minutes. Any order placed using
        an expired `Trade` will be rejected.
      operationId: Trading_getOrderImpact
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              description: Inputs for placing an order with the brokerage.
              type: object
              required:
                - account_id
                - action
                - order_type
                - time_in_force
                - universal_symbol_id
              properties:
                account_id:
                  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
                action:
                  description: >-
                    The action describes the intent or side of a trade. This is
                    either `BUY` or `SELL`.
                  type: string
                  enum:
                    - BUY
                    - SELL
                universal_symbol_id:
                  description: >-
                    Unique identifier for the symbol within SnapTrade. This is
                    the ID used to reference the symbol in SnapTrade API calls.
                  type: string
                  format: uuid
                  example: 2bcd7cc3-e922-4976-bce1-9858296801c3
                order_type:
                  description: >
                    The type of order to place.


                    - For `Limit` and `StopLimit` orders, the `price` field is
                    required.

                    - For `Stop` and `StopLimit` orders, the `stop` field is
                    required.
                  example: Market
                  type: string
                  enum:
                    - Limit
                    - Market
                    - StopLimit
                    - Stop
                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
                price:
                  description: The limit price for `Limit` and `StopLimit` orders.
                  type: number
                  example: 31.33
                  nullable: true
                stop:
                  description: >-
                    The price at which a stop order is triggered for `Stop` and
                    `StopLimit` orders.
                  type: number
                  example: 31.33
                  nullable: true
                units:
                  nullable: true
                  allOf:
                    - description: >-
                        Number of shares for the order. This can be a decimal
                        for fractional orders. Must be `null` if
                        `notional_value` is provided.
                      type: number
                      example: 10.5
                notional_value:
                  nullable: true
                  allOf:
                    - description: >-
                        Total notional amount for the order. Must be `null` if
                        `units` is provided. Can only work with `Market` for
                        `order_type` and `Day` for `time_in_force`. This is only
                        available for certain brokerages. Please check the
                        [integrations
                        doc](https://support.snaptrade.com/brokerages-table?v=e7bbcbf9f272441593f93decde660687)
                        for more information.
                      oneOf:
                        - type: string
                        - type: number
                      example: 100
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  trade:
                    description: Contains the details of a submitted order.
                    type: object
                    properties:
                      id:
                        description: >-
                          Unique identifier for the submitted order through
                          SnapTrade.
                        type: string
                        format: uuid
                        example: 139e307a-82f7-4402-b39e-4da7baa87758
                      account:
                        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
                      order_type:
                        description: >
                          The type of order to place.


                          - For `Limit` and `StopLimit` orders, the `price`
                          field is required.

                          - For `Stop` and `StopLimit` orders, the `stop` field
                          is required.
                        example: Market
                        type: string
                        enum:
                          - Limit
                          - Market
                          - StopLimit
                          - Stop
                      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
                      symbol:
                        description: Information about the security for the order.
                        type: object
                        properties:
                          universal_symbol_id:
                            description: >-
                              Unique identifier for the symbol within SnapTrade.
                              This is the ID used to reference the symbol in
                              SnapTrade API calls.
                            type: string
                            format: uuid
                            example: 2bcd7cc3-e922-4976-bce1-9858296801c3
                          currency:
                            description: Describes a currency object.
                            type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                description: >-
                                  Unique identifier for the currency. This is
                                  the UUID used to reference the currency in
                                  SnapTrade.
                                example: 87b24961-b51e-4db8-9226-f198f6518a89
                              code:
                                type: string
                                description: The ISO-4217 currency code for the currency.
                                example: USD
                              name:
                                type: string
                                description: A human-friendly name of the currency.
                                example: US Dollar
                          local_id:
                            deprecated: true
                            description: This field is deprecated and should not be used.
                            type: string
                            example: '1048101'
                          description:
                            deprecated: true
                            description: This field is deprecated and should not be used.
                            type: string
                            example: Metaverse Global ETF
                            nullable: true
                          symbol:
                            deprecated: true
                            description: This field is deprecated and should not be used.
                            type: string
                            example: MVGP.U.TO
                          brokerage_symbol_id:
                            deprecated: true
                            description: >-
                              A unique ID for the security within SnapTrade,
                              scoped to the brokerage account that the security
                              belongs to. This is a legacy field and should not
                              be used. Do not rely on this being a stable ID as
                              it can change.
                            type: string
                            format: uuid
                            example: 2bcd7cc3-e922-4976-bce1-9858296801c3
                      action:
                        description: >-
                          The action describes the intent or side of a trade.
                          This is either `BUY` or `SELL`.
                        type: string
                        enum:
                          - BUY
                          - SELL
                      units:
                        nullable: true
                        allOf:
                          - description: >-
                              Number of shares for the order. This can be a
                              decimal for fractional orders. Must be `null` if
                              `notional_value` is provided.
                            type: number
                            example: 10.5
                      price:
                        description: Trade Price if limit or stop limit order
                        type: number
                        nullable: true
                        example: 31.33
                  trade_impacts:
                    description: >-
                      List of impacts of the trade on the account. The list
                      always contains one value at the moment.
                    type: array
                    items:
                      type: object
                      properties:
                        account:
                          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
                        currency:
                          type: string
                          format: uuid
                          description: >-
                            Unique identifier for the currency. This is the UUID
                            used to reference the currency in SnapTrade.
                          example: 87b24961-b51e-4db8-9226-f198f6518a89
                        remaining_cash:
                          description: >-
                            Estimated amount of cash remaining in the account
                            after the trade.
                          type: number
                          example: 1.11
                          nullable: true
                        estimated_commission:
                          description: Estimated commission for the trade.
                          type: number
                          example: 3.26
                          nullable: true
                        forex_fees:
                          description: Estimated foreign transaction fees for the trade.
                          type: number
                          example: 5.26
                          nullable: true
                  combined_remaining_balance:
                    description: >-
                      Estimated remaining balance of the account after the trade
                      is executed.
                    type: object
                    properties:
                      account:
                        description: A single account at a brokerage.
                        type: object
                        properties:
                          id:
                            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
                          name:
                            type: string
                            description: >-
                              A display name for the account. Either assigned by
                              the user or by the brokerage itself. For certain
                              brokerages, SnapTrade appends the brokerage name
                              to the account name for clarity.
                            example: Robinhood Individual
                          number:
                            type: string
                            example: Q6542138443
                            description: >-
                              The account number assigned by the brokerage. For
                              some brokerages, this field may be masked for
                              security reasons.
                          institution_account_id:
                            type: string
                            example: '54953432'
                            nullable: true
                            description: >-
                              A stable and unique account identifier provided by
                              the institution. Will be set to null if not
                              provided. When present, can be used to check if a
                              user has connected the same brokerage account
                              across multiple connections.
                          sync_status:
                            description: >-
                              Contains status update for the account sync
                              process between SnapTrade and the brokerage.
                            properties:
                              transactions:
                                description: >
                                  Status of account transaction sync. SnapTrade
                                  syncs transactions from the brokerage under
                                  the following conditions:

                                  1. Initial connection - SnapTrade syncs all
                                  transactions from the brokerage account as far
                                  back as the brokerage allows. Check [our
                                  integrations
                                  doc](https://support.snaptrade.com/brokerages-table?v=6fab8012ade6441fa0c6d9af9c55ce3a)
                                  for details on how far back we sync for each
                                  brokerage.

                                  2. Daily sync - Once a day SnapTrade syncs new
                                  transactions from the brokerage.

                                  3. Manual sync - You can trigger an
                                  incremental sync of transactions with the
                                  [transactions
                                  sync](/reference/Experimental%20endpoints/Connections_syncBrokerageAuthorizationTransactions)
                                  endpoint.
                                properties:
                                  initial_sync_completed:
                                    description: >-
                                      Indicates if the initial sync of
                                      transactions has been completed. For
                                      accounts with a large number of
                                      transactions, the initial sync may take a
                                      while to complete.
                                    type: boolean
                                    example: true
                                  last_successful_sync:
                                    description: >-
                                      All transactions up to this date have been
                                      successfully synced. Please note that this
                                      is not the date of the last transaction,
                                      nor the last time SnapTrade attempted to
                                      sync transactions.
                                    nullable: true
                                    allOf:
                                      - description: Date in YYYY-MM-DD format or null
                                        type: string
                                        example: '2022-01-24'
                                        format: date
                                        nullable: true
                                  first_transaction_date:
                                    description: >-
                                      The date of the first transaction in the
                                      account known to SnapTrade. It's possible
                                      that the account has transactions before
                                      this date, but they are not known to
                                      SnapTrade.
                                    nullable: true
                                    allOf:
                                      - description: Date in YYYY-MM-DD format or null
                                        type: string
                                        example: '2022-01-24'
                                        format: date
                                        nullable: true
                              holdings:
                                description: >
                                  Status of account holdings sync. SnapTrade
                                  syncs holdings from the brokerage under the
                                  following conditions:

                                  1. Initial connection - SnapTrade syncs all
                                  holdings (positions, balances, recent orders,
                                  and transactions) immediately after the
                                  connection is established.

                                  2. Daily sync - Once a day SnapTrade refreshes
                                  all holdings from the brokerage.

                                  3. Manual sync - You can trigger a refresh of
                                  holdings with the [manual
                                  refresh](/reference/Connections/Connections_refreshBrokerageAuthorization)
                                  endpoint.
                                properties:
                                  initial_sync_completed:
                                    description: >-
                                      Indicates if the initial sync of holdings
                                      has been completed. For accounts with a
                                      large number of
                                      positions/orders/transactions, the initial
                                      sync may take a while to complete.
                                    type: boolean
                                    example: true
                                  last_successful_sync:
                                    description: >-
                                      The last time holdings were successfully
                                      synced by SnapTrade.
                                    nullable: true
                                    allOf:
                                      - description: >-
                                          Date in ISO 8601 format or null
                                          (YYYY-MM-DD HH:MM:SS.mmmmmmTZ)
                                        type: string
                                        example: '2024-06-28 18:42:46.561408+00:00'
                                        format: date-time
                                        nullable: true
                      currency:
                        description: Describes a currency object.
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            description: >-
                              Unique identifier for the currency. This is the
                              UUID used to reference the currency in SnapTrade.
                            example: 87b24961-b51e-4db8-9226-f198f6518a89
                          code:
                            type: string
                            description: The ISO-4217 currency code for the currency.
                            example: USD
                          name:
                            type: string
                            description: A human-friendly name of the currency.
                            example: US Dollar
                      cash:
                        description: >-
                          Estimated amount of cash remaining in the account
                          after the trade. At the moment this is the same as
                          `remaining_cash` under `trade_impacts`.
                        type: number
                        example: 1.11
                        nullable: true
        '400':
          description: Bad 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
        '500':
          description: Unexpected Error

```