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

# List My Orders on Market

> Returns the authenticated account's orders on this specific market, both open and historical.



## OpenAPI

````yaml GET /v1/markets/{market_id}/account_orders
openapi: 3.0.3
info:
  title: Predicta Markets API
  description: >-
    The Predicta Markets REST API lets you build on top of a continuous
    double-auction prediction market platform. Users buy and sell shares in
    YES/NO outcomes of real-world events. When a market resolves, holders of the
    winning side receive payouts; holders of the losing side lose their stake.


    Data model hierarchy: Market → MarketAsset → MarketAssetOption (prediction
    key) → Order. A Market is a question about a real-world event (e.g. 'Will
    Arsenal win the Premier League?'). Each Market contains one or more
    MarketAssets — the tradeable outcomes. Simple binary markets have a single
    asset; multi-player markets (e.g. Player of the Match) have one asset per
    candidate. Each MarketAsset exposes two options, YES and NO, each carrying a
    prediction_key — the unique hash you pass when placing an order to identify
    exactly which outcome you are trading.


    Trading flow: (1) call GET /v1/markets to find a market; (2) inspect
    market_assets and their options to get the prediction_key for the outcome
    you want; (3) call POST /v1/markets/{market_id}/orders with that
    prediction_key, your price, and quantity. Orders match immediately when a
    counterparty exists, otherwise they rest as open limit orders in the order
    book.


    Price system: all prices are integers in the range 1–99, representing cents.
    Price equals implied probability in percent — a YES price of 65 means the
    market implies a 65% chance the event will occur. YES and NO prices for the
    same asset always sum to approximately 100.


    Currency: the platform's internal unit is PT (Predicta Token). Balances,
    prices, and payout amounts are expressed in PT unless the market was created
    with a real-currency denomination.


    QID system: many resources expose a human-readable qualified ID (qid)
    alongside the numeric id. QIDs are computed, not stored as database columns.
    Prefix conventions — MA: market, MAA: market asset, AP: account payout. Most
    path parameters accept either the numeric id or the qid interchangeably.


    Authentication: include your API key in the X-Api-Key request header. All
    account-scoped endpoints require authentication. Market listing and detail
    endpoints are public.
  version: 1.0.0
  contact:
    email: api-support@predictamarkets.com
servers:
  - url: https://api.predictamarkets.com
    description: Production
security: []
paths:
  /v1/markets/{market_id}/account_orders:
    get:
      tags:
        - Market
      summary: List My Orders on Market
      description: >-
        Returns the authenticated account's orders on this specific market, both
        open and historical.
      operationId: get_account_orders_v1_markets__market_id__account_orders_get
      parameters:
        - name: market_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/TQID'
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            description: Number of records to skip
            default: 0
            title: Skip
          description: Number of records to skip
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            description: Maximum number of records to return
            default: 100
            title: Limit
          description: Maximum number of records to return
      responses:
        '200':
          description: My orders on this market
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MarketAssetOrderSchema'
                title: >-
                  Response Get Account Orders V1 Markets  Market Id  Account
                  Orders Get
              example:
                - id: 501
                  market_id: 12
                  market_asset_id: 34
                  account_id: 1042
                  order_type: BUY
                  opinion_side: 'YES'
                  price: '65.00'
                  quantity: '10.00'
                  initial_quantity: '10.00'
                  status: FILLED
                  prediction_key: mkt-12-yes
                  auto_cancel_at: null
                  created_at: '2025-04-10T09:00:00Z'
                  updated_at: '2025-04-10T09:01:00Z'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Not authenticated
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Market not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - apiKey: []
components:
  schemas:
    TQID:
      anyOf:
        - type: string
        - type: integer
      description: >-
        Flexible identifier type that accepts either a numeric integer ID or a
        human-readable qualified ID string (QID). QIDs follow a prefix
        convention: MA for markets, MAA for market assets, AP for account
        payouts. Most path parameters that accept an ID use this type so callers
        can use whichever form is more convenient.
    MarketAssetOrderSchema:
      properties:
        id:
          title: Id
          description: Primary key, auto-generated
          type: integer
          nullable: true
        qid:
          title: Qid
          description: Query identifier
          type: string
          nullable: true
        account_id:
          type: integer
          title: Account Id
          description: Foreign key to accounts table
        market_asset_id:
          type: integer
          title: Market Asset Id
          description: Foreign key to market_assets table
        opinion_side:
          $ref: '#/components/schemas/MarketSides'
          description: Market side (YES/NO)
          default: 'YES'
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
          description: Price per share, 2 decimal places
        quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
          description: Number of shares, 2 decimal places
        initial_quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Initial Quantity
          description: Initial number of shares, 2 decimal places
        status:
          $ref: '#/components/schemas/OrderStatus'
          description: Order status
          default: OPEN
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: Order creation timestamp
        is_dequeued:
          type: boolean
          title: Is Dequeued
          description: >-
            Internal processing flag. True when the order has been dequeued from
            the matching engine's input queue and is being or has been
            processed. False if still waiting in queue. Not meaningful for API
            consumers.
          default: true
        processing_status:
          $ref: '#/components/schemas/OrderProcessingStatus'
          description: >-
            Internal state within the matching engine pipeline. PENDING means
            the order is queued; PROCESSING means the engine is working on it;
            COMPLETED means processing finished (check status for the trading
            result); FAILED means an error occurred.
          default: PENDING
        error_message:
          title: Error Message
          description: Error message if processing fails
          type: string
          nullable: true
        retry_count:
          type: integer
          title: Retry Count
          description: Number of processing retries
          default: 0
        refund_status:
          $ref: '#/components/schemas/OrderRefundStatus'
          description: Refund status
          default: NOT_REQUIRED
        order_type:
          $ref: '#/components/schemas/MarketOrderType'
          description: Type of order (BUY or SELL)
        trade_price:
          title: Trade Price
          description: Actual trade price, if filled
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
        last_processed_at:
          title: Last Processed At
          description: Last processing timestamp
          type: string
          format: date-time
          nullable: true
        market_asset:
          $ref: '#/components/schemas/MarketAssetSchema'
          description: Market asset
          nullable: true
      type: object
      required:
        - account_id
        - market_asset_id
        - price
        - quantity
        - initial_quantity
        - order_type
        - market_asset
      title: MarketAssetOrderSchema
      description: >-
        A limit order on the order book. Contains the order's current status,
        the price and remaining quantity, and internal processing metadata.
        Returned by order listing endpoints and order placement/cancellation
        responses.
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
      required:
        - detail
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      description: >-
        Returned by FastAPI when request validation fails (HTTP 422). Contains
        one or more ValidationError entries describing each invalid field.
    MarketSides:
      type: string
      enum:
        - 'YES'
        - 'NO'
      title: MarketSides
      description: 'The two tradeable sides of a market asset: YES or NO.'
    OrderStatus:
      type: string
      enum:
        - OPEN
        - PARTIAL
        - FILLED
        - CANCELLED
      title: OrderStatus
      description: >-
        Lifecycle status of a limit order on the order book. OPEN: order is in
        the book, waiting to be fully matched with a counterparty. PARTIAL:
        order has been partially matched — some quantity has been filled but the
        remainder is still resting in the book. FILLED: order has been fully
        matched; no remaining quantity. Balance impact is complete. CANCELLED:
        order was explicitly cancelled by the user or auto-cancelled; any
        suspense balance held for the unfilled portion is released back to
        available balance.
    OrderProcessingStatus:
      type: string
      enum:
        - PENDING
        - PROCESSING
        - COMPLETED
        - FAILED
        - CANCELLED
      title: OrderProcessingStatus
      description: >-
        Internal processing state of an order within the matching engine.
        PENDING: order has been accepted and is queued for the matching engine.
        PROCESSING: the matching engine is actively attempting to match this
        order. COMPLETED: the engine has finished processing — the order is
        either filled, partially filled, or placed as an open limit order.
        FAILED: the engine encountered an error; see error_message for details.
        The order will be retried up to retry_count times. CANCELLED: processing
        was halted because the order was cancelled before or during matching.
    OrderRefundStatus:
      type: string
      enum:
        - NOT_REQUIRED
        - COMPLETED
        - FAILED
      title: OrderRefundStatus
      description: >-
        Tracks whether a refund is required for a cancelled or failed order.
        NOT_REQUIRED: no refund needed (order was never charged or payout was
        already handled). COMPLETED: refund successfully credited back to the
        account's available balance. FAILED: refund processing encountered an
        error and will be retried.
    MarketOrderType:
      type: string
      enum:
        - BUY
        - SELL
      title: MarketOrderType
      description: >-
        Order direction: BUY (purchasing shares) or SELL (selling previously
        acquired shares).
    MarketAssetSchema:
      properties:
        id:
          type: integer
          title: Id
          description: The items ID
        qid:
          type: string
          title: Qid
          description: the qualified identifier
        asset_identifier:
          type: string
          title: Asset Identifier
          description: Unique asset identifier
        market_id:
          type: integer
          title: Market Id
          description: The market ID
        current_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: Current Price
          description: Current price of the asset
          default: null
        yes_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: Yes Price
          description: Current YES price of the asset
          default: null
        no_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: No Price
          description: Current NO price of the asset
          default: null
        volume:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: Volume
          description: Trading volume of the asset
          default: null
        status:
          type: string
          title: Status
          description: Status of the market asset
          default: active
        title:
          title: Title
          description: >-
            Display name for this market asset. For multi-outcome markets this
            is the candidate name (e.g. 'Kylian Mbappe'). For binary markets
            this may match the market title or be null.
          type: string
          nullable: true
        options:
          title: Options
          description: Tradeable options for this market asset.
          type: array
          items:
            $ref: '#/components/schemas/MarketAssetOption'
          nullable: true
          default: null
        avatar_path:
          title: Avatar Path
          description: The avatar url
          type: string
          nullable: true
        outcome:
          $ref: '#/components/schemas/MarketAssetOutcomeSchema'
          description: Outcome of the market asset
          nullable: true
      type: object
      required:
        - id
        - qid
        - asset_identifier
        - market_id
      title: MarketAssetSchema
      description: >-
        A single tradeable outcome within a market. Binary markets have one
        asset (the question itself); multi-outcome markets have one asset per
        candidate or condition. Each asset has live YES/NO prices and a list of
        options containing the prediction_key values needed to place orders.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
          description: >-
            Path to the invalid field as a list of keys and/or array indices.
            For example, ['body', 'price'] indicates the price field in the
            request body failed validation.
        msg:
          type: string
          title: Message
          description: Human-readable explanation of what validation rule was violated.
        type:
          type: string
          title: Error Type
          description: >-
            Machine-readable Pydantic error type (e.g. 'value_error.missing',
            'type_error.integer').
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
      description: >-
        A single field validation failure within an HTTP 422 response. The loc
        array traces the path to the invalid field (e.g. ['body', 'price']).
    MarketAssetOption:
      type: object
      title: MarketAssetOption
      description: >-
        A single tradeable option within a market asset (e.g. YES / NO for
        binary markets).
      required:
        - id
        - key
      properties:
        id:
          type: string
          description: >-
            Option identifier — 'YES' / 'NO' for binary markets, or the
            condition key for multi-outcome markets.
        key:
          type: string
          description: >-
            The prediction key for this option. This is the value you supply as
            `prediction_key` when placing an order via POST
            /v1/markets/{market_id}/orders. It is a unique uppercase hex hash
            that identifies a specific tradeable outcome (e.g. the YES side of a
            particular market asset).
        value:
          type: string
          nullable: true
          description: >-
            Human-readable label for the option. Typically 'Yes' / 'No', but can
            be a full sentence (e.g. 'Yes Kylian Mbappe wins the Ballon d\'Or').
        determination_formula:
          type: string
          nullable: true
          description: >-
            Auto-determination formula used by the oracle to resolve this
            option. Present only on finance/series markets. Absent (not null) on
            simple binary markets.
      example:
        id: 'YES'
        key: B634817F0B02790D949F56F7BBDE7ECF
        value: 'Yes'
        determination_formula: '#{price} >= 4554.71'
    MarketAssetOutcomeSchema:
      properties:
        id:
          title: Id
          description: Primary key of the outcome record. Populated after resolution.
          type: integer
          nullable: true
        qid:
          title: Qid
          description: Human-readable qualified ID for this outcome record.
          type: string
          nullable: true
        winning_side:
          $ref: '#/components/schemas/MarketSides'
          description: The winning side
          nullable: true
        winning_prediction_key:
          title: Winning Prediction Key
          description: >-
            The prediction key (`market_asset.options[n].key`) of the option
            that was resolved as the winner. Holders of orders with this
            prediction key receive payouts.
          type: string
          nullable: true
        market_determined_at:
          title: Market Determined At
          description: >-
            Timestamp when the market outcome was officially determined by the
            platform. After this point the market moves toward COMPLETED/SETTLED
            status and payouts are calculated.
          type: string
          format: date-time
          nullable: true
      type: object
      title: MarketAssetOutcomeSchema
      description: >-
        Resolution outcome for a market asset. Populated after the market is
        resolved. Contains the winning side, the winning prediction_key, and the
        timestamp of determination.
  responses:
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            detail: An unexpected error occurred. Please try again later.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      x-default: your-api-key-here

````