> ## 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 order

> Returns the latest broker order row for an order in the authenticated user or API-key principal's organization. API-key callers need organization intent read permission; user callers need an organization admin, member, or read-only role.



## OpenAPI

````yaml /api-reference/ledger.openapi.json get /v1/orders/{order_id}
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/{order_id}:
    get:
      tags:
        - Ledger
      summary: Get order
      description: >-
        Returns the latest broker order row for an order in the authenticated
        user or API-key principal's organization. API-key callers need
        organization intent read permission; user callers need an organization
        admin, member, or read-only role.
      operationId: getOrder
      parameters:
        - name: order_id
          in: path
          description: Internal order id to fetch
          required: true
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
      responses:
        '200':
          description: Order retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrokerOrder'
        '400':
          description: Path parameters 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 or organization access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No order exists for the provided id in the caller's organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Unexpected server error while reading the order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    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'
    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
    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

````