> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anthid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get current orders

> Returns the latest broker order rows for the authenticated user or API-key principal's organization, optionally filtered by trading account, symbol, intent, and external order id. API-key callers need organization intent read permission; user callers need an organization admin, member, or read-only role. When `account_id` is supplied, the trading account must belong to the caller's organization.



## OpenAPI

````yaml /api-reference/ledger.openapi.json get /v1/orders
openapi: 3.1.0
info:
  title: ledger
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Ledger
    description: Ledger API
paths:
  /v1/orders:
    get:
      tags:
        - Ledger
      summary: Get current orders
      description: >-
        Returns the latest broker order rows for the authenticated user or
        API-key principal's organization, optionally filtered by trading
        account, symbol, intent, and external order id. API-key callers need
        organization intent read permission; user callers need an organization
        admin, member, or read-only role. When `account_id` is supplied, the
        trading account must belong to the caller's organization.
      operationId: getCurrentOrders
      parameters:
        - name: account_id
          in: query
          description: Filter orders by trading account id
          required: false
          schema:
            type: string
            format: uuid
        - name: symbol
          in: query
          description: Filter orders by symbol. Symbols are normalized to uppercase
          required: false
          schema:
            type: string
          example: AAPL
        - name: external_order_id
          in: query
          description: Filter orders by external broker order id
          required: false
          schema:
            type: string
        - name: intent_id
          in: query
          description: Filter orders by originating intent id
          required: false
          schema:
            type: string
            format: uuid
        - name: limit
          in: query
          description: >-
            Maximum number of results to return. Defaults to 100 and is capped
            at 1000
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: sort_by
          in: query
          description: Field to sort orders by. Defaults to received_at
          required: false
          schema:
            $ref: '#/components/schemas/OrdersSortBy'
        - name: sort_direction
          in: query
          description: Sort direction. Defaults to desc
          required: false
          schema:
            $ref: '#/components/schemas/SortDirection'
        - name: next_cursor
          in: query
          description: Opaque keyset pagination cursor from a previous response
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Orders retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrdersResponse'
        '400':
          description: Query parameters or pagination cursor are invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Missing or invalid authentication credentials or organization
            context
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Caller lacks intent read access, organization access, or ownership
            of the requested trading account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Unexpected server error while reading orders
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    OrdersSortBy:
      type: string
      enum:
        - received_at
        - symbol
        - quantity
        - filled_quantity
        - limit_price
        - average_price
    SortDirection:
      type: string
      enum:
        - Asc
        - Desc
    OrdersResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/BrokerOrder'
        next_cursor:
          type:
            - string
            - 'null'
    Error:
      oneOf:
        - type: object
          required:
            - EncryptionError
          properties:
            EncryptionError:
              type: string
        - type: object
          required:
            - WorkOsError
          properties:
            WorkOsError:
              type: string
        - type: object
          required:
            - KvError
          properties:
            KvError:
              type: string
        - type: object
          required:
            - StreamError
          properties:
            StreamError:
              type: string
        - type: object
          required:
            - InternalError
          properties:
            InternalError:
              type: string
        - type: object
          required:
            - ThirdPartyError
          properties:
            ThirdPartyError:
              type: string
        - type: object
          required:
            - ParseError
          properties:
            ParseError:
              type: string
        - type: object
          required:
            - NotFound
          properties:
            NotFound:
              type: string
        - type: object
          required:
            - AlreadyExists
          properties:
            AlreadyExists:
              type: string
        - type: object
          required:
            - BadRequest
          properties:
            BadRequest:
              type: string
        - type: object
          required:
            - Forbidden
          properties:
            Forbidden:
              type: string
        - type: object
          required:
            - Unauthorized
          properties:
            Unauthorized:
              type: string
        - type: object
          required:
            - Database
          properties:
            Database:
              type: string
        - type: object
          required:
            - TooManyRequests
          properties:
            TooManyRequests:
              type: string
        - type: object
          required:
            - BrokerError
          properties:
            BrokerError:
              type: string
        - type: object
          required:
            - AuthError
          properties:
            AuthError:
              type: string
        - type: object
          required:
            - InvalidInput
          properties:
            InvalidInput:
              type: string
        - type: object
          required:
            - ConnectionLimitExceeded
          properties:
            ConnectionLimitExceeded:
              type: string
    BrokerOrder:
      type: object
      required:
        - order_id
        - intent_id
        - command_seq
        - organization_id
        - account_id
        - broker
        - symbol
        - order_state
        - order_status
        - order_type
        - order_side
        - route_strategy
        - quantity
        - filled_quantity
        - time_in_force
        - received_at
      properties:
        account_id:
          type: string
          format: uuid
        average_price:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Price'
        broker:
          $ref: '#/components/schemas/Broker'
        command_seq:
          type: integer
          format: int64
        external_order_id:
          type:
            - string
            - 'null'
        filled_quantity:
          $ref: '#/components/schemas/Quantity'
        intent_id:
          type: string
          format: uuid
        limit_price:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Price'
        order_id:
          type: string
          format: uuid
        order_side:
          $ref: '#/components/schemas/OrderSide'
        order_state:
          $ref: '#/components/schemas/OrderState'
        order_status:
          $ref: '#/components/schemas/OrderStatus'
        order_type:
          $ref: '#/components/schemas/OrderType'
        organization_id:
          type: string
          format: uuid
        quantity:
          $ref: '#/components/schemas/Quantity'
        received_at:
          type: string
          format: date-time
        route_strategy:
          $ref: '#/components/schemas/RouteStrategy'
        stop_price:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Price'
        symbol:
          type: string
        time_in_force:
          $ref: '#/components/schemas/TimeInForce'
    Price:
      type: string
    Broker:
      type: string
      enum:
        - unspecified
        - lightspeed
        - alpaca
    Quantity:
      type: string
    OrderSide:
      type: string
      enum:
        - UNSPECIFIED
        - BUY
        - SELL
        - SELL_SHORT
    OrderState:
      type: string
      enum:
        - Unspecified
        - Open
        - Closed
        - Rejected
    OrderStatus:
      type: string
      enum:
        - UNSPECIFIED
        - PENDING_NEW
        - NEW
        - PARTIALLY_FILLED
        - FILLED
        - PENDING_CANCEL
        - CANCELLED
        - PENDING_REPLACE
        - REPLACED
        - STOPPED
        - REJECTED
    OrderType:
      type: string
      enum:
        - UNSPECIFIED
        - LIMIT
        - MARKET
        - FILL_OR_KILL
        - LIMIT_ON_OPEN
        - LIMIT_ON_CLOSE
        - MARKET_ON_OPEN
        - MARKET_ON_CLOSE
        - STOP
        - STOP_LIMIT
        - TRAILING_STOP
    RouteStrategy:
      type: string
      enum:
        - UNSPECIFIED
        - SMART
        - AMEX
        - ARCA
        - BATS
        - BATY
        - EDGA
        - EDGX
        - NSDQ
        - NYSE
    TimeInForce:
      type: string
      enum:
        - UNSPECIFIED
        - DAY
        - IMMEDIATE_OR_CANCEL
        - GOOD_TILL_CANCEL
        - AT_OPEN
        - AT_CLOSE
        - FILL_OR_KILL
        - EXT
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````