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

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# List orders across your app

> Every order placed by any user of your app, as a changes feed: ordered by last update, oldest first. Page until `hasMore` is false, then store `nextCursor` and pass it as `cursor` on your next run to receive only orders created or changed since. `nextCursor` is returned on every response, including an empty one. An order is returned again each time it changes (for example `pending` → `filled`), so upsert by `id`. Orders changed in the last 2 minutes appear on a later run. Filter with `status`, a comma-separated list such as `filled,partial_fill`. Authenticate with an `x-app-api-key` of either scope: a `read` key can read every user's orders in your app, so treat it as a credential over your users' full trading history.



## OpenAPI

````yaml /openapi/openapi.json get /apps/{appId}/orders
openapi: 3.0.2
info:
  title: AGG API
  version: 1.0.0
  description: >-
    Prediction market aggregator REST API — authentication, users, venue events,
    venue markets, orderbooks, charts, and execution workflows.
servers:
  - url: https://api.agg.market
    description: Production
security: []
tags:
  - name: Authentication
    description: Sign users in and manage their session tokens.
  - name: Markets
    description: Find events, markets and outcomes to trade.
  - name: Market Data
    description: Live orderbooks, prices, charts and scores for those markets.
  - name: Trading
    description: Quote, place, sign, track and cancel orders.
  - name: Portfolio
    description: A user's orders, positions, balances and activity.
  - name: Funding
    description: Deposit addresses, withdrawals, balance refills and fiat on-ramp.
  - name: Users
    description: The signed-in user's profile, linked accounts, KYC and venue keys.
  - name: Hosted Venue Accounts
    description: Provision, fund and withdraw from venue accounts hosted for the user.
  - name: Webhooks
    description: Configure and operate webhook delivery to your server.
  - name: Partner Admin
    description: Server-side reads across your app's users, orders and analytics.
  - name: Paper Trading
    description: Simulated accounts and orders for testing without real funds.
  - name: News
    description: News feeds linked to markets.
  - name: Correlated Markets
    description: Markets related to a given market and the effect of its resolution.
paths:
  /apps/{appId}/orders:
    get:
      tags:
        - Partner Admin
      summary: List orders across your app
      description: >-
        Every order placed by any user of your app, as a changes feed: ordered
        by last update, oldest first. Page until `hasMore` is false, then store
        `nextCursor` and pass it as `cursor` on your next run to receive only
        orders created or changed since. `nextCursor` is returned on every
        response, including an empty one. An order is returned again each time
        it changes (for example `pending` → `filled`), so upsert by `id`. Orders
        changed in the last 2 minutes appear on a later run. Filter with
        `status`, a comma-separated list such as `filled,partial_fill`.
        Authenticate with an `x-app-api-key` of either scope: a `read` key can
        read every user's orders in your app, so treat it as a credential over
        your users' full trading history.
      operationId: getAppOrders
      parameters:
        - name: appId
          in: path
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          required: false
          schema:
            maxLength: 200
            type: string
        - name: status
          in: query
          required: false
          schema:
            minLength: 1
            maxLength: 200
            type: string
        - name: limit
          in: query
          required: false
          schema:
            minimum: 1
            maximum: 100
            type: integer
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - nextCursor
                  - hasMore
                properties:
                  data:
                    description: This page of results.
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - quoteId
                        - externalId
                        - clientOrderId
                        - venue
                        - status
                        - side
                        - amountRaw
                        - limitPriceRaw
                        - timeInForce
                        - expiresAt
                        - slippageBps
                        - quotedPriceRaw
                        - quotedCostRaw
                        - quotedSharesRaw
                        - quotedToWinRaw
                        - filledAmountRaw
                        - executionPrice
                        - actualSharesRaw
                        - actualToWinRaw
                        - partialFillReason
                        - txHash
                        - errorMessage
                        - dagRunId
                        - createdAt
                        - updatedAt
                        - venueMarket
                        - venueMarketOutcome
                        - userId
                      properties:
                        id:
                          description: Order id.
                          type: string
                        quoteId:
                          description: >-
                            Quote this order came from. Every order of a split
                            trade shares it, so group by it to show one trade.
                          type: string
                          nullable: true
                        externalId:
                          description: Your trade id from POST /execution/orders.
                          type: string
                          nullable: true
                        clientOrderId:
                          description: Your order id from POST /execution/limit-orders.
                          type: string
                          nullable: true
                        venue:
                          allOf:
                            - $ref: '#/components/schemas/Venue'
                          description: Venue the order ran on.
                        status:
                          $ref: '#/components/schemas/OrderStatus'
                        side:
                          description: '`buy` or `sell`.'
                          type: string
                        amountRaw:
                          description: >-
                            Order amount. Market buy: the USD spend limit.
                            Market sell: the expected proceeds. Limit buy: the
                            reserved cost. All of those are USD in 6-decimal
                            atomic units, as an integer string (1000000 =
                            $1.00). Limit sell: the number of shares, in
                            6-decimal atomic units.
                          type: string
                        orderType:
                          description: '`market` or `limit`. Absent on paper orders.'
                          type: string
                          enum:
                            - market
                            - limit
                        limitPriceRaw:
                          description: >-
                            Limit orders: the limit price. Price per share
                            scaled by 1e6, as an integer string (530000 = 0.53).
                          type: string
                          nullable: true
                        limitSizeRaw:
                          description: >-
                            Limit orders: the size. Shares in 6-decimal atomic
                            units, as an integer string (1000000 = 1 share).
                          type: string
                          nullable: true
                        timeInForce:
                          description: >-
                            Limit orders: time in force (`GTC`, `GTD`, `FOK`,
                            `FAK`, `IOC`, `ALO`).
                          type: string
                          enum:
                            - GTC
                            - GTD
                            - FOK
                            - FAK
                            - IOC
                            - ALO
                          nullable: true
                        postOnly:
                          description: 'Limit orders: may only rest on the book, never take.'
                          type: boolean
                        expiresAt:
                          format: date-time
                          description: 'Limit orders (`GTD`): expiry time.'
                          type: string
                          nullable: true
                        reservedCostRaw:
                          description: >-
                            Limit buys: cash held for the order. `null` on sells
                            and self-custody orders. USD in 6-decimal atomic
                            units, as an integer string (1000000 = $1.00).
                          type: string
                          nullable: true
                        filledSizeRaw:
                          description: >-
                            Limit orders: shares filled so far. Shares in
                            6-decimal atomic units, as an integer string
                            (1000000 = 1 share).
                          type: string
                          nullable: true
                        filledCostRaw:
                          description: >-
                            Limit orders: cost of the fills so far. USD in
                            6-decimal atomic units, as an integer string
                            (1000000 = $1.00).
                          type: string
                          nullable: true
                        remainingSizeRaw:
                          description: >-
                            Limit orders: shares unfilled. Shares in 6-decimal
                            atomic units, as an integer string (1000000 = 1
                            share).
                          type: string
                          nullable: true
                        averageFillPriceRaw:
                          description: >-
                            Limit orders: average fill price. Price per share
                            scaled by 1e6, as an integer string (530000 = 0.53).
                          type: string
                          nullable: true
                        venueOrderId:
                          description: The venue's own order id.
                          type: string
                          nullable: true
                        cancelRequestedAt:
                          description: ISO-8601 time a cancel was requested.
                          type: string
                          nullable: true
                        cancelledAt:
                          description: ISO-8601 time the cancel was confirmed.
                          type: string
                          nullable: true
                        slippageBps:
                          description: Maximum slippage allowed, in basis points.
                          type: number
                          nullable: true
                        quotedPriceRaw:
                          description: >-
                            Price the quote matched at. Price per share from 0
                            to 1, as a decimal string (e.g. "0.53").
                          type: string
                          nullable: true
                        quotedCostRaw:
                          description: >-
                            Quoted cost (buy) or quoted proceeds (sell). USD in
                            6-decimal atomic units, as an integer string
                            (1000000 = $1.00).
                          type: string
                          nullable: true
                        quotedSharesRaw:
                          description: >-
                            Shares the quote promised. Shares in 6-decimal
                            atomic units, as an integer string (1000000 = 1
                            share).
                          type: string
                          nullable: true
                        quotedToWinRaw:
                          description: >-
                            Payout if this outcome wins, per the quote. USD in
                            6-decimal atomic units, as an integer string
                            (1000000 = $1.00).
                          type: string
                          nullable: true
                        filledAmountRaw:
                          description: >-
                            USD actually filled: cost on a buy, proceeds on a
                            sell. USD in 6-decimal atomic units, as an integer
                            string (1000000 = $1.00).
                          type: string
                          nullable: true
                        executionPrice:
                          description: >-
                            Average fill price. Price per share from 0 to 1, as
                            a decimal string (e.g. "0.53"). Falls back to the
                            quoted price when the venue reported none.
                          type: string
                          nullable: true
                        actualSharesRaw:
                          description: >-
                            Shares actually received or sold. Shares in
                            6-decimal atomic units, as an integer string
                            (1000000 = 1 share).
                          type: string
                          nullable: true
                        actualToWinRaw:
                          description: >-
                            Payout if this outcome wins, based on actual fills.
                            USD in 6-decimal atomic units, as an integer string
                            (1000000 = $1.00).
                          type: string
                          nullable: true
                        partialFillReason:
                          description: >-
                            Why a `partial_fill` stopped short; `null`
                            otherwise. Open set: known values are
                            `venue_capacity`, `price_slipped`,
                            `venue_cancelled`, `venue_expired`, `venue_closed`,
                            `user_cancelled`, `timeout`,
                            `clearinghouse_capacity` and
                            `native_remainder_voided`; venues may report others.
                          type: string
                          nullable: true
                        fees:
                          $ref: '#/components/schemas/OrderFees'
                        txHash:
                          description: Settlement transaction hash, when on-chain.
                          type: string
                          nullable: true
                        errorMessage:
                          description: Readable failure reason.
                          type: string
                          nullable: true
                        dagRunId:
                          description: >-
                            Execution id shared by every order of a split trade.
                            Use it to de-duplicate trade-level fees.
                          type: string
                          nullable: true
                        createdAt:
                          description: ISO-8601 creation time.
                          type: string
                        updatedAt:
                          description: ISO-8601 time of the last change.
                          type: string
                        venueMarket:
                          description: The market traded.
                          type: object
                          required:
                            - id
                            - venueEventId
                            - question
                            - image
                          properties:
                            id:
                              description: Market id.
                              type: string
                            venueEventId:
                              description: Event id.
                              type: string
                            question:
                              description: Market question.
                              type: string
                            image:
                              description: Image URL.
                              type: string
                              nullable: true
                          nullable: true
                        venueMarketOutcome:
                          description: The outcome traded.
                          type: object
                          required:
                            - label
                            - title
                          properties:
                            label:
                              description: Outcome label, e.g. "Yes".
                              type: string
                            title:
                              description: Longer outcome title, if any.
                              type: string
                              nullable: true
                          nullable: true
                        userId:
                          type: string
                  nextCursor:
                    description: >-
                      Pass as `cursor` to fetch the next page; `null` on the
                      last page.
                    type: string
                    nullable: true
                  hasMore:
                    description: '`true` when another page exists.'
                    type: boolean
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - appApiKey: []
components:
  schemas:
    Venue:
      type: string
      enum:
        - kalshi
        - polymarket
        - limitless
        - opinion
        - predict
        - pred
        - tiprun
        - probable
        - myriad
        - hyperliquid
        - novig
        - prophetx
        - betdex
    OrderStatus:
      description: >-
        Order lifecycle status. In flight: `pending` (accepted, funds being
        checked), `signing`, `pending_bridge` (funds moving to the venue's
        chain), `submitting`, `submitted` (sent to the venue, awaiting
        confirmation). Resting limit orders: `open`, `partially_filled_open`,
        `cancel_pending` (cancel requested, awaiting the venue). Terminal:
        `filled`, `partial_fill` (the unfilled rest will not fill; see
        `partialFillReason`), `failed`, `expired`, `cancelled`.
      type: string
      enum:
        - pending
        - signing
        - pending_bridge
        - submitting
        - submitted
        - open
        - partially_filled_open
        - cancel_pending
        - filled
        - partial_fill
        - failed
        - expired
        - cancelled
    OrderFees:
      description: >-
        Fees on this order: `quoted` at acceptance, `actual` once money moved.
        Read `venueFeeBasis` first.
      type: object
      required:
        - venueFeeBasis
        - quoted
        - actual
      properties:
        venueFeeBasis:
          description: >-
            How this venue charges its fee, recorded when the order was placed.
            Read it before the fee figures. `fill`: charged on each fill, based
            on the fill price. `fill_in_game_only`: the same, but only for fills
            while the event is live; pre-game fills are free. `winnings`:
            charged at settlement on net profit, so no venue fee appears on the
            trade; show it as a reduction of the payout. `exit`: charged when
            the position is sold or pays out; opening buys are free. `null`: the
            venue's fee cannot be expressed as a rate, or the order is a limit
            order.
          type: string
          enum:
            - fill
            - fill_in_game_only
            - winnings
            - exit
          nullable: true
        quoted:
          description: What the quote promised when the order was accepted.
          type: object
          required:
            - venueFeeRaw
            - appFeeRaw
            - appFeeBips
            - referralFeeRaw
          properties:
            venueFeeRaw:
              description: >-
                Venue fee budgeted for this order at quote time, including a
                reserve for price movement, so it can exceed the fee shown on
                the quote. An estimate, not what was paid. `null` when no venue
                fee was quoted. USD in 6-decimal atomic units, as an integer
                string (1000000 = $1.00).
              type: string
              nullable: true
            appFeeRaw:
              description: >-
                Maximum app fee for the trade, if it fills 100%. USD in
                6-decimal atomic units, as an integer string (1000000 = $1.00).
              type: string
              nullable: true
            appFeeBips:
              description: App fee rate, in basis points.
              type: integer
              nullable: true
            referralFeeRaw:
              description: >-
                Referral fee at quote time. `null` when the trade has no
                referral. USD in 6-decimal atomic units, as an integer string
                (1000000 = $1.00).
              type: string
              nullable: true
        actual:
          description: >-
            Money that actually moved. `appFee`, `bridge` and `referral` are for
            the whole trade and repeat on every order that shares `dagRunId`:
            de-duplicate by `dagRunId` before summing. `venueFeeRaw` is per
            order.
          type: object
          required:
            - dagRunId
            - venueFeeRaw
            - appFee
            - bridge
            - referral
          properties:
            dagRunId:
              description: >-
                Trade id these fees belong to; `null` until the trade starts
                executing. Every order of a split trade shares it: group by it
                before summing.
              type: string
              nullable: true
            venueFeeRaw:
              description: >-
                Venue fee as reported by the venue, for this order only. `null`
                means the venue did not report one (most venues), not that it
                was free. USD in 6-decimal atomic units, as an integer string
                (1000000 = $1.00).
              type: string
              nullable: true
            appFee:
              description: The app fee actually collected on the trade.
              type: object
              required:
                - bips
                - dueRaw
                - collectedRaw
                - status
              properties:
                bips:
                  description: App fee rate applied, in basis points.
                  type: integer
                dueRaw:
                  description: >-
                    Fee owed: filled amount × `bips` / 10000, rounded down. USD
                    in 6-decimal atomic units, as an integer string (1000000 =
                    $1.00).
                  type: string
                collectedRaw:
                  description: >-
                    Fee actually collected. Below `dueRaw` when
                    `under_collected`; "0" when skipped. USD in 6-decimal atomic
                    units, as an integer string (1000000 = $1.00).
                  type: string
                status:
                  $ref: '#/components/schemas/AppFeeChargeStatus'
              nullable: true
            bridge:
              description: Cross-chain transfer costs for the whole trade, priced in USD.
              type: object
              required:
                - relayFeeUsd
                - originGasCostUsd
                - operationCount
                - pricedOperationCount
              properties:
                relayFeeUsd:
                  description: >-
                    Bridge provider fees for the whole trade. USD, as a decimal
                    string (e.g. "0.231400").
                  type: string
                  nullable: true
                originGasCostUsd:
                  description: >-
                    Network gas on the source chains for the trade's bridges.
                    USD, as a decimal string.
                  type: string
                  nullable: true
                operationCount:
                  description: Number of bridge transfers in the trade.
                  type: integer
                pricedOperationCount:
                  description: >-
                    How many of those had a USD price. When lower than
                    `operationCount`, the USD totals cover only part of the
                    trade.
                  type: integer
              nullable: true
            referral:
              description: The referral payout on the trade.
              type: object
              required:
                - referrer
                - payer
                - feeBips
                - dueRaw
                - paidRaw
                - status
              properties:
                referrer:
                  description: EVM address that receives the referral fee.
                  type: string
                payer:
                  description: 'Who pays the referral fee: the trading `user` or the `app`.'
                  type: string
                  enum:
                    - user
                    - app
                feeBips:
                  description: Referral fee rate, in basis points.
                  type: number
                dueRaw:
                  description: >-
                    Referral fee owed. USD in 6-decimal atomic units, as an
                    integer string (1000000 = $1.00).
                  type: string
                paidRaw:
                  description: >-
                    Referral fee actually paid. USD in 6-decimal atomic units,
                    as an integer string (1000000 = $1.00).
                  type: string
                status:
                  $ref: '#/components/schemas/ReferralPayoutStatus'
              nullable: true
    ErrorMessage:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    AppFeeChargeStatus:
      description: >-
        App fee collection status. `pending`: not yet sent. `submitted`:
        transfer sent, awaiting confirmation. `confirmed`: collected in full.
        `failed`: the transfer failed. `under_collected`: only part of the fee
        could be collected (`collectedRaw` < `dueRaw`). `skipped_no_source`: no
        balance was available to collect from. `skipped_zero`: nothing was due
        (nothing filled, or a 0 bips rate). `skipped_self_custody`: the trade
        was signed by the user's own wallet, so the fee is not collected.
      type: string
      enum:
        - pending
        - submitted
        - confirmed
        - failed
        - under_collected
        - skipped_no_source
        - skipped_zero
        - skipped_self_custody
    ReferralPayoutStatus:
      description: >-
        Referral payout status. `pending`: not yet sent. `submitted`: transfer
        sent, awaiting confirmation. `confirmed`: paid in full. `failed`: the
        transfer failed. `expired`: app-paid only; the app's wallet did not sign
        before the request expired. `skipped`: nothing was sent.
      type: string
      enum:
        - pending
        - submitted
        - confirmed
        - failed
        - expired
        - skipped
  securitySchemes:
    appApiKey:
      type: apiKey
      in: header
      name: x-app-api-key
      description: App-scoped API key for programmatic app management.

````