openapi: 3.1.0
info:
  title: Orders
  version: 11.124.10
  description: tastytrade Orders API.
  contact:
    name: tastytrade API support
    email: api.support@tastytrade.com
    url: https://developer.tastytrade.com
tags:
  - name: complex-orders
  - name: orders
paths:
  /accounts/{account_number}/complex-orders:
    get:
      description: Returns a paginated list of all complex (bracket) orders for the
        account, such as OTOCO, OCO, OTO, and PAIRS strategies. Each complex
        order wraps one or more component orders and, where applicable, a
        trigger order. Use the `page-offset` and `per-page` query parameters to
        page through results.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: query
          name: page-offset
          required: false
          schema:
            type: integer
            format: int32
            default: 0
          example: 10
        - in: query
          name: per-page
          required: false
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 200
            default: 10
          example: 10
      responses:
        "200":
          description: A paginated list of complex orders for the account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/ComplexOrder"
                    required:
                      - items
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit reading
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: getAccountsAccountNumberComplexOrders
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: List Complex Orders
    post:
      description: Submits a new complex (bracket) order from the supplied parameters.
        Supported strategies are `OTOCO`, `OCO`, `OTO`, and `PAIRS` (`BLAST` is
        deprecated and unsupported). OTOCO and OTO orders include a
        `trigger-order` that routes immediately; the remaining `orders` stay in
        `Contingent` status until the trigger order fills. Run the dry-run
        endpoint first to validate the order.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/postAccountsAccountNumberComplexOrders"
        required: true
      responses:
        "201":
          description: The complex order was accepted. The response contains the overall
            complex order id plus an id for each component order, along with the
            buying-power and fee impact.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PlacedOrderResponse"
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit placing
            orders on this account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The complex order failed preflight validation. The response JSON's
            `error.message` (and `errors[]`) explain the rejection reason, for
            example a contingent leg with no existing position to close.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: postAccountsAccountNumberComplexOrders
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Submit Complex Order
  /accounts/{account_number}/complex-orders/dry-run:
    post:
      description: Validates a new complex order without routing it, returning the
        same preflight checks, warnings, buying-power effect, and fee estimate
        as a live submission. Submit the identical body to `POST
        /accounts/{account_number}/complex-orders` once it passes.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/postAccountsAccountNumberComplexOrdersDryRun"
        required: true
      responses:
        "201":
          description: The dry-run completed. The response contains warnings, the
            buying-power effect, and the fee calculation for the proposed
            complex order without placing it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PlacedOrderResponse"
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders/dry-run
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit this
            action.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The proposed complex order failed preflight validation. Read
            `error.message` (and `errors[]`) to fix the rejection reason before
            submitting.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: postAccountsAccountNumberComplexOrdersDryRun
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Dry Run Complex Order
  /accounts/{account_number}/complex-orders/live:
    get:
      description: Returns all complex orders that had a component order placed today,
        regardless of current status. Despite the `live` name, the response
        includes orders that were cancelled, rejected, or filled today as well
        as still-working orders.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
      responses:
        "200":
          description: Complex orders with a component order placed during the current
            trading day.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/ComplexOrder"
                    required:
                      - items
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders/live
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit reading
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: getAccountsAccountNumberComplexOrdersLive
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: List Today's Complex Orders
  /accounts/{account_number}/complex-orders/{id}:
    get:
      description: Returns the full representation of a single complex order by its
        id, including its trigger order (if any), all component orders, and any
        related (replaced or terminal) orders. The `id` must be the complex
        order id, not a component or trigger order id.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      responses:
        "200":
          description: The full complex order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/ComplexOrder"
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders/{id}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit reading
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No complex order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: getAccountsAccountNumberComplexOrdersId
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Complex Order
    patch:
      description: Edits the ratio-price threshold (and its comparator) of a working
        PAIRS complex order. Only PAIRS orders can be edited through this
        endpoint.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/patchAccountsAccountNumberComplexOrdersId"
        required: true
      responses:
        "200":
          description: The edited complex order, returned via a placed-order response with
            the updated ratio-price threshold.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PlacedOrderResponse"
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders/{id}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit editing
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No complex order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The edit is invalid in context, for example the order is not a
            PAIRS order or is no longer editable. Read `error.message` for the
            reason.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: patchAccountsAccountNumberComplexOrdersId
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Edit PAIRS Complex Order
    delete:
      description: Requests cancellation of all non-terminal component orders of a
        complex order. The `id` must be the complex order id, not its trigger
        order id or any nested order id. Successfully requested components
        transition to `Cancel Requested` and then `Cancelled` once the exchange
        confirms.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      responses:
        "200":
          description: The complex order with its components transitioning to a cancelled
            state.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/ComplexOrder"
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders/{id}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit
            cancelling this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No complex order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The complex order (or all its components) is already in a terminal
            status and cannot be cancelled. Read `error.message` for the reason.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: deleteAccountsAccountNumberComplexOrdersId
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: true
      x-rate-limit-bucket: destructive
      summary: Cancel Complex Order
  /accounts/{account_number}/complex-orders/{id}/dry-run:
    post:
      description: Validates an edit to an existing complex order (the ratio-price
        threshold of a PAIRS order) without routing it. Returns the preflight
        checks, warnings, buying-power effect, and fee estimate for the proposed
        edit.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/postAccountsAccountNumberComplexOrdersIdDryRun"
        required: true
      responses:
        "201":
          description: The dry-run for the proposed edit completed without routing it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PlacedOrderResponse"
                  context:
                    type: string
                    example: /accounts/{account_number}/complex-orders/{id}/dry-run
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit this
            action.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No complex order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The proposed edit failed preflight validation. Read `error.message`
            to fix the reason before submitting.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - complex-orders
      operationId: postAccountsAccountNumberComplexOrdersIdDryRun
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Dry Run Complex Order Edit
  /accounts/{account_number}/orders:
    get:
      description: Returns a paginated list of the account's orders, filterable by
        date range, underlying symbol, instrument type, and status. Results
        default to descending chronological order; pass `sort=Asc` to reverse.
        Use `page-offset` and `per-page` to page through results.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: query
          name: page-offset
          required: false
          schema:
            type: integer
            format: int32
            default: 0
          example: 10
        - in: query
          name: per-page
          required: false
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 200
            default: 10
          example: 10
        - in: query
          name: end-date
          required: false
          schema:
            type: string
            format: date
          example: 2024-01-15
        - in: query
          name: futures-symbol
          description: Used to fetch both futures and futures options orders
          required: false
          schema:
            type: string
          example: ESM3
        - in: query
          name: start-date
          required: false
          schema:
            type: string
            format: date
          example: 2024-01-15
        - in: query
          name: status
          description: " (example: status[]={value1}&status[]={value2})"
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
          example:
            - Live
            - Filled
        - in: query
          name: underlying-instrument-type
          description: Underlying instrument type
          required: false
          schema:
            type: string
          example: Equity
        - in: query
          name: underlying-symbol
          required: false
          schema:
            type: string
          example: AAPL
        - in: query
          name: sort
          description: The order to sort results in. Accepts `Desc` or `Asc`. Defaults to
            `Desc`
          required: false
          schema:
            type: string
            enum:
              - Desc
              - Asc
            default: Desc
          example: Desc
        - in: query
          name: end-at
          description: DateTime end range for filtering orders in full date-time
          required: false
          schema:
            type: string
            format: date-time
          example: 2024-01-15T14:30:00.000Z
        - in: query
          name: start-at
          description: DateTime start rage for filtering orders in full date-time
          required: false
          schema:
            type: string
            format: date-time
          example: 2024-01-15T14:30:00.000Z
      responses:
        "200":
          description: A paginated list of the account's orders matching the filters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/Order"
                    required:
                      - items
                  context:
                    type: string
                    example: /accounts/{account_number}/orders
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit reading
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: getAccountsAccountNumberOrders
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Search Orders
    post:
      description: Submits an order for the account and routes it to an exchange. The
        response includes the new order id, its status (often `Routed`), and the
        buying-power and fee impact. Run the same body through the dry-run
        endpoint first to confirm it will be accepted.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/postAccountsAccountNumberOrders"
        required: true
      responses:
        "201":
          description: The order was accepted and routed. The response wraps the order
            plus its buying-power effect and fee calculation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PlacedOrderResponse"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit placing
            orders on this account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The order failed one or more preflight checks (for example
            `cant_buy_for_credit`, an invalid symbol, or insufficient buying
            power). The reason is in the response JSON's `error.message` and
            `error.errors[]`.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: postAccountsAccountNumberOrders
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Submit Order
  /accounts/{account_number}/orders/dry-run:
    post:
      description: Runs the full preflight checks for an order without routing it,
        returning warnings, the buying-power effect, and an estimated fee
        calculation. A warning here means the order would be rejected if
        actually submitted. When ready, post the identical body to `POST
        /accounts/{account_number}/orders`.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/postAccountsAccountNumberOrdersDryRun"
        required: true
      responses:
        "201":
          description: The dry-run completed. The response contains the proposed order,
            any warnings, the buying-power effect, and the fee calculation
            without placing the order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PlacedOrderResponse"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/dry-run
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit this
            action.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The proposed order failed preflight validation. Read
            `error.message` and `error.errors[]` to fix the rejection reason
            before submitting.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: postAccountsAccountNumberOrdersDryRun
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Dry Run Order
  /accounts/{account_number}/orders/live:
    get:
      description: Returns all orders that were created or updated during the current
        trading day, in any status. Despite the `live` name, the response also
        includes orders cancelled, rejected, filled, or expired today, plus
        older GTC orders that are still working.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
      responses:
        "200":
          description: Orders created or updated during the current trading day.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/Order"
                    required:
                      - items
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/live
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit reading
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The account number does not exist or is not accessible with this
            token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: getAccountsAccountNumberOrdersLive
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: List Today's Orders
  /accounts/{account_number}/orders/{id}:
    get:
      description: Returns a single order by its id, including its legs, fills,
        current status, and tracking details. Use this to follow an order's
        progress through the submission, working, and terminal phases.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      responses:
        "200":
          description: The requested order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/Order"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/{id}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit reading
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: getAccountsAccountNumberOrdersId
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Get Order
    put:
      description: Cancel-replaces a live order with a new one. Only `price`,
        `order-type`, and `time-in-force` may change; the rest of the body must
        match the original order. The replacement stays `Contingent` until the
        original is cancelled, and any fill of the original aborts the
        replacement.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/putAccountsAccountNumberOrdersId"
        required: true
      responses:
        "200":
          description: The replacement order, typically `Contingent` until the original
            order is cancelled.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/Order"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/{id}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit editing
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The order cannot be replaced (for example it is already in a
            terminal status) or the replacement failed preflight validation.
            Read `error.message` for the reason.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: putAccountsAccountNumberOrdersId
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: true
      x-rate-limit-bucket: destructive
      summary: Replace Order
    patch:
      description: Edits the price and execution properties of a live order by
        replacement. Only `price`, `order-type`, and `time-in-force` may change.
        As with a full replace, any fill of the original order aborts the edit.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/patchAccountsAccountNumberOrdersId"
        required: true
      responses:
        "200":
          description: The edited (replacement) order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/Order"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/{id}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit editing
            this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The order cannot be edited (for example it is no longer editable)
            or the edit failed preflight validation. Read `error.message` for
            the reason.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: patchAccountsAccountNumberOrdersId
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Edit Order
    delete:
      description: Requests cancellation of a live order. On success the order
        transitions to `Cancel Requested` while tastytrade confirms with the
        exchange, then to `Cancelled`. Cancelling an order that is already in a
        terminal status returns 422.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      responses:
        "200":
          description: The order with a `Cancel Requested` status while the exchange
            confirms the cancellation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/Order"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/{id}
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit
            cancelling this account's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The order is already in a terminal status and cannot be cancelled.
            The response JSON returns `error.code` `cannot_update_order` with
            the message 'the order could not be cancelled'.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: deleteAccountsAccountNumberOrdersId
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: true
      x-rate-limit-bucket: destructive
      summary: Cancel Order
  /accounts/{account_number}/orders/{id}/dry-run:
    post:
      description: Runs the preflight checks for a cancel-replace or edit of an
        existing order without routing it. Use this to confirm a replacement
        order will be accepted before calling the `PUT` or `PATCH` endpoint.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/postAccountsAccountNumberOrdersIdDryRun"
        required: true
      responses:
        "201":
          description: The dry-run for the proposed replacement completed without routing
            it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PlacedOrderResponse"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/{id}/dry-run
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit this
            action.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The proposed replacement failed preflight validation. Read
            `error.message` to fix the rejection reason before submitting.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: postAccountsAccountNumberOrdersIdDryRun
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Dry Run Order Edit
  /accounts/{account_number}/orders/{id}/reconfirm:
    post:
      description: Reconfirms an order.
      parameters:
        - in: path
          name: account_number
          required: true
          schema:
            type: string
          example: 5WX01234
        - in: path
          name: id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      responses:
        "201":
          description: The reconfirmed order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/Order"
                  context:
                    type: string
                    example: /accounts/{account_number}/orders/{id}/reconfirm
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope or the account authority does not permit this
            action.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: No order with this id exists on the account.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "422":
          description: The order could not be reconfirmed. Read `error.message` for the
            reason.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: preflight_check_failure
                    message: One or more preflight checks failed
                    errors:
                      - code: preflight_check_failure
                        message: A specific validation failed for this order.
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: postAccountsAccountNumberOrdersIdReconfirm
      x-tt-class: money-moving
      x-money-moving: true
      x-idempotent: false
      x-rate-limit-bucket: destructive
      summary: Reconfirm Order
  /customers/{customer_id}/orders:
    get:
      description: Returns a paginated list of orders across all of the customer's
        accounts, filterable by date range, underlying symbol, instrument type,
        and status. Results default to descending chronological order; pass
        `sort=Asc` to reverse.
      parameters:
        - in: path
          name: customer_id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
        - in: query
          name: page-offset
          required: false
          schema:
            type: integer
            format: int32
            default: 0
          example: 10
        - in: query
          name: per-page
          required: false
          schema:
            type: integer
            format: int32
            minimum: 1
            maximum: 200
            default: 10
          example: 10
        - in: query
          name: end-date
          required: false
          schema:
            type: string
            format: date
          example: 2024-01-15
        - in: query
          name: futures-symbol
          description: Used to fetch both futures and futures options orders
          required: false
          schema:
            type: string
          example: ESM3
        - in: query
          name: start-date
          required: false
          schema:
            type: string
            format: date
          example: 2024-01-15
        - in: query
          name: status
          description: " (example: status[]={value1}&status[]={value2})"
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
          example:
            - Live
            - Filled
        - in: query
          name: underlying-instrument-type
          description: Underlying instrument type
          required: false
          schema:
            type: string
          example: Equity
        - in: query
          name: underlying-symbol
          required: false
          schema:
            type: string
          example: AAPL
        - in: query
          name: sort
          description: The order to sort results in. Accepts `Desc` or `Asc`. Defaults to
            `Desc`
          required: false
          schema:
            type: string
            enum:
              - Desc
              - Asc
            default: Desc
          example: Desc
        - in: query
          name: end-at
          description: DateTime end range for filtering orders in full date-time
          required: false
          schema:
            type: string
            format: date-time
          example: 2024-01-15T14:30:00.000Z
        - in: query
          name: start-at
          description: DateTime start rage for filtering orders in full date-time
          required: false
          schema:
            type: string
            format: date-time
          example: 2024-01-15T14:30:00.000Z
      responses:
        "200":
          description: A paginated list of the customer's orders matching the filters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/Order"
                    required:
                      - items
                  context:
                    type: string
                    example: /customers/{customer_id}/orders
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope does not permit reading this customer's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The customer id does not exist or is not accessible with this token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: getCustomersCustomerIdOrders
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: Search Customer Orders
  /customers/{customer_id}/orders/live:
    get:
      description: Returns all orders across the customer's accounts that were created
        or updated during the current trading day, in any status. As with the
        account-level live endpoint, this includes orders cancelled, rejected,
        filled, or expired today.
      parameters:
        - in: path
          name: customer_id
          required: true
          schema:
            type: integer
            format: int32
          example: 1
      responses:
        "200":
          description: The customer's orders created or updated during the current trading
            day.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/Order"
                    required:
                      - items
                  context:
                    type: string
                    example: /customers/{customer_id}/orders/live
                  pagination:
                    type: object
                    description: Paging metadata, present on paginated list responses.
                    properties:
                      per-page:
                        type: integer
                      page-offset:
                        type: integer
                      item-offset:
                        type: integer
                      total-items:
                        type: integer
                      total-pages:
                        type: integer
                      current-item-count:
                        type: integer
                required:
                  - data
                  - context
        "401":
          description: Missing or expired access token, or a missing/malformed
            `User-Agent` header.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: unauthorized
                    message: No valid access token was provided; access tokens expire after 15
                      minutes.
        "403":
          description: The token's scope does not permit reading this customer's orders.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
                example:
                  error:
                    code: not_permitted
                    message: User not permitted access
        "404":
          description: The customer id does not exist or is not accessible with this token.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
        "429":
          description: Request rate exceeded. Back off exponentially and reduce your
            request rate.
          content:
            application/json:
              schema:
                type: object
                description: Standard tastytrade error envelope. Branch on error.code, not the
                  message text.
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        description: Machine-readable error code (see the Error reference).
                      message:
                        type: string
                        description: Human-readable explanation.
                      errors:
                        type: array
                        description: Present for multi-error / validation failures; one entry per
                          problem.
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            domain:
                              type: string
                required:
                  - error
      tags:
        - orders
      operationId: getCustomersCustomerIdOrdersLive
      x-tt-class: read
      x-money-moving: false
      x-idempotent: true
      x-rate-limit-bucket: read
      summary: List Customer's Today's Orders
servers:
  - url: https://api.cert.tastyworks.com
    description: Sandbox
  - url: https://api.tastyworks.com
    description: Production
components:
  schemas:
    ComplexOrder:
      type: object
      properties:
        id:
          description: The unique identifier of the complex order. Use it (not a component
            or trigger order id) to fetch or cancel the complex order.
          type: string
          example: "2000010530"
        account-number:
          description: The account number the complex order belongs to.
          type: string
          example: 5WX01234
        ratio-price-comparator:
          description: "For PAIRS orders, how the ratio price is compared against the
            threshold: `gte` or `lte`."
          type: string
          example: lte
        ratio-price-is-threshold-based-on-notional:
          description: For PAIRS orders, whether the threshold comparison is in notional
            value rather than price.
          type: boolean
          example: false
        ratio-price-threshold:
          description: For PAIRS orders, the ratio price threshold that triggers the
            trade. Serialized as a JSON string decimal. Decimal value serialized
            as a JSON string (e.g. "150.25").
          type: string
          format: decimal
          example: "1.25"
        terminal-at:
          description: Timestamp when the complex order reached a terminal state, if
            applicable.
          type: string
          example: 2024-07-31T16:50:23.417+00:00
        type:
          description: "The complex order strategy: `OTOCO`, `OCO`, `OTO`, or `PAIRS`."
          type: string
          example: OTOCO
        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
              complex-order-id:
                description: ""
                type: string
              complex-order-tag:
                description: ""
                type: string
              confirmation-status:
                description: ""
                type: string
              contingent-status:
                description: ""
                type: string
              editable:
                description: ""
                type: boolean
              edited:
                description: ""
                type: boolean
              external-identifier:
                description: ""
                type: string
              global-request-id:
                description: ""
                type: string
              gtc-date:
                description: ""
                type: string
                format: date
              in-flight-at:
                description: ""
                type: string
                format: date-time
              liquidity-pool-instrument-type:
                description: ""
                type: string
              live-at:
                description: ""
                type: string
                format: date-time
              max-value-per-liquidity-allocation-fill:
                description: ""
                type: string
              order-type:
                description: ""
                type: string
              preflight-id:
                description: ""
                type: string
              price:
                description: Decimal value serialized as a JSON string (e.g. "150.25").
                type: string
                format: decimal
              price-effect:
                description: ""
                type: string
              received-at:
                description: ""
                type: string
                format: date-time
              reject-reason:
                description: ""
                type: string
              replaces-order-id:
                description: ""
                type: string
              replacing-order-id:
                description: ""
                type: string
              size:
                description: ""
                type: string
              source:
                description: ""
                type: string
              status:
                description: ""
                type: string
              stop-trigger:
                description: ""
                type: string
              terminal-at:
                description: ""
                type: string
                format: date-time
              time-in-force:
                description: ""
                type: string
              underlying-instrument-type:
                description: ""
                type: string
              underlying-symbol:
                description: ""
                type: string
              updated-at:
                description: ""
                type: string
              user-id:
                description: ""
                type: string
              username:
                description: ""
                type: string
              value:
                description: Decimal value serialized as a JSON string (e.g. "150.25").
                type: string
                format: decimal
              value-effect:
                description: ""
                type: string
              legs:
                type: array
                items:
                  type: object
                  properties:
                    action:
                      description: ""
                      type: string
                    instrument-type:
                      description: ""
                      type: string
                    quantity:
                      description: ""
                      type: string
                    remaining-quantity:
                      description: ""
                      type: string
                    symbol:
                      description: ""
                      type: string
                    fills:
                      type: array
                      items:
                        type: object
                        properties:
                          destination-venue:
                            description: ""
                            type: string
                          ext-exec-id:
                            description: ""
                            type: string
                          ext-group-fill-id:
                            description: ""
                            type: string
                          fill-id:
                            description: ""
                            type: string
                          fill-price:
                            description: Decimal value serialized as a JSON string (e.g. "150.25").
                            type: string
                            format: decimal
                          filled-at:
                            description: ""
                            type: string
                            format: date-time
                          quantity:
                            description: ""
                            type: string
                        description: ""
                  description: ""
              order-rule:
                type: object
                properties:
                  cancel-at:
                    description: ""
                    type: string
                    format: date-time
                  cancelled-at:
                    description: ""
                    type: string
                    format: date-time
                  route-after:
                    description: ""
                    type: string
                    format: date-time
                  routed-at:
                    description: ""
                    type: string
                    format: date-time
                  order-conditions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          description: ""
                          type: string
                        action:
                          description: ""
                          type: string
                        comparator:
                          description: ""
                          type: string
                        indicator:
                          description: ""
                          type: string
                        instrument-type:
                          description: ""
                          type: string
                        is-threshold-based-on-notional:
                          description: ""
                          type: boolean
                        symbol:
                          description: ""
                          type: string
                        threshold:
                          description: Decimal value serialized as a JSON string (e.g. "150.25").
                          type: string
                          format: decimal
                        triggered-at:
                          description: ""
                          type: string
                          format: date-time
                        triggered-value:
                          description: Decimal value serialized as a JSON string (e.g. "150.25").
                          type: string
                          format: decimal
                        price-components:
                          type: array
                          items:
                            type: object
                            properties:
                              instrument-type:
                                description: ""
                                type: string
                              quantity:
                                description: ""
                                type: string
                              quantity-direction:
                                description: ""
                                type: string
                              symbol:
                                description: ""
                                type: string
                            description: ""
                      description: ""
                description: ""
            description: "Orders with complex-order-tag: '<type>::order'. For example,
              'OTO::order' for OTO complex orders."
        trigger-order:
          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
            complex-order-id:
              description: ""
              type: string
            complex-order-tag:
              description: ""
              type: string
            confirmation-status:
              description: ""
              type: string
            contingent-status:
              description: ""
              type: string
            editable:
              description: ""
              type: boolean
            edited:
              description: ""
              type: boolean
            external-identifier:
              description: ""
              type: string
            global-request-id:
              description: ""
              type: string
            gtc-date:
              description: ""
              type: string
              format: date
            in-flight-at:
              description: ""
              type: string
              format: date-time
            liquidity-pool-instrument-type:
              description: ""
              type: string
            live-at:
              description: ""
              type: string
              format: date-time
            max-value-per-liquidity-allocation-fill:
              description: ""
              type: string
            order-type:
              description: ""
              type: string
            preflight-id:
              description: ""
              type: string
            price:
              description: Decimal value serialized as a JSON string (e.g. "150.25").
              type: string
              format: decimal
            price-effect:
              description: ""
              type: string
            received-at:
              description: ""
              type: string
              format: date-time
            reject-reason:
              description: ""
              type: string
            replaces-order-id:
              description: ""
              type: string
            replacing-order-id:
              description: ""
              type: string
            size:
              description: ""
              type: string
            source:
              description: ""
              type: string
            status:
              description: ""
              type: string
            stop-trigger:
              description: ""
              type: string
            terminal-at:
              description: ""
              type: string
              format: date-time
            time-in-force:
              description: ""
              type: string
            underlying-instrument-type:
              description: ""
              type: string
            underlying-symbol:
              description: ""
              type: string
            updated-at:
              description: ""
              type: string
            user-id:
              description: ""
              type: string
            username:
              description: ""
              type: string
            value:
              description: Decimal value serialized as a JSON string (e.g. "150.25").
              type: string
              format: decimal
            value-effect:
              description: ""
              type: string
            legs:
              type: array
              items:
                type: object
                properties:
                  action:
                    description: ""
                    type: string
                  instrument-type:
                    description: ""
                    type: string
                  quantity:
                    description: ""
                    type: string
                  remaining-quantity:
                    description: ""
                    type: string
                  symbol:
                    description: ""
                    type: string
                  fills:
                    type: array
                    items:
                      type: object
                      properties:
                        destination-venue:
                          description: ""
                          type: string
                        ext-exec-id:
                          description: ""
                          type: string
                        ext-group-fill-id:
                          description: ""
                          type: string
                        fill-id:
                          description: ""
                          type: string
                        fill-price:
                          description: Decimal value serialized as a JSON string (e.g. "150.25").
                          type: string
                          format: decimal
                        filled-at:
                          description: ""
                          type: string
                          format: date-time
                        quantity:
                          description: ""
                          type: string
                      description: ""
                description: ""
            order-rule:
              type: object
              properties:
                cancel-at:
                  description: ""
                  type: string
                  format: date-time
                cancelled-at:
                  description: ""
                  type: string
                  format: date-time
                route-after:
                  description: ""
                  type: string
                  format: date-time
                routed-at:
                  description: ""
                  type: string
                  format: date-time
                order-conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        description: ""
                        type: string
                      action:
                        description: ""
                        type: string
                      comparator:
                        description: ""
                        type: string
                      indicator:
                        description: ""
                        type: string
                      instrument-type:
                        description: ""
                        type: string
                      is-threshold-based-on-notional:
                        description: ""
                        type: boolean
                      symbol:
                        description: ""
                        type: string
                      threshold:
                        description: Decimal value serialized as a JSON string (e.g. "150.25").
                        type: string
                        format: decimal
                      triggered-at:
                        description: ""
                        type: string
                        format: date-time
                      triggered-value:
                        description: Decimal value serialized as a JSON string (e.g. "150.25").
                        type: string
                        format: decimal
                      price-components:
                        type: array
                        items:
                          type: object
                          properties:
                            instrument-type:
                              description: ""
                              type: string
                            quantity:
                              description: ""
                              type: string
                            quantity-direction:
                              description: ""
                              type: string
                            symbol:
                              description: ""
                              type: string
                          description: ""
                    description: ""
              description: ""
          description: "Order with complex-order-tag: '<type>::trigger-order'. For
            example, 'OTO::trigger-order for OTO complex orders."
      description: A complex (bracket) order that groups one or more component orders,
        and optionally a trigger order, into a single strategy. The strategy
        `type` is one of `OTOCO`, `OCO`, `OTO`, or `PAIRS` (`BLAST` is
        deprecated). For OTOCO and OTO orders the trigger order routes
        immediately and the remaining orders stay `Contingent` until it fills.
    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.
                                                      `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
                enum:
                  - Limit
                  - Liquidity Allocation
                  - Market
                  - Marketable Limit
                  - Notional Market
                  - Stop
                  - Stop Limit
              time-in-force:
                type: string
                description: >-
                  The length in time before the order expires. i.e.
                                                         `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
              stop-trigger:
                type: string
                format: decimal
                description: The price trigger at which a stop or stop-limit order becomes
                  valid. Decimal value serialized as a JSON string (e.g.
                  "150.25").
              price:
                type: string
                format: decimal
                description: The price of the Order. Required for limit and stop-limit orders.
                  Decimal value serialized as a JSON string (e.g. "150.25").
              price-effect:
                type: string
                description: If pay or receive payment for placing the order. i.e. `Credit` or
                  `Debit`
                enum:
                  - Credit
                  - Debit
              value:
                type: string
                format: decimal
                description: The notional value of the Order, required for notional market
                  orders. Decimal value serialized as a JSON string (e.g.
                  "150.25").
              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
              max-value-per-liquidity-allocation-fill:
                type: string
                format: decimal
                description: Max value per liquidity allocation fill Decimal value serialized as
                  a JSON string (e.g. "150.25").
              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.
                                                          `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.
                                                          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.
                                                                   `Cryptocurrency`, `Equity`, `Equity Offering`, `Equity Option`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`
                      enum:
                        - Cryptocurrency
                        - Equity
                        - Equity Offering
                        - Equity Option
                        - Fixed Income Security
                        - Future
                        - Future Option
                        - Liquidity Pool
                    quantity:
                      type: string
                      format: decimal
                      description: The size of the contract. Required for all orders but notional
                        market. Decimal value serialized as a JSON string (e.g.
                        "150.25").
                    symbol:
                      type: string
                      description: >-
                        The Stock Ticker Symbol `AAPL`, OCC Option Symbol
                        `AAPL  191004P00275000`, \
                                                            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.
                                                                `cancel` and `route`
                          enum:
                            - cancel
                            - route
                        instrument-type:
                          type: string
                          description: >-
                            The instrument's type in relation to the condition.
                            i.e. \
                                                                          `Equity` or `Future`
                          enum:
                            - Equity
                            - Future
                        symbol:
                          type: string
                          description: >-
                            The symbol to apply the condition to. \
                                                                  i.e. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`
                        comparator:
                          type: string
                          description: >-
                            How to compare against the threshold. \
                                                                    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: string
                          format: decimal
                          description: The price at which the condition triggers. Decimal value serialized
                            as a JSON string (e.g. "150.25").
                        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
                                  - Fixed Income Security
                                  - Future
                                  - Future Option
                                  - Index
                                  - Liquidity Pool
                                  - Unknown
                                  - Warrant
                              quantity:
                                type: string
                                format: decimal
                                description: The Ratio quantity in relation to the symbol Decimal value
                                  serialized as a JSON string (e.g. "150.25").
                              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. \
                                                                        i.e. 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
              - time-in-force
              - stop-trigger
              - 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.
                                                    `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
              enum:
                - Limit
                - Liquidity Allocation
                - Market
                - Marketable Limit
                - Notional Market
                - Stop
                - Stop Limit
            time-in-force:
              type: string
              description: >-
                The length in time before the order expires. i.e.
                                                       `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
            stop-trigger:
              type: string
              format: decimal
              description: The price trigger at which a stop or stop-limit order becomes
                valid. Decimal value serialized as a JSON string (e.g.
                "150.25").
            price:
              type: string
              format: decimal
              description: The price of the Order. Required for limit and stop-limit orders.
                Decimal value serialized as a JSON string (e.g. "150.25").
            price-effect:
              type: string
              description: If pay or receive payment for placing the order. i.e. `Credit` or
                `Debit`
              enum:
                - Credit
                - Debit
            value:
              type: string
              format: decimal
              description: The notional value of the Order, required for notional market
                orders. Decimal value serialized as a JSON string (e.g.
                "150.25").
            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
            max-value-per-liquidity-allocation-fill:
              type: string
              format: decimal
              description: Max value per liquidity allocation fill Decimal value serialized as
                a JSON string (e.g. "150.25").
            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.
                                                        `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.
                                                        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.
                                                                 `Cryptocurrency`, `Equity`, `Equity Offering`, `Equity Option`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`
                    enum:
                      - Cryptocurrency
                      - Equity
                      - Equity Offering
                      - Equity Option
                      - Fixed Income Security
                      - Future
                      - Future Option
                      - Liquidity Pool
                  quantity:
                    type: string
                    format: decimal
                    description: The size of the contract. Required for all orders but notional
                      market. Decimal value serialized as a JSON string (e.g.
                      "150.25").
                  symbol:
                    type: string
                    description: >-
                      The Stock Ticker Symbol `AAPL`, OCC Option Symbol
                      `AAPL  191004P00275000`, \
                                                          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.
                                                              `cancel` and `route`
                        enum:
                          - cancel
                          - route
                      instrument-type:
                        type: string
                        description: >-
                          The instrument's type in relation to the condition.
                          i.e. \
                                                                        `Equity` or `Future`
                        enum:
                          - Equity
                          - Future
                      symbol:
                        type: string
                        description: >-
                          The symbol to apply the condition to. \
                                                                i.e. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`
                      comparator:
                        type: string
                        description: >-
                          How to compare against the threshold. \
                                                                  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: string
                        format: decimal
                        description: The price at which the condition triggers. Decimal value serialized
                          as a JSON string (e.g. "150.25").
                      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
                                - Fixed Income Security
                                - Future
                                - Future Option
                                - Index
                                - Liquidity Pool
                                - Unknown
                                - Warrant
                            quantity:
                              type: string
                              format: decimal
                              description: The Ratio quantity in relation to the symbol Decimal value
                                serialized as a JSON string (e.g. "150.25").
                            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. \
                                                                      i.e. 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
            - time-in-force
            - stop-trigger
            - price-effect
            - value-effect
            - legs
        type:
          type: string
          description: >-
            The type of stragegy for the complex order i.e.
                                          `BLAST`, `OCO`, `OTO`, `OTOCO` or `PAIRS`
          enum:
            - BLAST
            - OCO
            - OTO
            - OTOCO
            - PAIRS
          example: OTOCO
        ratio-price-comparator:
          type: string
          description: >-
            How to compare against the ratio price. \
                                                        Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)
          enum:
            - gte
            - lte
          example: lte
        ratio-price-is-threshold-based-on-notional:
          type: boolean
          description: If comparison is in notional value instead of price.
        ratio-price-threshold:
          type: string
          format: decimal
          description: Ratio price for a PAIRS trade Decimal value serialized as a JSON
            string (e.g. "150.25").
          example: "1.25"
        source:
          type: string
          description: The source the order is coming from
          example: my-api-code
      required:
        - type
        - orders
      description: Request body for submitting a complex (bracket) order. Requires
        `type`, an `orders` array, and the ratio-price fields for PAIRS
        strategies. OTOCO and OTO strategies also include a `trigger-order` that
        routes immediately while the `orders` wait in `Contingent` status.
        `ratio-price-comparator` and `ratio-price-threshold` apply to PAIRS
        trades only (upstream marks them always-required; attested OTO/OCO/OTOCO
        bodies contain neither).
    PlacedOrderResponse:
      type: object
      properties:
        buying-power-effect:
          description: Details of the order's impact on the account's buying power,
            including the change in buying power and its direction. A JSON
            object (upstream types this field as a string; attested responses
            return this object, with decimal values serialized as JSON strings).
          type: object
          properties:
            change-in-margin-requirement:
              type: string
              format: decimal
              example: "300.0"
            change-in-margin-requirement-effect:
              type: string
              example: Debit
            change-in-buying-power:
              type: string
              format: decimal
              example: "102.302"
            change-in-buying-power-effect:
              type: string
              example: Debit
            current-buying-power:
              type: string
              format: decimal
              example: "8995981.2613"
            current-buying-power-effect:
              type: string
              example: Credit
            new-buying-power:
              type: string
              format: decimal
              example: "8995878.9593"
            new-buying-power-effect:
              type: string
              example: Credit
            isolated-order-margin-requirement:
              type: string
              format: decimal
              example: "300.0"
            isolated-order-margin-requirement-effect:
              type: string
              example: Debit
            is-spread:
              type: boolean
              example: true
            impact:
              type: string
              format: decimal
              example: "102.302"
            effect:
              type: string
              example: Debit
        closing-fee-calculation:
          description: An estimate of the fees to expect when later closing the position
            this order would open. Provided as a convenience; not applied to
            this order.
          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: Decimal value serialized as a JSON string (e.g. "150.25").
              type: string
              format: decimal
            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
                  complex-order-id:
                    description: ""
                    type: string
                  complex-order-tag:
                    description: ""
                    type: string
                  confirmation-status:
                    description: ""
                    type: string
                  contingent-status:
                    description: ""
                    type: string
                  editable:
                    description: ""
                    type: boolean
                  edited:
                    description: ""
                    type: boolean
                  external-identifier:
                    description: ""
                    type: string
                  global-request-id:
                    description: ""
                    type: string
                  gtc-date:
                    description: ""
                    type: string
                    format: date
                  in-flight-at:
                    description: ""
                    type: string
                    format: date-time
                  liquidity-pool-instrument-type:
                    description: ""
                    type: string
                  live-at:
                    description: ""
                    type: string
                    format: date-time
                  max-value-per-liquidity-allocation-fill:
                    description: ""
                    type: string
                  order-type:
                    description: ""
                    type: string
                  preflight-id:
                    description: ""
                    type: string
                  price:
                    description: Decimal value serialized as a JSON string (e.g. "150.25").
                    type: string
                    format: decimal
                  price-effect:
                    description: ""
                    type: string
                  received-at:
                    description: ""
                    type: string
                    format: date-time
                  reject-reason:
                    description: ""
                    type: string
                  replaces-order-id:
                    description: ""
                    type: string
                  replacing-order-id:
                    description: ""
                    type: string
                  size:
                    description: ""
                    type: string
                  source:
                    description: ""
                    type: string
                  status:
                    description: ""
                    type: string
                  stop-trigger:
                    description: ""
                    type: string
                  terminal-at:
                    description: ""
                    type: string
                    format: date-time
                  time-in-force:
                    description: ""
                    type: string
                  underlying-instrument-type:
                    description: ""
                    type: string
                  underlying-symbol:
                    description: ""
                    type: string
                  updated-at:
                    description: ""
                    type: string
                  user-id:
                    description: ""
                    type: string
                  username:
                    description: ""
                    type: string
                  value:
                    description: Decimal value serialized as a JSON string (e.g. "150.25").
                    type: string
                    format: decimal
                  value-effect:
                    description: ""
                    type: string
                  legs:
                    type: array
                    items:
                      type: object
                      properties:
                        action:
                          description: ""
                          type: string
                        instrument-type:
                          description: ""
                          type: string
                        quantity:
                          description: ""
                          type: string
                        remaining-quantity:
                          description: ""
                          type: string
                        symbol:
                          description: ""
                          type: string
                        fills:
                          type: array
                          items:
                            type: object
                            properties:
                              destination-venue:
                                description: ""
                                type: string
                              ext-exec-id:
                                description: ""
                                type: string
                              ext-group-fill-id:
                                description: ""
                                type: string
                              fill-id:
                                description: ""
                                type: string
                              fill-price:
                                description: Decimal value serialized as a JSON string (e.g. "150.25").
                                type: string
                                format: decimal
                              filled-at:
                                description: ""
                                type: string
                                format: date-time
                              quantity:
                                description: ""
                                type: string
                            description: ""
                      description: ""
                  order-rule:
                    type: object
                    properties:
                      cancel-at:
                        description: ""
                        type: string
                        format: date-time
                      cancelled-at:
                        description: ""
                        type: string
                        format: date-time
                      route-after:
                        description: ""
                        type: string
                        format: date-time
                      routed-at:
                        description: ""
                        type: string
                        format: date-time
                      order-conditions:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              description: ""
                              type: string
                            action:
                              description: ""
                              type: string
                            comparator:
                              description: ""
                              type: string
                            indicator:
                              description: ""
                              type: string
                            instrument-type:
                              description: ""
                              type: string
                            is-threshold-based-on-notional:
                              description: ""
                              type: boolean
                            symbol:
                              description: ""
                              type: string
                            threshold:
                              description: Decimal value serialized as a JSON string (e.g. "150.25").
                              type: string
                              format: decimal
                            triggered-at:
                              description: ""
                              type: string
                              format: date-time
                            triggered-value:
                              description: Decimal value serialized as a JSON string (e.g. "150.25").
                              type: string
                              format: decimal
                            price-components:
                              type: array
                              items:
                                type: object
                                properties:
                                  instrument-type:
                                    description: ""
                                    type: string
                                  quantity:
                                    description: ""
                                    type: string
                                  quantity-direction:
                                    description: ""
                                    type: string
                                  symbol:
                                    description: ""
                                    type: string
                                description: ""
                          description: ""
                    description: ""
                description: "Orders with complex-order-tag: '<type>::order'. For example,
                  'OTO::order' for OTO complex orders."
            trigger-order:
              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
                complex-order-id:
                  description: ""
                  type: string
                complex-order-tag:
                  description: ""
                  type: string
                confirmation-status:
                  description: ""
                  type: string
                contingent-status:
                  description: ""
                  type: string
                editable:
                  description: ""
                  type: boolean
                edited:
                  description: ""
                  type: boolean
                external-identifier:
                  description: ""
                  type: string
                global-request-id:
                  description: ""
                  type: string
                gtc-date:
                  description: ""
                  type: string
                  format: date
                in-flight-at:
                  description: ""
                  type: string
                  format: date-time
                liquidity-pool-instrument-type:
                  description: ""
                  type: string
                live-at:
                  description: ""
                  type: string
                  format: date-time
                max-value-per-liquidity-allocation-fill:
                  description: ""
                  type: string
                order-type:
                  description: ""
                  type: string
                preflight-id:
                  description: ""
                  type: string
                price:
                  description: Decimal value serialized as a JSON string (e.g. "150.25").
                  type: string
                  format: decimal
                price-effect:
                  description: ""
                  type: string
                received-at:
                  description: ""
                  type: string
                  format: date-time
                reject-reason:
                  description: ""
                  type: string
                replaces-order-id:
                  description: ""
                  type: string
                replacing-order-id:
                  description: ""
                  type: string
                size:
                  description: ""
                  type: string
                source:
                  description: ""
                  type: string
                status:
                  description: ""
                  type: string
                stop-trigger:
                  description: ""
                  type: string
                terminal-at:
                  description: ""
                  type: string
                  format: date-time
                time-in-force:
                  description: ""
                  type: string
                underlying-instrument-type:
                  description: ""
                  type: string
                underlying-symbol:
                  description: ""
                  type: string
                updated-at:
                  description: ""
                  type: string
                user-id:
                  description: ""
                  type: string
                username:
                  description: ""
                  type: string
                value:
                  description: Decimal value serialized as a JSON string (e.g. "150.25").
                  type: string
                  format: decimal
                value-effect:
                  description: ""
                  type: string
                legs:
                  type: array
                  items:
                    type: object
                    properties:
                      action:
                        description: ""
                        type: string
                      instrument-type:
                        description: ""
                        type: string
                      quantity:
                        description: ""
                        type: string
                      remaining-quantity:
                        description: ""
                        type: string
                      symbol:
                        description: ""
                        type: string
                      fills:
                        type: array
                        items:
                          type: object
                          properties:
                            destination-venue:
                              description: ""
                              type: string
                            ext-exec-id:
                              description: ""
                              type: string
                            ext-group-fill-id:
                              description: ""
                              type: string
                            fill-id:
                              description: ""
                              type: string
                            fill-price:
                              description: Decimal value serialized as a JSON string (e.g. "150.25").
                              type: string
                              format: decimal
                            filled-at:
                              description: ""
                              type: string
                              format: date-time
                            quantity:
                              description: ""
                              type: string
                          description: ""
                    description: ""
                order-rule:
                  type: object
                  properties:
                    cancel-at:
                      description: ""
                      type: string
                      format: date-time
                    cancelled-at:
                      description: ""
                      type: string
                      format: date-time
                    route-after:
                      description: ""
                      type: string
                      format: date-time
                    routed-at:
                      description: ""
                      type: string
                      format: date-time
                    order-conditions:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            description: ""
                            type: string
                          action:
                            description: ""
                            type: string
                          comparator:
                            description: ""
                            type: string
                          indicator:
                            description: ""
                            type: string
                          instrument-type:
                            description: ""
                            type: string
                          is-threshold-based-on-notional:
                            description: ""
                            type: boolean
                          symbol:
                            description: ""
                            type: string
                          threshold:
                            description: Decimal value serialized as a JSON string (e.g. "150.25").
                            type: string
                            format: decimal
                          triggered-at:
                            description: ""
                            type: string
                            format: date-time
                          triggered-value:
                            description: Decimal value serialized as a JSON string (e.g. "150.25").
                            type: string
                            format: decimal
                          price-components:
                            type: array
                            items:
                              type: object
                              properties:
                                instrument-type:
                                  description: ""
                                  type: string
                                quantity:
                                  description: ""
                                  type: string
                                quantity-direction:
                                  description: ""
                                  type: string
                                symbol:
                                  description: ""
                                  type: string
                              description: ""
                        description: ""
                  description: ""
              description: "Order with complex-order-tag: '<type>::trigger-order'. For
                example, 'OTO::trigger-order for OTO complex orders."
          description: ""
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                description: ""
                type: string
              message:
                description: ""
                type: string
              preflight-id:
                description: ""
                type: string
            description: ""
          description: Preflight errors explaining why the order failed validation, each
            with a `code`, `message`, and `preflight-id`.
        fee-calculation:
          description: An estimate of the fees the order would incur if filled, broken
            into regulatory, clearing, commission, and other categories and
            totaled at the end. A JSON object (upstream types this field as a
            string; attested responses return this object, with decimal values
            serialized as JSON strings).
          type: object
          properties:
            regulatory-fees:
              type: string
              format: decimal
              example: "0.102"
            regulatory-fees-effect:
              type: string
              example: Debit
            clearing-fees:
              type: string
              format: decimal
              example: "0.2"
            clearing-fees-effect:
              type: string
              example: Debit
            commission:
              type: string
              format: decimal
              example: "2.0"
            commission-effect:
              type: string
              example: Debit
            proprietary-index-option-fees:
              type: string
              format: decimal
              example: "0.0"
            proprietary-index-option-fees-effect:
              type: string
              example: Debit
            total-fees:
              type: string
              format: decimal
              example: "2.302"
            total-fees-effect:
              type: string
              example: Debit
        notes:
          type: array
          items:
            type: object
            properties:
              code:
                description: ""
                type: string
              message:
                description: ""
                type: string
              preflight-id:
                description: ""
                type: string
              url:
                description: ""
                type: string
            description: ""
          description: Informational notes about the order, each optionally including a
            `url` for more detail.
        order:
          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
            complex-order-id:
              description: ""
              type: string
            complex-order-tag:
              description: ""
              type: string
            confirmation-status:
              description: ""
              type: string
            contingent-status:
              description: ""
              type: string
            editable:
              description: ""
              type: boolean
            edited:
              description: ""
              type: boolean
            external-identifier:
              description: ""
              type: string
            global-request-id:
              description: ""
              type: string
            gtc-date:
              description: ""
              type: string
              format: date
            in-flight-at:
              description: ""
              type: string
              format: date-time
            liquidity-pool-instrument-type:
              description: ""
              type: string
            live-at:
              description: ""
              type: string
              format: date-time
            max-value-per-liquidity-allocation-fill:
              description: ""
              type: string
            order-type:
              description: ""
              type: string
            preflight-id:
              description: ""
              type: string
            price:
              description: Decimal value serialized as a JSON string (e.g. "150.25").
              type: string
              format: decimal
            price-effect:
              description: ""
              type: string
            received-at:
              description: ""
              type: string
              format: date-time
            reject-reason:
              description: ""
              type: string
            replaces-order-id:
              description: ""
              type: string
            replacing-order-id:
              description: ""
              type: string
            size:
              description: ""
              type: string
            source:
              description: ""
              type: string
            status:
              description: ""
              type: string
            stop-trigger:
              description: ""
              type: string
            terminal-at:
              description: ""
              type: string
              format: date-time
            time-in-force:
              description: ""
              type: string
            underlying-instrument-type:
              description: ""
              type: string
            underlying-symbol:
              description: ""
              type: string
            updated-at:
              description: ""
              type: string
            user-id:
              description: ""
              type: string
            username:
              description: ""
              type: string
            value:
              description: Decimal value serialized as a JSON string (e.g. "150.25").
              type: string
              format: decimal
            value-effect:
              description: ""
              type: string
            legs:
              type: array
              items:
                type: object
                properties:
                  action:
                    description: ""
                    type: string
                  instrument-type:
                    description: ""
                    type: string
                  quantity:
                    description: ""
                    type: string
                  remaining-quantity:
                    description: ""
                    type: string
                  symbol:
                    description: ""
                    type: string
                  fills:
                    type: array
                    items:
                      type: object
                      properties:
                        destination-venue:
                          description: ""
                          type: string
                        ext-exec-id:
                          description: ""
                          type: string
                        ext-group-fill-id:
                          description: ""
                          type: string
                        fill-id:
                          description: ""
                          type: string
                        fill-price:
                          description: Decimal value serialized as a JSON string (e.g. "150.25").
                          type: string
                          format: decimal
                        filled-at:
                          description: ""
                          type: string
                          format: date-time
                        quantity:
                          description: ""
                          type: string
                      description: ""
                description: ""
            order-rule:
              type: object
              properties:
                cancel-at:
                  description: ""
                  type: string
                  format: date-time
                cancelled-at:
                  description: ""
                  type: string
                  format: date-time
                route-after:
                  description: ""
                  type: string
                  format: date-time
                routed-at:
                  description: ""
                  type: string
                  format: date-time
                order-conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        description: ""
                        type: string
                      action:
                        description: ""
                        type: string
                      comparator:
                        description: ""
                        type: string
                      indicator:
                        description: ""
                        type: string
                      instrument-type:
                        description: ""
                        type: string
                      is-threshold-based-on-notional:
                        description: ""
                        type: boolean
                      symbol:
                        description: ""
                        type: string
                      threshold:
                        description: Decimal value serialized as a JSON string (e.g. "150.25").
                        type: string
                        format: decimal
                      triggered-at:
                        description: ""
                        type: string
                        format: date-time
                      triggered-value:
                        description: Decimal value serialized as a JSON string (e.g. "150.25").
                        type: string
                        format: decimal
                      price-components:
                        type: array
                        items:
                          type: object
                          properties:
                            instrument-type:
                              description: ""
                              type: string
                            quantity:
                              description: ""
                              type: string
                            quantity-direction:
                              description: ""
                              type: string
                            symbol:
                              description: ""
                              type: string
                          description: ""
                    description: ""
              description: ""
          description: ""
        warnings:
          type: array
          items:
            type: object
            properties:
              code:
                description: ""
                type: string
              message:
                description: ""
                type: string
              preflight-id:
                description: ""
                type: string
            description: ""
          description: Informational warnings produced by a dry-run or submission. A
            warning may indicate the order would be rejected if routed, or that
            the market is closed.
      description: The response returned when placing, editing, or dry-running an
        order or complex order. Contains the resulting `order` (or
        `complex-order`), the `buying-power-effect`, the `fee-calculation`, and
        any `warnings`, `errors`, or `notes` produced by the preflight checks.
    postAccountsAccountNumberComplexOrdersDryRun:
      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.
                                                      `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
                enum:
                  - Limit
                  - Liquidity Allocation
                  - Market
                  - Marketable Limit
                  - Notional Market
                  - Stop
                  - Stop Limit
              time-in-force:
                type: string
                description: >-
                  The length in time before the order expires. i.e.
                                                         `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
              stop-trigger:
                type: string
                format: decimal
                description: The price trigger at which a stop or stop-limit order becomes
                  valid. Decimal value serialized as a JSON string (e.g.
                  "150.25").
              price:
                type: string
                format: decimal
                description: The price of the Order. Required for limit and stop-limit orders.
                  Decimal value serialized as a JSON string (e.g. "150.25").
              price-effect:
                type: string
                description: If pay or receive payment for placing the order. i.e. `Credit` or
                  `Debit`
                enum:
                  - Credit
                  - Debit
              value:
                type: string
                format: decimal
                description: The notional value of the Order, required for notional market
                  orders. Decimal value serialized as a JSON string (e.g.
                  "150.25").
              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
              max-value-per-liquidity-allocation-fill:
                type: string
                format: decimal
                description: Max value per liquidity allocation fill Decimal value serialized as
                  a JSON string (e.g. "150.25").
              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.
                                                          `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.
                                                          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.
                                                                   `Cryptocurrency`, `Equity`, `Equity Offering`, `Equity Option`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`
                      enum:
                        - Cryptocurrency
                        - Equity
                        - Equity Offering
                        - Equity Option
                        - Fixed Income Security
                        - Future
                        - Future Option
                        - Liquidity Pool
                    quantity:
                      type: string
                      format: decimal
                      description: The size of the contract. Required for all orders but notional
                        market. Decimal value serialized as a JSON string (e.g.
                        "150.25").
                    symbol:
                      type: string
                      description: >-
                        The Stock Ticker Symbol `AAPL`, OCC Option Symbol
                        `AAPL  191004P00275000`, \
                                                            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.
                                                                `cancel` and `route`
                          enum:
                            - cancel
                            - route
                        instrument-type:
                          type: string
                          description: >-
                            The instrument's type in relation to the condition.
                            i.e. \
                                                                          `Equity` or `Future`
                          enum:
                            - Equity
                            - Future
                        symbol:
                          type: string
                          description: >-
                            The symbol to apply the condition to. \
                                                                  i.e. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`
                        comparator:
                          type: string
                          description: >-
                            How to compare against the threshold. \
                                                                    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: string
                          format: decimal
                          description: The price at which the condition triggers. Decimal value serialized
                            as a JSON string (e.g. "150.25").
                        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
                                  - Fixed Income Security
                                  - Future
                                  - Future Option
                                  - Index
                                  - Liquidity Pool
                                  - Unknown
                                  - Warrant
                              quantity:
                                type: string
                                format: decimal
                                description: The Ratio quantity in relation to the symbol Decimal value
                                  serialized as a JSON string (e.g. "150.25").
                              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. \
                                                                        i.e. 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
              - time-in-force
              - stop-trigger
              - 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.
                                                    `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
              enum:
                - Limit
                - Liquidity Allocation
                - Market
                - Marketable Limit
                - Notional Market
                - Stop
                - Stop Limit
            time-in-force:
              type: string
              description: >-
                The length in time before the order expires. i.e.
                                                       `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
            stop-trigger:
              type: string
              format: decimal
              description: The price trigger at which a stop or stop-limit order becomes
                valid. Decimal value serialized as a JSON string (e.g.
                "150.25").
            price:
              type: string
              format: decimal
              description: The price of the Order. Required for limit and stop-limit orders.
                Decimal value serialized as a JSON string (e.g. "150.25").
            price-effect:
              type: string
              description: If pay or receive payment for placing the order. i.e. `Credit` or
                `Debit`
              enum:
                - Credit
                - Debit
            value:
              type: string
              format: decimal
              description: The notional value of the Order, required for notional market
                orders. Decimal value serialized as a JSON string (e.g.
                "150.25").
            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
            max-value-per-liquidity-allocation-fill:
              type: string
              format: decimal
              description: Max value per liquidity allocation fill Decimal value serialized as
                a JSON string (e.g. "150.25").
            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.
                                                        `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.
                                                        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.
                                                                 `Cryptocurrency`, `Equity`, `Equity Offering`, `Equity Option`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`
                    enum:
                      - Cryptocurrency
                      - Equity
                      - Equity Offering
                      - Equity Option
                      - Fixed Income Security
                      - Future
                      - Future Option
                      - Liquidity Pool
                  quantity:
                    type: string
                    format: decimal
                    description: The size of the contract. Required for all orders but notional
                      market. Decimal value serialized as a JSON string (e.g.
                      "150.25").
                  symbol:
                    type: string
                    description: >-
                      The Stock Ticker Symbol `AAPL`, OCC Option Symbol
                      `AAPL  191004P00275000`, \
                                                          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.
                                                              `cancel` and `route`
                        enum:
                          - cancel
                          - route
                      instrument-type:
                        type: string
                        description: >-
                          The instrument's type in relation to the condition.
                          i.e. \
                                                                        `Equity` or `Future`
                        enum:
                          - Equity
                          - Future
                      symbol:
                        type: string
                        description: >-
                          The symbol to apply the condition to. \
                                                                i.e. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`
                      comparator:
                        type: string
                        description: >-
                          How to compare against the threshold. \
                                                                  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: string
                        format: decimal
                        description: The price at which the condition triggers. Decimal value serialized
                          as a JSON string (e.g. "150.25").
                      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
                                - Fixed Income Security
                                - Future
                                - Future Option
                                - Index
                                - Liquidity Pool
                                - Unknown
                                - Warrant
                            quantity:
                              type: string
                              format: decimal
                              description: The Ratio quantity in relation to the symbol Decimal value
                                serialized as a JSON string (e.g. "150.25").
                            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. \
                                                                      i.e. 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
            - time-in-force
            - stop-trigger
            - price-effect
            - value-effect
            - legs
        type:
          type: string
          description: >-
            The type of stragegy for the complex order i.e.
                                          `BLAST`, `OCO`, `OTO`, `OTOCO` or `PAIRS`
          enum:
            - BLAST
            - OCO
            - OTO
            - OTOCO
            - PAIRS
          example: OCO
        ratio-price-comparator:
          type: string
          description: >-
            How to compare against the ratio price. \
                                                        Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)
          enum:
            - gte
            - lte
          example: gte
        ratio-price-is-threshold-based-on-notional:
          type: boolean
          description: If comparison is in notional value instead of price.
        ratio-price-threshold:
          type: string
          format: decimal
          description: Ratio price for a PAIRS trade Decimal value serialized as a JSON
            string (e.g. "150.25").
          example: "1.5"
        source:
          type: string
          description: The source the order is coming from
      required:
        - type
        - orders
      description: Request body for dry-running a complex (bracket) order. Identical
        in shape to the complex order submission body; validated and priced but
        not routed. `ratio-price-comparator` and `ratio-price-threshold` apply
        to PAIRS trades only (upstream marks them always-required; attested
        OTO/OCO/OTOCO bodies contain neither).
    patchAccountsAccountNumberComplexOrdersId:
      type: object
      properties:
        ratio-price-comparator:
          type: string
          description: >-
            How to compare against the ratio price. \
                                                                  Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)
          enum:
            - gte
            - lte
          example: lte
        ratio-price-threshold:
          type: string
          format: decimal
          description: Ratio price for a PAIRS trade Decimal value serialized as a JSON
            string (e.g. "150.25").
          example: "1.25"
      description: Request body for editing a PAIRS complex order. Updates the
        ratio-price threshold and its comparator.
    postAccountsAccountNumberComplexOrdersIdDryRun:
      type: object
      properties:
        ratio-price-comparator:
          type: string
          description: >-
            How to compare against the ratio price. \
                                                                  Supports `gte` (Greater than or Equal To) or `lte` (Less than or Equal to)
          enum:
            - gte
            - lte
          example: lte
        ratio-price-threshold:
          type: string
          format: decimal
          description: Ratio price for a PAIRS trade Decimal value serialized as a JSON
            string (e.g. "150.25").
          example: "1.25"
      description: Request body for dry-running an edit to a PAIRS complex order.
        Validates the new ratio-price threshold without routing the edit.
    postAccountsAccountNumberOrders:
      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.
          example: 2025-12-01
        order-type:
          type: string
          description: >-
            The type of order in regards to the price. i.e.
                                                `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
          enum:
            - Limit
            - Liquidity Allocation
            - Market
            - Marketable Limit
            - Notional Market
            - Stop
            - Stop Limit
          example: Limit
        time-in-force:
          type: string
          description: >-
            The length in time before the order expires. i.e.
                                                   `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
          example: Day
        stop-trigger:
          type: string
          format: decimal
          description: The price trigger at which a stop or stop-limit order becomes
            valid. Decimal value serialized as a JSON string (e.g. "150.25").
          example: "145.0"
        price:
          type: string
          format: decimal
          description: The price of the Order. Required for limit and stop-limit orders.
            Decimal value serialized as a JSON string (e.g. "150.25").
          example: "150.25"
        price-effect:
          type: string
          description: If pay or receive payment for placing the order. i.e. `Credit` or
            `Debit`
          enum:
            - Credit
            - Debit
          example: Debit
        value:
          type: string
          format: decimal
          description: The notional value of the Order, required for notional market
            orders. Decimal value serialized as a JSON string (e.g. "150.25").
          example: "10.0"
        value-effect:
          type: string
          description: If pay or receive payment for placing the notional market order.
            i.e. `Credit` or `Debit`
          enum:
            - Credit
            - Debit
          example: 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
        max-value-per-liquidity-allocation-fill:
          type: string
          format: decimal
          description: Max value per liquidity allocation fill Decimal value serialized as
            a JSON string (e.g. "150.25").
        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
          example: my-api-code
        legs:
          type: array
          items:
            type: object
            properties:
              action:
                type: string
                description: >-
                  The directional action of the leg. i.e.
                                                    `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.
                                                    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.
                                                             `Cryptocurrency`, `Equity`, `Equity Offering`, `Equity Option`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`
                enum:
                  - Cryptocurrency
                  - Equity
                  - Equity Offering
                  - Equity Option
                  - Fixed Income Security
                  - Future
                  - Future Option
                  - Liquidity Pool
              quantity:
                type: string
                format: decimal
                description: The size of the contract. Required for all orders but notional
                  market. Decimal value serialized as a JSON string (e.g.
                  "150.25").
              symbol:
                type: string
                description: >-
                  The Stock Ticker Symbol `AAPL`, OCC Option Symbol
                  `AAPL  191004P00275000`, \
                                                      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.
                                                          `cancel` and `route`
                    enum:
                      - cancel
                      - route
                  instrument-type:
                    type: string
                    description: >-
                      The instrument's type in relation to the condition. i.e. \
                                                                    `Equity` or `Future`
                    enum:
                      - Equity
                      - Future
                  symbol:
                    type: string
                    description: >-
                      The symbol to apply the condition to. \
                                                            i.e. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`
                  comparator:
                    type: string
                    description: >-
                      How to compare against the threshold. \
                                                              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: string
                    format: decimal
                    description: The price at which the condition triggers. Decimal value serialized
                      as a JSON string (e.g. "150.25").
                  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
                            - Fixed Income Security
                            - Future
                            - Future Option
                            - Index
                            - Liquidity Pool
                            - Unknown
                            - Warrant
                        quantity:
                          type: string
                          format: decimal
                          description: The Ratio quantity in relation to the symbol Decimal value
                            serialized as a JSON string (e.g. "150.25").
                        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. \
                                                                  i.e. 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
        - time-in-force
        - legs
      description: "Request body for submitting an order. Must include `order-type`,
        `time-in-force`, and at least one leg. `price` and `price-effect` are
        required for Limit and Stop Limit orders; `stop-trigger` for Stop and
        Stop Limit orders; and `value` and `value-effect` for Notional Market
        orders. Conditionally required fields (upstream marks them
        always-required; the attested behavior differs): `price` +
        `price-effect` are required for Limit and Stop Limit orders and MUST be
        omitted on Market orders; `stop-trigger` only for Stop / Stop Limit
        orders; `value` + `value-effect` only for Notional Market orders.
        Including a price on a Market order gets the order rejected."
    postAccountsAccountNumberOrdersDryRun:
      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.
                                                `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
          enum:
            - Limit
            - Liquidity Allocation
            - Market
            - Marketable Limit
            - Notional Market
            - Stop
            - Stop Limit
          example: Limit
        time-in-force:
          type: string
          description: >-
            The length in time before the order expires. i.e.
                                                   `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
          example: Day
        stop-trigger:
          type: string
          format: decimal
          description: The price trigger at which a stop or stop-limit order becomes
            valid. Decimal value serialized as a JSON string (e.g. "150.25").
        price:
          type: string
          format: decimal
          description: The price of the Order. Required for limit and stop-limit orders.
            Decimal value serialized as a JSON string (e.g. "150.25").
          example: "150.25"
        price-effect:
          type: string
          description: If pay or receive payment for placing the order. i.e. `Credit` or
            `Debit`
          enum:
            - Credit
            - Debit
          example: Debit
        value:
          type: string
          format: decimal
          description: The notional value of the Order, required for notional market
            orders. Decimal value serialized as a JSON string (e.g. "150.25").
        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
        max-value-per-liquidity-allocation-fill:
          type: string
          format: decimal
          description: Max value per liquidity allocation fill Decimal value serialized as
            a JSON string (e.g. "150.25").
        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.
                                                    `Allocate`, `Buy`, `Buy to Close`, `Buy to Open`, `Sell`, `Sell to Close` or `Sell to Open`.
                                                    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.
                                                             `Cryptocurrency`, `Equity`, `Equity Offering`, `Equity Option`, `Fixed Income Security`, `Future`, `Future Option` or `Liquidity Pool`
                enum:
                  - Cryptocurrency
                  - Equity
                  - Equity Offering
                  - Equity Option
                  - Fixed Income Security
                  - Future
                  - Future Option
                  - Liquidity Pool
              quantity:
                type: string
                format: decimal
                description: The size of the contract. Required for all orders but notional
                  market. Decimal value serialized as a JSON string (e.g.
                  "150.25").
              symbol:
                type: string
                description: >-
                  The Stock Ticker Symbol `AAPL`, OCC Option Symbol
                  `AAPL  191004P00275000`, \
                                                      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.
                                                          `cancel` and `route`
                    enum:
                      - cancel
                      - route
                  instrument-type:
                    type: string
                    description: >-
                      The instrument's type in relation to the condition. i.e. \
                                                                    `Equity` or `Future`
                    enum:
                      - Equity
                      - Future
                  symbol:
                    type: string
                    description: >-
                      The symbol to apply the condition to. \
                                                            i.e. Stock Ticker Symbol `AAPL` or the TW Future Symbol `/ESZ9`
                  comparator:
                    type: string
                    description: >-
                      How to compare against the threshold. \
                                                              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: string
                    format: decimal
                    description: The price at which the condition triggers. Decimal value serialized
                      as a JSON string (e.g. "150.25").
                  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
                            - Fixed Income Security
                            - Future
                            - Future Option
                            - Index
                            - Liquidity Pool
                            - Unknown
                            - Warrant
                        quantity:
                          type: string
                          format: decimal
                          description: The Ratio quantity in relation to the symbol Decimal value
                            serialized as a JSON string (e.g. "150.25").
                        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. \
                                                                  i.e. 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
        - time-in-force
        - legs
      description: "Request body for dry-running an order. Identical in shape to the
        order submission body; the order is validated and priced but not routed.
        Conditionally required fields (upstream marks them always-required; the
        attested behavior differs): `price` + `price-effect` are required for
        Limit and Stop Limit orders and MUST be omitted on Market orders;
        `stop-trigger` only for Stop / Stop Limit orders; `value` +
        `value-effect` only for Notional Market orders. Including a price on a
        Market order gets the order rejected."
    Order:
      type: object
      properties:
        id:
          description: The unique identifier of the order. Use it to fetch, replace, or
            cancel the order.
          type: string
          example: "771043"
        account-number:
          description: The account number the order belongs to.
          type: string
          example: 5WX01234
        cancel-user-id:
          description: ""
          type: string
        cancel-username:
          description: ""
          type: string
        cancellable:
          description: Whether the order can currently be cancelled. True while the order
            is in a working status, false once it is terminal or a cancel has
            been requested.
          type: boolean
          example: true
        cancelled-at:
          description: Timestamp when the order was cancelled, if applicable.
          type: string
          format: date-time
          example: 2024-07-31T16:50:23.417+00:00
        complex-order-id:
          description: The id of the parent complex order, if this order is a component of
            one.
          type: string
          example: "2000010530"
        complex-order-tag:
          description: The role of this order within its complex order, for example
            `OTOCO::trigger-order` or `OCO::order`.
          type: string
          example: OTOCO::order
        confirmation-status:
          description: ""
          type: string
        contingent-status:
          description: The contingency state of a complex-order component awaiting its
            trigger, for example `Pending Order`.
          type: string
          example: Pending Order
        editable:
          description: Whether the order can currently be edited or replaced.
          type: boolean
          example: true
        edited:
          description: Whether this order is the result of an edit/replacement of a prior
            order.
          type: boolean
          example: false
        external-identifier:
          description: ""
          type: string
        global-request-id:
          description: ""
          type: string
        gtc-date:
          description: ""
          type: string
          format: date
        in-flight-at:
          description: ""
          type: string
          format: date-time
        liquidity-pool-instrument-type:
          description: ""
          type: string
        live-at:
          description: ""
          type: string
          format: date-time
        max-value-per-liquidity-allocation-fill:
          description: ""
          type: string
        order-type:
          description: "The order type with respect to pricing: `Limit`, `Market`, `Stop`,
            `Stop Limit`, `Notional Market`, `Marketable Limit`, or `Liquidity
            Allocation`."
          type: string
          example: Limit
        preflight-id:
          description: ""
          type: string
        price:
          description: The limit price of the order, applicable to Limit and Stop Limit
            orders. Serialized as a JSON string decimal. Decimal value
            serialized as a JSON string (e.g. "150.25").
          type: string
          format: decimal
          example: "150.25"
        price-effect:
          description: "The direction of the price relative to the account: `Debit`
            (paying) or `Credit` (receiving)."
          type: string
          example: Debit
        received-at:
          description: Timestamp when tastytrade received the order.
          type: string
          format: date-time
          example: 2024-10-01T18:26:52.513+00:00
        reject-reason:
          description: The reason the order was rejected, if its status is `Rejected`.
          type: string
          example: You cannot buy for a credit.
        replaces-order-id:
          description: The id of the order that this order replaces, for cancel-replace
            orders.
          type: string
          example: "771043"
        replacing-order-id:
          description: The id of the order that is replacing this order, for orders being
            cancel-replaced.
          type: string
          example: "771044"
        size:
          description: The total quantity of the order across its legs, as a string.
          type: string
          example: "1"
        source:
          description: ""
          type: string
        status:
          description: The current order status, for example `Received`, `Routed`, `Live`,
            `Cancel Requested`, `Filled`, `Cancelled`, `Expired`, or `Rejected`.
          type: string
          example: Live
        stop-trigger:
          description: The trigger price at which a Stop or Stop Limit order activates, as
            a string.
          type: string
          example: "150.0"
        terminal-at:
          description: Timestamp when the order reached a terminal status.
          type: string
          format: date-time
          example: 2024-07-31T16:50:23.417+00:00
        time-in-force:
          description: "How long the order remains working before it expires: `Day`,
            `GTC`, `GTD`, `Ext`, `IOC`, and related values."
          type: string
          example: Day
        underlying-instrument-type:
          description: The instrument type of the underlying, for example `Equity` or
            `Future`.
          type: string
          example: Equity
        underlying-symbol:
          description: The underlying symbol the order trades, for example `AAPL`.
          type: string
          example: AAPL
        updated-at:
          description: ""
          type: string
        user-id:
          description: ""
          type: string
        username:
          description: ""
          type: string
        value:
          description: The notional dollar value of the order, applicable to Notional
            Market orders. Serialized as a JSON string decimal. Decimal value
            serialized as a JSON string (e.g. "150.25").
          type: string
          format: decimal
          example: "10.0"
        value-effect:
          description: "The direction of the notional value relative to the account:
            `Debit` or `Credit`."
          type: string
          example: Debit
        legs:
          type: array
          items:
            type: object
            properties:
              action:
                description: ""
                type: string
              instrument-type:
                description: ""
                type: string
              quantity:
                description: ""
                type: string
              remaining-quantity:
                description: ""
                type: string
              symbol:
                description: ""
                type: string
              fills:
                type: array
                items:
                  type: object
                  properties:
                    destination-venue:
                      description: ""
                      type: string
                    ext-exec-id:
                      description: ""
                      type: string
                    ext-group-fill-id:
                      description: ""
                      type: string
                    fill-id:
                      description: ""
                      type: string
                    fill-price:
                      description: Decimal value serialized as a JSON string (e.g. "150.25").
                      type: string
                      format: decimal
                    filled-at:
                      description: ""
                      type: string
                      format: date-time
                    quantity:
                      description: ""
                      type: string
                  description: ""
            description: ""
        order-rule:
          type: object
          properties:
            cancel-at:
              description: ""
              type: string
              format: date-time
            cancelled-at:
              description: ""
              type: string
              format: date-time
            route-after:
              description: ""
              type: string
              format: date-time
            routed-at:
              description: ""
              type: string
              format: date-time
            order-conditions:
              type: array
              items:
                type: object
                properties:
                  id:
                    description: ""
                    type: string
                  action:
                    description: ""
                    type: string
                  comparator:
                    description: ""
                    type: string
                  indicator:
                    description: ""
                    type: string
                  instrument-type:
                    description: ""
                    type: string
                  is-threshold-based-on-notional:
                    description: ""
                    type: boolean
                  symbol:
                    description: ""
                    type: string
                  threshold:
                    description: Decimal value serialized as a JSON string (e.g. "150.25").
                    type: string
                    format: decimal
                  triggered-at:
                    description: ""
                    type: string
                    format: date-time
                  triggered-value:
                    description: Decimal value serialized as a JSON string (e.g. "150.25").
                    type: string
                    format: decimal
                  price-components:
                    type: array
                    items:
                      type: object
                      properties:
                        instrument-type:
                          description: ""
                          type: string
                        quantity:
                          description: ""
                          type: string
                        quantity-direction:
                          description: ""
                          type: string
                        symbol:
                          description: ""
                          type: string
                      description: ""
                description: ""
          description: ""
      description: A single order in the tastytrade system. Submission-time fields
        such as `order-type`, `time-in-force`, `price`, and `legs` describe the
        order, while post-submission fields such as `status`, `cancellable`,
        `editable`, and `legs.fills` track its progress through the submission,
        working, and terminal phases.
    patchAccountsAccountNumberOrdersId:
      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.
                                                `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
          enum:
            - Limit
            - Liquidity Allocation
            - Market
            - Marketable Limit
            - Notional Market
            - Stop
            - Stop Limit
          example: Limit
        time-in-force:
          type: string
          description: >-
            The length in time before the order expires. i.e.
                                                   `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
          example: Day
        stop-trigger:
          type: string
          format: decimal
          description: The price trigger at which a stop or stop-limit order becomes
            valid. Decimal value serialized as a JSON string (e.g. "150.25").
        price:
          type: string
          format: decimal
          description: The price of the Order. Required for limit and stop-limit orders.
            Decimal value serialized as a JSON string (e.g. "150.25").
          example: "151.0"
        price-effect:
          type: string
          description: If pay or receive payment for placing the order. i.e. `Credit` or
            `Debit`
          enum:
            - Credit
            - Debit
          example: Debit
        value:
          type: string
          format: decimal
          description: The notional value of the Order, required for notional market
            orders. Decimal value serialized as a JSON string (e.g. "150.25").
        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
        max-value-per-liquidity-allocation-fill:
          type: string
          format: decimal
          description: Max value per liquidity allocation fill Decimal value serialized as
            a JSON string (e.g. "150.25").
        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
      required:
        - order-type
        - time-in-force
      description: "Request body for editing a live order's price and execution
        properties by replacement. Only `price`, `order-type`, and
        `time-in-force` may change. Conditionally required fields (upstream
        marks them always-required; the attested behavior differs): `price` +
        `price-effect` are required for Limit and Stop Limit orders and MUST be
        omitted on Market orders; `stop-trigger` only for Stop / Stop Limit
        orders; `value` + `value-effect` only for Notional Market orders.
        Including a price on a Market order gets the order rejected."
    putAccountsAccountNumberOrdersId:
      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.
                                                `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
          enum:
            - Limit
            - Liquidity Allocation
            - Market
            - Marketable Limit
            - Notional Market
            - Stop
            - Stop Limit
          example: Limit
        time-in-force:
          type: string
          description: >-
            The length in time before the order expires. i.e.
                                                   `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
          example: Day
        stop-trigger:
          type: string
          format: decimal
          description: The price trigger at which a stop or stop-limit order becomes
            valid. Decimal value serialized as a JSON string (e.g. "150.25").
        price:
          type: string
          format: decimal
          description: The price of the Order. Required for limit and stop-limit orders.
            Decimal value serialized as a JSON string (e.g. "150.25").
          example: "3.0"
        price-effect:
          type: string
          description: If pay or receive payment for placing the order. i.e. `Credit` or
            `Debit`
          enum:
            - Credit
            - Debit
          example: Credit
        value:
          type: string
          format: decimal
          description: The notional value of the Order, required for notional market
            orders. Decimal value serialized as a JSON string (e.g. "150.25").
        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
        max-value-per-liquidity-allocation-fill:
          type: string
          format: decimal
          description: Max value per liquidity allocation fill Decimal value serialized as
            a JSON string (e.g. "150.25").
        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
      required:
        - order-type
        - time-in-force
      description: "Request body for replacing a live order. Only `price`,
        `order-type`, and `time-in-force` may differ from the original; the
        remaining fields must match the order being replaced. The attested
        replace request body includes the original order's full `legs` array
        even though the upstream schema does not list a `legs` property — send
        the complete original order body with only the permitted fields changed.
        Conditionally required fields (upstream marks them always-required; the
        attested behavior differs): `price` + `price-effect` are required for
        Limit and Stop Limit orders and MUST be omitted on Market orders;
        `stop-trigger` only for Stop / Stop Limit orders; `value` +
        `value-effect` only for Notional Market orders. Including a price on a
        Market order gets the order rejected."
    postAccountsAccountNumberOrdersIdDryRun:
      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.
                                                `Limit`, `Liquidity Allocation`, `Market`, `Marketable Limit`, `Notional Market`, `Stop` or `Stop Limit`
          enum:
            - Limit
            - Liquidity Allocation
            - Market
            - Marketable Limit
            - Notional Market
            - Stop
            - Stop Limit
          example: Limit
        time-in-force:
          type: string
          description: >-
            The length in time before the order expires. i.e.
                                                   `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
          example: Day
        stop-trigger:
          type: string
          format: decimal
          description: The price trigger at which a stop or stop-limit order becomes
            valid. Decimal value serialized as a JSON string (e.g. "150.25").
        price:
          type: string
          format: decimal
          description: The price of the Order. Required for limit and stop-limit orders.
            Decimal value serialized as a JSON string (e.g. "150.25").
          example: "3.0"
        price-effect:
          type: string
          description: If pay or receive payment for placing the order. i.e. `Credit` or
            `Debit`
          enum:
            - Credit
            - Debit
          example: Credit
        value:
          type: string
          format: decimal
          description: The notional value of the Order, required for notional market
            orders. Decimal value serialized as a JSON string (e.g. "150.25").
        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
        max-value-per-liquidity-allocation-fill:
          type: string
          format: decimal
          description: Max value per liquidity allocation fill Decimal value serialized as
            a JSON string (e.g. "150.25").
        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: TODO
                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.
                enum:
                  - Cryptocurrency
                  - Equity
                  - Equity Offering
                  - Equity Option
                  - Fixed Income Security
                  - Future
                  - Future Option
                  - Liquidity Pool
              quantity:
                type: string
                format: decimal
                description: TODO Decimal value serialized as a JSON string (e.g. "150.25").
              symbol:
                type: string
                description: >-
                  Symbol for stock, specific option symbol in the
                            OCC symbology or specific future symbol. e.g. "AAPL", "AAPL  150515C00120000", "/ESM5"
            required:
              - action
              - instrument-type
              - symbol
      required:
        - order-type
        - time-in-force
      description: "Request body for dry-running a cancel-replace or edit of an
        existing order. Validated against the preflight checks without routing.
        Conditionally required fields (upstream marks them always-required; the
        attested behavior differs): `price` + `price-effect` are required for
        Limit and Stop Limit orders and MUST be omitted on Market orders;
        `stop-trigger` only for Stop / Stop Limit orders; `value` +
        `value-effect` only for Notional Market orders. Including a price on a
        Market order gets the order rejected."
x-tastytrade-service:
  serviceName: order-api
  group: orders
  title: Orders
