> ## 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 Referral Earnings

> Paginated history of referral earnings for the authenticated user. Filter by time window or event type.



## OpenAPI

````yaml GET /v1/accounts/referrals/earnings
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/accounts/referrals/earnings:
    get:
      tags:
        - Referrals
      summary: List Referral Earnings
      description: >-
        Paginated history of referral earnings for the authenticated user.
        Filter by time window or event type.
      operationId: get_referral_earnings
      parameters:
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
        - name: interval_days
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            example: 30
          description: Only return earnings created in the last N days.
        - name: event_type
          in: query
          required: false
          schema:
            type: string
            enum:
              - DEPOSIT
              - TRADE
              - SIGNUP
              - VERIFICATION
              - ORDER
              - WIN
          description: Filter by the event that triggered the earning.
      responses:
        '200':
          description: List of referral earnings
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReferralEarningResponse'
              example:
                - id: 501
                  amount: '3.00'
                  currency: PT
                  event_type: DEPOSIT
                  referred_account_id: 1001
                  created_at: '2026-05-10T14:23:00+00:00'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Not authenticated
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - apiKey: []
components:
  schemas:
    ReferralEarningResponse:
      type: object
      title: ReferralEarningResponse
      properties:
        id:
          type: integer
          description: Unique earning record ID.
        amount:
          type: string
          example: '3.00'
          description: >-
            Amount earned in this single referral earning event (in the currency
            field's denomination).
        currency:
          type: string
          example: PT
          description: Currency of this earning. Typically PT (Predicta Token).
        event_type:
          type: string
          nullable: true
          description: >-
            The qualifying action performed by the referred user that triggered
            this earning (e.g. DEPOSIT, TRADE).
        referred_account_id:
          type: integer
          nullable: true
          description: ID of the referred account whose action triggered this earning.
        created_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when this earning was credited.
      required:
        - id
        - amount
        - currency
      description: >-
        A single referral earning record — one commission or bonus credited to
        the account because a referred user completed a qualifying action
        (deposit, trade, signup, etc.).
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
      required:
        - detail
      title: ErrorResponse
  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

````