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

# Get apiv1useraffiliate



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/user/affiliate
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.ekiden.fi/
    description: Production
  - url: https://api.cnt.ekiden.fi/
    description: Testnet
  - url: https://api.canton.ekiden.fi/
    description: Staging
security: []
paths:
  /api/v1/user/affiliate:
    get:
      tags:
        - User
      operationId: get_user_affiliate
      responses:
        '200':
          description: Affiliate dashboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateDashboardResponse'
        '404':
          description: Not an affiliate
      security:
        - bearer_auth: []
components:
  schemas:
    AffiliateDashboardResponse:
      type: object
      description: >-
        `GET /user/affiliate` response (spec §7). Returned only for an
        affiliate; a

        non-affiliate wallet gets 404.
      required:
        - status
        - rates_bps
        - downline
        - weeks
        - pending_usdt
      properties:
        downline:
          $ref: '#/components/schemas/AffiliateDashboardDownline'
        lifetime_paid_usdt_micro:
          type: integer
          format: int64
          description: >-
            Lifetime SETTLED commission — the sum of `amount_usdt_micro` over
            this

            affiliate's `paid` weeks, in integer micro-USDT (6dp). Summed at the

            database so it is exact regardless of the `weeks` page size. Integer

            micro (not the decimal string the sibling money fields use) so the
            client

            can total/compare it without parsing; `0` for an affiliate never
            paid.
        pending_usdt:
          type: string
          description: Total computed-but-unpaid commission across all weeks, decimal USDT.
        rates_bps:
          $ref: '#/components/schemas/AffiliateDashboardRates'
        status:
          type: string
          description: 'Lifecycle status: `active` or `suspended`.'
        volume:
          $ref: '#/components/schemas/AffiliateDashboardVolume'
          description: Per-level downline volume (decimal USDC). Additive + defaulted.
        weeks:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateDashboardWeek'
          description: Weekly commission history, newest week first.
    AffiliateDashboardDownline:
      type: object
      description: >-
        Downline user counts at referral levels 1/2/3 below the affiliate (spec
        §7

        `downline`).
      required:
        - l1
        - l2
        - l3
      properties:
        l1:
          type: integer
          format: int64
          minimum: 0
        l2:
          type: integer
          format: int64
          minimum: 0
        l3:
          type: integer
          format: int64
          minimum: 0
    AffiliateDashboardRates:
      type: object
      description: Positional commission rates in bps (spec §7 `rates_bps`).
      required:
        - l1
        - l2
        - l3
      properties:
        l1:
          type: integer
          format: int32
        l2:
          type: integer
          format: int32
        l3:
          type: integer
          format: int32
    AffiliateDashboardVolume:
      type: object
      description: >-
        Lifetime downline trading volume at levels 1/2/3, as decimal USDC
        strings

        (6dp). Strings because the totals can exceed a JS safe integer.
      required:
        - l1
        - l2
        - l3
      properties:
        l1:
          type: string
        l2:
          type: string
        l3:
          type: string
    AffiliateDashboardWeek:
      type: object
      description: One week of the affiliate's commission history (spec §7 `weeks[]`).
      required:
        - week_start
        - amount_usdt
        - status
        - breakdown
      properties:
        amount_usdt:
          type: string
          description: >-
            This week's commission for the affiliate, decimal USDT (e.g.
            `"412.51"`).
        breakdown:
          description: >-
            Auditable `{l1,l2,l3}:{fees,bps,amount}` split (micro-USDT
            integers).
        paid_at_ms:
          type:
            - integer
            - 'null'
          format: int64
          description: |-
            PAYOUT RECEIPT — when the week was marked `paid`, epoch millis (the
            dashboard's ms convention). `null` while still `computed`.
        status:
          type: string
          description: 'Per-affiliate payout status: `computed` (pending) or `paid`.'
        transfer_ref:
          type:
            - string
            - 'null'
          description: >-
            PAYOUT RECEIPT — the settling transfer's reference (`tb:<id>` on the

            TigerBeetle rail). `null` while the week is still `computed`.
            Additive:

            an older client that ignores it is unaffected.
        week_start:
          type: string
          description: RFC3339 week start (Monday 00:00 UTC).
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````