tastytrade complex-orders API

Allows an API client to retreive information about complex orders on a per account basis.

Operations 8

GET /accounts/{account_number}/complex-orders #
POST /accounts/{account_number}/complex-orders #
POST /accounts/{account_number}/complex-orders/dry-run #
GET /accounts/{account_number}/complex-orders/live #
GET /accounts/{account_number}/complex-orders/{id} #
PATCH /accounts/{account_number}/complex-orders/{id} #
DELETE /accounts/{account_number}/complex-orders/{id} #
POST /accounts/{account_number}/complex-orders/{id}/dry-run #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tastytrade-complex-orders-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tastytrade-complex-orders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Account Status accounts Complex Orders API
  version: 7.1.0
  description: Operations about accounts
servers:
- url: https://api.tastyworks.com
tags:
- name: complex-orders
  description: Allows an API client to retreive information about complex orders on a per account basis.
paths:
  /accounts/{account_number}/complex-orders:
    get:
      description: Returns a paginated list of all Complex Orders
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      - in: query
        name: page-offset
        required: false
        schema:
          type: integer
          format: int32
          default: 0
      - in: query
        name: per-page
        required: false
        schema:
          type: integer
          format: int32
          default: 10
          maximum: 200
          minimum: 1
      responses:
        '200':
          description: Returns a paginated list of all Complex Orders
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ComplexOrder'
      tags:
      - complex-orders
      operationId: getAccountsAccountNumberComplexOrders
    post:
      description: Creates a new Complex Order from supplied params
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '201':
          description: Creates a new Complex Order from supplied params
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlacedOrderResponse'
      tags:
      - complex-orders
      operationId: postAccountsAccountNumberComplexOrders
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postAccountsAccountNumberComplexOrders'
        required: true
  /accounts/{account_number}/complex-orders/dry-run:
    post:
      description: Performs a dry-run for a new ComplexOrder from supplied params. Allows validation of potential orders.
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '201':
          description: Performs a dry-run for a new ComplexOrder from supplied params. Allows validation of potential orders.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlacedOrderResponse'
      tags:
      - complex-orders
      operationId: postAccountsAccountNumberComplexOrdersDryRun
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postAccountsAccountNumberComplexOrdersDryRun'
        required: true
  /accounts/{account_number}/complex-orders/live:
    get:
      description: Returns all Complex Orders where a compenent order was placed today
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Returns all Complex Orders where a compenent order was placed today
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ComplexOrder'
      tags:
      - complex-orders
      operationId: getAccountsAccountNumberComplexOrdersLive
  /accounts/{account_number}/complex-orders/{id}:
    get:
      description: Returns a full representation of a Complex Order
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: id
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Returns a full representation of a Complex Order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComplexOrder'
      tags:
      - complex-orders
      operationId: getAccountsAccountNumberComplexOrdersId
    patch:
      description: Edit threshold-price of a PAIRS trade.
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: id
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Edit threshold-price of a PAIRS trade.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlacedOrderResponse'
      tags:
      - complex-orders
      operationId: patchAccountsAccountNumberComplexOrdersId
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/patchAccountsAccountNumberComplexOrdersId'
        required: true
    delete:
      description: Request cancellation for all non terminal components of a Complex Order
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: id
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Request cancellation for all non terminal components of a Complex Order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComplexOrder'
      tags:
      - complex-orders
      operationId: deleteAccountsAccountNumberComplexOrdersId
  /accounts/{account_number}/complex-orders/{id}/dry-run:
    post:
      description: Performs a dry-run for editing a ComplexOrder from supplied params.
      parameters:
      - in: path
        name: account_number
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: id
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '201':
          description: Performs a dry-run for editing a ComplexOrder from supplied params.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlacedOrderResponse'
      tags:
      - complex-orders
      operationId: postAccountsAccountNumberComplexOrdersIdDryRun
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postAccountsAccountNumberComplexOrdersIdDryRun'
        required: true
components:
  schemas:
    patchAccountsAccountNumberComplexOrdersId:
      type: object
      properties:
        ratio-price-comparator:
          type: string
          description: "How to compare against the ratio price. \\\n                                                      Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)"
          enum:
          - gte
          - lte
        ratio-price-threshold:
          type: number
          format: double
          description: Ratio price for a PAIRS trade
      description: Edit threshold-price of a PAIRS trade.
    postAccountsAccountNumberComplexOrders:
      type: object
      properties:
        orders:
          type: array
          description: Array of orders for OCO/BLAST orders
          items:
            type: object
            properties:
              gtc-date:
                type: string
                format: date
                description: The date in which a GTD order will expire. Can only be provided if time-in-force is GTD.
              order-type:
                type: string
                description: "The type of order in regards to the price. i.e.\n                                    `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`"
                enum:
                - Limit
                - Market
                - Marketable Limit
                - Notional Market
                - Stop
                - Stop Limit
              stop-trigger:
                type: number
                format: double
                description: The price trigger at which a stop or stop-limit order becomes valid.
              time-in-force:
                type: string
                description: "The length in time before the order expires. i.e.\n                                       `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`"
                enum:
                - Day
                - Ext
                - Ext Overnight
                - GTC
                - GTC Ext
                - GTC Ext Overnight
                - GTD
                - IOC
              price:
                type: number
                format: double
                description: The price of the Order. Required for limit and stop-limit orders.
              price-effect:
                type: string
                description: If pay or receive payment for placing the order. i.e. `Credit` or `Debit`
                enum:
                - Credit
                - Debit
              value:
                type: number
                format: double
                description: The notional value of the Order, required for notional market orders.
              value-effect:
                type: string
                description: If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`
                enum:
                - Credit
                - Debit
              automated-source:
                type: boolean
                description: If the order was placed from an automated source
                default: false
              external-identifier:
                type: string
                description: External identifier for the order
              partition-key:
                type: string
                description: Account partition key
              preflight-id:
                type: string
                description: Transient order identifier used for matching preflight errors to an individual order
              source:
                type: string
                description: The source the order is coming from
              legs:
                type: array
                items:
                  type: object
                  properties:
                    action:
                      type: string
                      description: "The directional action of the leg. i.e.\n                                  `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n                                  Note: `Buy` and `Sell` are only applicable to Futures orders."
                      enum:
                      - Allocate
                      - Buy
                      - Buy to Close
                      - Buy to Open
                      - Sell
                      - Sell to Close
                      - Sell to Open
                    instrument-type:
                      type: string
                      description: "The type of Instrument. i.e.\n                                           `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`"
                      enum:
                      - Cryptocurrency
                      - Equity
                      - Equity Option
                      - Event Contract
                      - Fixed Income Security
                      - Future
                      - Future Option
                      - Liquidity Pool
                    quantity:
                      type: number
                      format: double
                      description: The size of the contract. Required for all orders but notional market.
                    symbol:
                      type: string
                      description: "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL  191004P00275000`, \\\n                                    TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`"
                  required:
                  - action
                  - instrument-type
                  - symbol
              rules:
                type: object
                properties:
                  cancel-at:
                    type: string
                    format: date-time
                    description: Latest time an order should be canceled at
                  conditions:
                    type: array
                    items:
                      type: object
                      properties:
                        action:
                          type: string
                          description: "The action in which the trigger is enacted. i.e.\n                                    `cancel` and `route`"
                          enum:
                          - cancel
                          - route
                        instrument-type:
                          type: string
                          description: "The instrument's type in relation to the condition. e.g. \\\n                                              `Equity` or `Future`"
                          enum:
                          - Bond
                          - Cryptocurrency
                          - Currency Pair
                          - Equity
                          - Equity Offering
                          - Equity Option
                          - Event Contract
                          - Fixed Income Security
                          - Future
                          - Future Option
                          - Index
                          - Liquidity Pool
                          - Unknown
                          - Warrant
                        symbol:
                          type: string
                          description: "The symbol to apply the condition to. \\\n                                      e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`"
                        comparator:
                          type: string
                          description: "How to compare against the threshold. \\\n                                        Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)"
                          enum:
                          - gte
                          - lte
                        indicator:
                          type: string
                          description: The indicator for the trigger, currently only supports `last`
                          enum:
                          - last
                          - nat
                        threshold:
                          type: number
                          format: double
                          description: The price at which the condition triggers.
                        price-components:
                          type: array
                          items:
                            type: object
                            properties:
                              instrument-type:
                                type: string
                                description: The instrument's type in relation to the symbol.
                                enum:
                                - Bond
                                - Cryptocurrency
                                - Currency Pair
                                - Equity
                                - Equity Offering
                                - Equity Option
                                - Event Contract
                                - Fixed Income Security
                                - Future
                                - Future Option
                                - Index
                                - Liquidity Pool
                                - Unknown
                                - Warrant
                              quantity:
                                type: number
                                format: double
                                description: The Ratio quantity in relation to the symbol
                              quantity-direction:
                                type: string
                                description: The quantity direction(ie Long or Short) in relation to the symbol
                                enum:
                                - Long
                                - Short
                              symbol:
                                type: string
                                description: "The symbol to apply the condition to. \\\n                                      e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`"
                            required:
                            - instrument-type
                            - quantity
                            - quantity-direction
                            - symbol
                      required:
                      - action
                      - comparator
                      - indicator
                      - threshold
                  route-after:
                    type: string
                    format: date-time
                    description: Earliest time an order should route at
              advanced-instructions:
                type: object
                properties:
                  strict-position-effect-validation:
                    type: boolean
                    description: If the order should be rejected the open/close position effect is not valid
                    default: false
            required:
            - order-type
            - stop-trigger
            - time-in-force
            - price-effect
            - value-effect
            - legs
        trigger-order:
          type: object
          description: Initial live order for OTO based orders
          properties:
            gtc-date:
              type: string
              format: date
              description: The date in which a GTD order will expire. Can only be provided if time-in-force is GTD.
            order-type:
              type: string
              description: "The type of order in regards to the price. i.e.\n                                    `Limit`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`"
              enum:
              - Limit
              - Market
              - Marketable Limit
              - Notional Market
              - Stop
              - Stop Limit
            stop-trigger:
              type: number
              format: double
              description: The price trigger at which a stop or stop-limit order becomes valid.
            time-in-force:
              type: string
              description: "The length in time before the order expires. i.e.\n                                       `Day`, `Ext`, `Ext Overnight`, `GTC`, `GTC Ext`, `GTC Ext Overnight`, `GTD` or `IOC`"
              enum:
              - Day
              - Ext
              - Ext Overnight
              - GTC
              - GTC Ext
              - GTC Ext Overnight
              - GTD
              - IOC
            price:
              type: number
              format: double
              description: The price of the Order. Required for limit and stop-limit orders.
            price-effect:
              type: string
              description: If pay or receive payment for placing the order. i.e. `Credit` or `Debit`
              enum:
              - Credit
              - Debit
            value:
              type: number
              format: double
              description: The notional value of the Order, required for notional market orders.
            value-effect:
              type: string
              description: If pay or receive payment for placing the notional market order. i.e. `Credit` or `Debit`
              enum:
              - Credit
              - Debit
            automated-source:
              type: boolean
              description: If the order was placed from an automated source
              default: false
            external-identifier:
              type: string
              description: External identifier for the order
            partition-key:
              type: string
              description: Account partition key
            preflight-id:
              type: string
              description: Transient order identifier used for matching preflight errors to an individual order
            source:
              type: string
              description: The source the order is coming from
            legs:
              type: array
              items:
                type: object
                properties:
                  action:
                    type: string
                    description: "The directional action of the leg. i.e.\n                                  `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.\n                                  Note: `Buy` and `Sell` are only applicable to Futures orders."
                    enum:
                    - Allocate
                    - Buy
                    - Buy to Close
                    - Buy to Open
                    - Sell
                    - Sell to Close
                    - Sell to Open
                  instrument-type:
                    type: string
                    description: "The type of Instrument. i.e.\n                                           `Cryptocurrency`, `Equity`, `Equity Option`, `Event Contract`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`"
                    enum:
                    - Cryptocurrency
                    - Equity
                    - Equity Option
                    - Event Contract
                    - Fixed Income Security
                    - Future
                    - Future Option
                    - Liquidity Pool
                  quantity:
                    type: number
                    format: double
                    description: The size of the contract. Required for all orders but notional market.
                  symbol:
                    type: string
                    description: "The Stock Ticker Symbol `AAPL`, OCC Option Symbol `AAPL  191004P00275000`, \\\n                                    TW Future Symbol `/ESZ9`, or TW Future Option Symbol `./ESZ9 EW4U9 190927P2975`"
                required:
                - action
                - instrument-type
                - symbol
            rules:
              type: object
              properties:
                cancel-at:
                  type: string
                  format: date-time
                  description: Latest time an order should be canceled at
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      action:
                        type: string
                        description: "The action in which the trigger is enacted. i.e.\n                                    `cancel` and `route`"
                        enum:
                        - cancel
                        - route
                      instrument-type:
                        type: string
                        description: "The instrument's type in relation to the condition. e.g. \\\n                                              `Equity` or `Future`"
                        enum:
                        - Bond
                        - Cryptocurrency
                        - Currency Pair
                        - Equity
                        - Equity Offering
                        - Equity Option
                        - Event Contract
                        - Fixed Income Security
                        - Future
                        - Future Option
                        - Index
                        - Liquidity Pool
                        - Unknown
                        - Warrant
                      symbol:
                        type: string
                        description: "The symbol to apply the condition to. \\\n                                      e.g Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`"
                      comparator:
                        type: string
                        description: "How to compare against the threshold. \\\n                                        Currently Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)"
                        enum:
                        - gte
                        - lte
                      indicator:
                        type: string
                        description: The indicator for the trigger, currently only supports `last`
                        enum:
                        - last
                        - nat
                      threshold:
                        type: number
                        format: double
                        description: The price at which the condition triggers.
                      price-components:
                        type: array
                        items:
                          type: object
                          properties:
                            instrument-type:
                              type: string
                              description: The instrument's type in relation to the symbol.
                              enum:
                              - Bond
                              - Cryptocurrency
                              - Currency Pair
                              - Equity
                              - Equity Offering
                              - Equity Option
                              - Event Contract
                              - Fixed Income Security
                              - Future
                              - Future Option
                              - Index
                              - Liquidity Pool
                              - Unknown
                              - Warrant
                            quantity:
                              type: number
                              format: double
                              description: The Ratio quantity in relation to the symbol
                            quantity-direction:
                              type: string
                              description: The quantity direction(ie Long or Short) in relation to the symbol
                              enum:
                              - Long
                              - Short
                            symbol:
                              type: string
                              description: "The symbol to apply the condition to. \\\n                                      e.g. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`"
                          required:
                          - instrument-type
                          - quantity
                          - quantity-direction
                          - symbol
                    required:
                    - action
                    - comparator
                    - indicator
                    - threshold
                route-after:
                  type: string
                  format: date-time
                  description: Earliest time an order should route at
            advanced-instructions:
              type: object
              properties:
                strict-position-effect-validation:
                  type: boolean
                  description: If the order should be rejected the open/close position effect is not valid
                  default: false
          required:
          - order-type
          - stop-trigger
          - time-in-force
          - price-effect
          - value-effect
          - legs
        type:
          type: string
          description: "The type of stragegy for the complex order i.e.\n                              `BLAST`, `OCO`, `OTO`, `OTOCO` or `PAIRS`"
          enum:
          - BLAST
          - OCO
          - OTO
          - OTOCO
          - PAIRS
        ratio-price-comparator:
          type: string
          description: "How to compare against the ratio price. \\\n                                            Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)"
          enum:
          - gte
          - lte
        ratio-price-is-threshold-based-on-notional:
          type: boolean
          description: If comparison is in notional value instead of price.
        ratio-price-threshold:
          type: number
          format: double
          description: Ratio price for a PAIRS trade
        source:
          type: string
          description: The source the order is coming from
      required:
      - orders
      - type
      - ratio-price-comparator
      - ratio-price-threshold
      description: Creates a new Complex Order from supplied params
    PlacedOrderResponse:
      type: object
      properties:
        buying-power-effect:
          description: ''
          type: string
        closing-fee-calculation:
          description: ''
          type: string
        complex-order:
          type: object
          properties:
            id:
              description: ''
              type: string
            account-number:
              description: ''
              type: string
            ratio-price-comparator:
              description: ''
              type: string
            ratio-price-is-threshold-based-on-notional:
              description: ''
              type: boolean
            ratio-price-threshold:
              description: ''
              type: number
              format: double
            terminal-at:
              description: ''
              type: string
            type:
              description: ''
              type: string
            related-orders:
              type: array
              items:
                type: object
                properties:
                  id:
                    description: ''
                    type: string
                  complex-order-id:
                    description: ''
                    type: string
                  complex-order-tag:
                    description: ''
                    type: string
                  replaces-order-id:
                    description: ''
                    type: string
                  replacing-order-id:
                    description: ''
                    type: string
                  status:
                    description: ''
                    type: string
                description: Non-current orders. This includes replaced orders, unfilled orders, and terminal orders.
            orders:
              type: array
              items:
                type: object
                properties:
                  id:
                    description: ''
                    type: string
                  account-number:
                    description: ''
                    type: string
                  cancel-user-id:
                    description: ''
                    type: string
                  cancel-username:
                    description: ''
                    type: string
                  cancellable:
                    description: ''
                    type: boolean
                  cancelled-at:
                    description: ''
                    type: string
                    format: date-time
                  cancelled-size:
                    description: ''
                    type: number
                    format: double
                  complex-order-id:
                    description: ''
                    type: string
                  complex-order-tag:
                    description: ''
                    type: string
                  contingent-status:
                    description: ''
                    type: string
                  editable:
                    description: ''
                    type: boolean
                  edited:
                    description: '

# --- truncated at 32 KB (98 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/tastytrade/refs/heads/main/openapi/tastytrade-complex-orders-api-openapi.yml