Clear Street Orders API

The Orders API from Clear Street — 6 operation(s) for orders.

OpenAPI Specification

clear-street-orders-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Clear Street Orders API
  version: '1.0'
  description: 'Operations tagged Orders across 2 of this provider''s published API definitions: clear-street-studio-openapi.yml, clear-street-trading-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.clearstreet.io/studio/v2
  description: Production environment
- url: https://sandbox-api.clearstreet.io/studio/v2
  description: Sandbox environment
- url: https://api.clearstreet.com
  description: Clear Street API
- url: https://api-dev.clearstreet.com
  description: Clear Street Development API
- url: http://localhost:5001
  description: Clear Street Local API
tags:
- name: Orders
  x-displayName: Orders
paths:
  /accounts/{account_id}/bulk-orders:
    servers:
    - url: https://api.clearstreet.io/studio/v2
      description: Production environment
    - url: https://sandbox-api.clearstreet.io/studio/v2
      description: Sandbox environment
    post:
      operationId: createBulkOrders
      summary: Create bulk orders
      description: 'Creates multiple orders in a single request, up to 1000. Note that a successful call to this endpoint does not necessarily mean your orders have been accepted, e.g. a downstream venue might reject your order. You should therefore utilize our WebSocket APIs to listen for changes in order lifecycle events.


        The response will contain an array of objects, indicating whether your order was submitted. If the order was submitted, the `order_id` field will be populated with the order ID assigned to this order. If the order was rejected, the `reason` field will be populated with the reason for rejection. The data array returned in the response object is guaranteed to be ordered in the same order as the orders you provided in the request. Again, note that even if your order was submitted, that doesn''t mean it was _accepted_, and may still be rejected by downstream venues.

        '
      tags:
      - Orders
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/AccountId'
          description: The account ID or account number to create orders for.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orders:
                  type: array
                  description: An array of orders to create.
                  items:
                    $ref: '#/components/schemas/CreateOrder'
                  minItems: 1
                  maxItems: 1000
              required:
              - orders
              additionalProperties: false
      responses:
        '201':
          description: Orders received. Indicates the orders were received and are pending further processing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  submitted:
                    type: integer
                    description: Total number of orders submitted
                  rejected:
                    type: integer
                    description: Total number of orders rejected
                  data:
                    type: array
                    description: Array indicating whether each respective order was submitted or not. This array is guaranteed to be sorted in the same order as the orders you provided in your request.
                    items:
                      type: object
                      properties:
                        submitted:
                          type: boolean
                          description: True if the order was submitted successfully, false otherwise.
                        order_id:
                          $ref: '#/components/schemas/OrderId'
                          description: If the order was submitted, the order ID assigned to this order. Empty if the order was rejected.
                        reason:
                          type: string
                          description: If the order rejected, the reason for rejection. Empty if the order was accepted.
                      required:
                      - submitted
                required:
                - submitted
                - rejected
                - data
        default:
          $ref: '#/components/responses/error'
      security:
      - BearerAuth: []
  /accounts/{account_id}/orders:
    servers:
    - url: https://api.clearstreet.io/studio/v2
      description: Production environment
    - url: https://sandbox-api.clearstreet.io/studio/v2
      description: Sandbox environment
    post:
      operationId: createOrder
      summary: Create order
      description: Creates a new order and sends to our internal systems for execution. Note that a successful call to this endpoint does not necessarily mean your order has been accepted, e.g. a downstream venue might reject your order. You should therefore utilize our WebSocket APIs to listen for changes in order lifecycle events.
      tags:
      - Orders
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/AccountId'
          description: The account ID or account number to create the order for.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrder'
      responses:
        '201':
          description: Order received. Indicates the the order was received and is pending further processing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  order_id:
                    type: string
                    example: 234usdfa3
                    description: An internally generated unique ID for this order.
                required:
                - order_id
        default:
          $ref: '#/components/responses/error'
      security:
      - BearerAuth: []
    get:
      operationId: listOrders
      summary: List orders
      description: List orders for a given account for the current trading day, filtered on the given query parameters.
      tags:
      - Orders
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/AccountId'
          description: The account ID or account number to list orders for.
      - in: query
        name: from
        schema:
          $ref: '#/components/schemas/Timestamp'
          description: Milliseconds since epoch timestamp. This will constrain the search for orders created after this timestamp, inclusively. Timestamps for orders prior the current trading day will be ignored.
      - in: query
        name: to
        schema:
          $ref: '#/components/schemas/Timestamp'
          description: Milliseconds since epoch timestamp. This will constrain the search for orders created before this timestamp, inclusively. Timestamps for orders beyond the current trading day will be ignored.
      - in: query
        name: page_size
        schema:
          type: integer
          minimum: 1
          maximum: 2000
          default: 25
          description: Number of orders to return per page.
      - in: query
        name: page_token
        schema:
          type: string
          description: Cursor for the page to return.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Order'
                  next_page_token:
                    type: string
                    description: Cursor for the next page of results.
                required:
                - data
        default:
          $ref: '#/components/responses/error'
      security:
      - BearerAuth: []
    delete:
      operationId: deleteAllOrders
      summary: Delete all orders
      description: Attempts to cancel all open orders for a given account. Cancelling an order cannot be guaranteed as there might be in-flight executions.
      tags:
      - Orders
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/AccountId'
          description: The account ID or account number to cancel orders for.
      - in: query
        name: symbol
        schema:
          $ref: '#/components/schemas/Symbol'
          description: Cancel orders only for this specific symbol. If this is omitted, all open orders will be cancelled.
      - in: query
        name: symbol_format
        schema:
          $ref: '#/components/schemas/SymbolFormat'
          default: cms
          description: Format of the provided symbol.
      responses:
        '201':
          description: Successfully attempted to cancel all open orders.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrderId'
                    description: Array of order IDs that were attempted to be cancelled.
                required:
                - data
        default:
          $ref: '#/components/responses/error'
      security:
      - BearerAuth: []
  /accounts/{account_id}/orders/{order_id}:
    servers:
    - url: https://api.clearstreet.io/studio/v2
      description: Production environment
    - url: https://sandbox-api.clearstreet.io/studio/v2
      description: Sandbox environment
    get:
      operationId: getOrder
      summary: Get order
      description: Get an order that was previously created.
      tags:
      - Orders
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/AccountId'
          description: The account ID or account number to get the order for.
      - in: path
        name: order_id
        required: true
        schema:
          $ref: '#/components/schemas/OrderId'
      responses:
        '200':
          description: The order associated with the given `order_id`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  order:
                    $ref: '#/components/schemas/Order'
                required:
                - order
                additionalProperties: false
      security:
      - BearerAuth: []
    delete:
      operationId: deleteOrder
      summary: Delete order
      description: Attempts to cancel an existing order. Cancelling an order cannot be guaranteed as there might be in-flight executions.
      tags:
      - Orders
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/AccountId'
          description: The account ID or account number to attempt to cancel the order for.
      - in: path
        name: order_id
        required: true
        schema:
          $ref: '#/components/schemas/OrderId'
      responses:
        '201':
          description: Order cancel successfully attempted.
        default:
          $ref: '#/components/responses/error'
      security:
      - BearerAuth: []
    patch:
      operationId: updateOrder
      summary: Update order
      description: Attempts to update an existing order. This can be used to update a subset of an order's attributes, for example price and quantity.
      tags:
      - Orders
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          $ref: '#/components/schemas/AccountId'
          description: The account ID or account number to attempt to update the order for.
      - in: path
        name: order_id
        required: true
        schema:
          $ref: '#/components/schemas/OrderId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrder'
      responses:
        '201':
          description: Order update successfully attempted.
        default:
          $ref: '#/components/responses/error'
      security:
      - BearerAuth: []
  /v1/accounts/{account_id}/executions:
    servers:
    - url: https://api.clearstreet.com
      description: Clear Street API
    - url: https://api-dev.clearstreet.com
      description: Clear Street Development API
    - url: http://localhost:5001
      description: Clear Street Local API
    get:
      tags:
      - Orders
      summary: Get Executions
      description: 'Retrieves filled and partially-filled execution reports for the specified

        trading account, ordered by transaction time (nanosecond precision) descending.'
      operationId: get_executions
      parameters:
      - name: account_id
        in: path
        description: Account identifier
        required: true
        schema:
          $ref: '#/components/schemas/i64'
      - name: instrument_ids
        in: query
        description: Comma-separated instrument identifiers (UUIDs) or symbols (e.g. `AAPL`) to filter by. When provided, only executions for any of the listed instruments are returned.
        required: false
        schema:
          type: array
          items:
            type: string
            description: 'Instrument identifier: either an instrument UUID or a symbol (symbol for equities, OSI for options). Non-UUID inputs are resolved server-side.'
            minLength: 1
        style: form
        explode: false
      - name: page_size
        in: query
        description: The number of items to return per page. Only used when page_token is not provided.
        required: false
        schema:
          type: integer
          format: int64
          default: 1000
          maximum: 1000
          minimum: 1
      - name: page_token
        in: query
        description: Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored.
        required: false
        schema:
          type: string
          format: byte
          description: Base64URL-encoded pagination token
        example: eyJvZmZzZXQiOjEwMCwibGltaXQiOjEwMH0=
      - name: from
        in: query
        description: The start date and time for the query range, inclusive (ISO 8601 format)
        required: false
        schema:
          type: string
          format: date-time
        example: 2025-04-24 14:30:00+00:00
      - name: to
        in: query
        description: The end date and time for the query range, inclusive (ISO 8601 format)
        required: false
        schema:
          type: string
          format: date-time
        example: 2025-04-24 18:30:00+00:00
      responses:
        '200':
          description: List of executions
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/BaseResponse'
                - type: object
                  required:
                  - data
                  properties:
                    data:
                      $ref: '#/components/schemas/ExecutionList'
                type: object
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
      - BearerAuth: []
  /v1/accounts/{account_id}/orders:
    servers:
    - url: https://api.clearstreet.com
      description: Clear Street API
    - url: https://api-dev.clearstreet.com
      description: Clear Street Development API
    - url: http://localhost:5001
      description: Clear Street Local API
    get:
      tags:
      - Orders
      summary: Get Orders
      description: List orders for an account with optional filtering
      operationId: get_orders
      parameters:
      - name: account_id
        in: path
        description: Account identifier
        required: true
        schema:
          $ref: '#/components/schemas/i64'
      - name: page_size
        in: query
        description: The number of items to return per page. Only used when page_token is not provided.
        required: false
        schema:
          type: integer
          format: int64
          default: 1000
          maximum: 1000
          minimum: 1
      - name: page_token
        in: query
        description: Token for retrieving the next or previous page of results. Contains encoded pagination state; when provided, page_size is ignored.
        required: false
        schema:
          type: string
          format: byte
          description: Base64URL-encoded pagination token
        example: eyJvZmZzZXQiOjEwMCwibGltaXQiOjEwMH0=
      - name: order_ids
        in: query
        description: Comma-separated order IDs to filter by. When provided, only orders whose order ID is in this set are returned.
        required: false
        schema:
          type: array
          items:
            type: string
        style: form
        explode: false
      - name: status
        in: query
        description: Comma-separated order statuses to filter by
        required: false
        schema:
          type: array
          items:
            type: string
            description: Order status
            enum:
            - PENDING_NEW
            - NEW
            - PARTIALLY_FILLED
            - FILLED
            - CANCELED
            - REJECTED
            - EXPIRED
            - PENDING_CANCEL
            - PENDING_REPLACE
            - REPLACED
            - DONE_FOR_DAY
            - STOPPED
            - SUSPENDED
            - CALCULATED
            - OTHER
        style: form
        explode: false
      - name: symbol
        in: query
        description: Filter by symbol
        required: false
        schema:
          type: string
      - name: instrument_ids
        in: query
        description: Comma-separated instrument IDs (UUID) or symbols (equity tickers or OSI option symbols).
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/InstrumentIdOrSymbol'
        style: form
        explode: false
      - name: instrument_type
        in: query
        description: Instrument type filter (e.g., COMMON_STOCK, OPTION)
        required: false
        schema:
          type: string
          description: Security type
          enum:
          - COMMON_STOCK
          - INDEX
          - OPTION
          - CASH
      - name: underlying_instrument_ids
        in: query
        description: Comma-separated instrument IDs (UUID) or symbols (equity tickers or OSI option symbols). Matches options orders whose resolved underlier is any of the given instruments.
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/InstrumentIdOrSymbol'
        style: form
        explode: false
      - name: from
        in: query
        description: The start date and time for the query range, inclusive (ISO 8601 format)
        required: false
        schema:
          type: string
          format: date-time
        example: 2025-04-24 14:30:00+00:00
      - name: to
        in: query
        description: The end date and time for the query range, inclusive (ISO 8601 format)
        required: false
        schema:
          type: string
          format: date-time
        example: 2025-04-24 18:30:00+00:00
      responses:
        '200':
          description: List of orders
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/BaseResponse'
                - type: object
                  required:
                  - data
                  properties:
                    data:
                      $ref: '#/components/schemas/OrderList'
                type: object
              examples:
                ListOfOrders:
                  summary: A list of orders with various statuses
                  value:
                    data:
                    - account_id: 19816
                      average_fill_price: '47.95'
                      client_order_id: my-ref-id-20251001-001
                      created_at: 2025-10-31 13:30:00+00:00
                      filled_quantity: '5'
                      id: 0195f6c7-4f64-7e3c-8b0a-1d8e4f5e6a7b
                      instrument_id: d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab
                      instrument_type: COMMON_STOCK
                      leaves_quantity: '5'
                      limit_price: '48.00'
                      order_type: LIMIT
                      quantity: '10'
                      side: BUY
                      status: PARTIALLY_FILLED
                      stop_price: null
                      symbol: TSLA
                      time_in_force: DAY
                      updated_at: 2025-10-31 13:35:10+00:00
                      venue: XNAS
                    - account_id: 19816
                      average_fill_price: '50.03'
                      client_order_id: my-ref-id-20251001-002
                      created_at: 2025-10-31 14:00:00+00:00
                      filled_quantity: '10'
                      id: 0195f6c8-1a2b-7c3d-8e4f-5a6b7c8d9e0f
                      instrument_id: d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab
                      instrument_type: COMMON_STOCK
                      leaves_quantity: '0'
                      limit_price: null
                      order_type: MARKET
                      quantity: '10'
                      side: SELL
                      status: FILLED
                      stop_price: null
                      symbol: TSLA
                      time_in_force: DAY
                      updated_at: 2025-10-31 14:00:05+00:00
                      venue: XNAS
                    error: null
                    metadata:
                      next_page_token: cGFnZT0yJmxhc3RfaWQ9b3JkXzRjRDVlNkY3ZzhIOWkwSjE=
                      page_number: 1
                      request_id: d9a4f5b6-c3d4-6e5f-0a1b-7c8d9e0f1a2b
                      total_items: 25
                      total_pages: 3
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                Forbidden:
                  summary: Caller does not have permission
                  value:
                    error:
                      code: 403
                      message: The caller does not have permission to execute the specified operation
                    metadata:
                      request_id: 5518f0c6-58ff-4b4a-81a5-701556d41206
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
      - BearerAuth: []
    post:
      tags:
      - Orders
      summary: Submit Orders
      description: Submit new orders
      operationId: submit_orders
      parameters:
      - name: account_id
        in: path
        description: Account identifier
        required: true
        schema:
          $ref: '#/components/schemas/i64'
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/OrderSubmissionRequest'
            examples:
              LimitBuy:
                summary: Limit buy order
                value:
                - limit_price: '48.00'
                  order_type: LIMIT
                  quantity: '1'
                  side: BUY
                  symbol: TSLA
                  time_in_force: DAY
              MarketBuy:
                summary: Market buy order
                value:
                - order_type: MARKET
                  quantity: '1'
                  side: BUY
                  symbol: TSLA
                  time_in_force: DAY
              StopBuy:
                summary: Stop (market) buy order
                value:
                - order_type: STOP
                  quantity: '1'
                  side: BUY
                  stop_price: '52.00'
                  symbol: TSLA
                  time_in_force: DAY
              StopLimitBuy:
                summary: Stop-limit buy order
                value:
                - limit_price: '52.50'
                  order_type: STOP_LIMIT
                  quantity: '1'
                  side: BUY
                  stop_price: '52.00'
                  symbol: TSLA
                  time_in_force: DAY
              TrailingStopBps:
                summary: Trailing stop order with basis-point offset
                value:
                - order_type: TRAILING_STOP
                  quantity: '1'
                  side: BUY
                  symbol: TSLA
                  time_in_force: DAY
                  trailing_offset: '115'
                  trailing_offset_type: BPS
              TrailingStopLimitWithLimitOffset:
                summary: Trailing stop-limit order with a limit offset
                value:
                - limit_offset: '0.50'
                  order_type: TRAILING_STOP_LIMIT
                  quantity: '1'
                  side: BUY
                  symbol: TSLA
                  time_in_force: DAY
                  trailing_offset: '2.00'
                  trailing_offset_type: PRICE
              TrailingStopPrice:
                summary: Trailing stop order with absolute price offset
                value:
                - order_type: TRAILING_STOP
                  quantity: '1'
                  side: BUY
                  symbol: TSLA
                  time_in_force: DAY
                  trailing_offset: '2.00'
                  trailing_offset_type: PRICE
        required: true
      responses:
        '200':
          description: Orders submitted successfully
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/BaseResponse'
                - type: object
                  required:
                  - data
                  properties:
                    data:
                      $ref: '#/components/schemas/OrderList'
                type: object
              examples:
                FullSuccess:
                  summary: Order accepted and pending
                  value:
                    data:
                    - account_id: 19816
                      client_order_id: my-ref-id-20251003-001
                      created_at: 2025-10-03 14:01:15+00:00
                      filled_quantity: '0'
                      id: 0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01
                      instrument_id: d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab
                      instrument_type: COMMON_STOCK
                      leaves_quantity: '1'
                      order_type: MARKET
                      quantity: '1'
                      side: BUY
                      status: PENDING_NEW
                      symbol: TSLA
                      time_in_force: DAY
                      updated_at: 2025-10-03 14:01:15+00:00
                      venue: XNAS
                    error: null
                    metadata:
                      request_id: ea0b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        '400':
          description: Invalid order request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                MalformedJsonSyntax:
                  summary: Malformed JSON in request body
                  value:
                    error:
                      code: 400
                      message: 'Failed to parse the request body as JSON: [0].?: expected `,` or `}` at line 11 column 3'
                    metadata:
                      request_id: 8cb2657f-828e-4af5-b7d0-5cc6b7354bc2
                NoBuyingPower:
                  summary: Order rejected due to insufficient buying power
                  value:
                    error:
                      code: 400
                      details:
                      - description: 'Buying Power: required > available'
                        subject: order:019dba52-6611-7b53-9bc9-18c410e5ebb8
                        type: BUYING_POWER
                      - domain: com.clearstreet.oems.risk
                        metadata:
                          account_id: '100001'
                          account_type: margin_reg_t
                          available: '11004.5000'
                          multiplier: '2'
                          order_id: 019dba52-6611-7b53-9bc9-18c410e5ebb8
                          required_equity: '30000'
                          required_options: '0'
                          required_total: '30000'
                          side: Buy
                          symbol: AAPL
                        reason: BUYING_POWER
                      message: Risk check failed
                    metadata:
                      request_id: 00bf689a-f53d-47b7-8b73-f0e69d2e89b6
                RiskCheckSelfMatch:
                  summary: Order rejected due to self-match risk check
                  value:
                    error:
                      code: 400
                      details:
                      - description: 'Self-Match: would cross own orders'
                        subject: order:019dba51-a906-7133-aacc-ea4fc05058d8
                        type: SELF_MATCH
                      - domain: com.clearstreet.oems.risk
                        metadata:
                          account_id: '100001'
                          order_id: 019dba51-a906-7133-aacc-ea4fc05058d8
                          price: $200
                          side: Sell
                          symbol: AAPL
                        reason: SELF_MATCH
                      message: Risk check failed
                    metadata:
                      request_id: 21b77c52-2386-40a4-8955-8fa1127ff424
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                Forbidden:
                  summary: Caller does not have permission
                  value:
                    error:
                      code: 403
                      message: The caller does not have permission to execute the specified operation
                    metadata:
                      request_id: 5518f0c6-58ff-4b4a-81a5-701556d41206
        '422':
          description: Malformed order request payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                PayloadMissingRequiredField:
                  summary: Malformed order payload missing order_type
                  value:
                    error:
                      code: 422
                      message: 'Failed to deserialize the JSON body into the target type: [0]: missing field `order_type` at line 26 column 1'
                    metadata:
                      request_id: 1b2c02c3-92a1-4432-8638-e71038c105c3
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
      - BearerAuth: []
    delete:
      tags:
      - Orders
      summary: Cancel All Open Orders
      description: Cancel all orders for an account
      operationId: cancel_all_open_orders
      parameters:

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