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

# Orders



## OpenAPI

````yaml GET /swaps/orders
openapi: 3.0.3
info:
  title: OnlyTraffic Studio API
  version: 1.0.0
  description: >-
    External API for OnlyTraffic Studio. Manage and retrieve data about your
    subscribers, CPL orders, and CPC orders.
servers:
  - url: https://studio-api.onlytraffic.com/api/external/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Account
    description: API key holder's wallet, profile, and aggregate state.
  - name: Accounts
    description: OnlyFans accounts attached to the API key holder.
  - name: Agencies
    description: Agency CRUD and image management. All edits stage in moderation.
  - name: CPL
    description: >-
      Cost-per-lead orders: place, list, cancel, manage settings, browse partner
      offers.
  - name: CPC
    description: Cost-per-click orders and creative management.
  - name: RevShare
    description: Revenue-share campaigns and invoices.
  - name: Swaps
    description: Two-sided traffic swap orders and offers.
  - name: Subscribers
    description: Per-fan delivery feed (cursor-paginated).
  - name: Transactions
    description: Per-transaction OF revenue feed (cursor-paginated).
paths:
  /swaps/orders:
    get:
      tags:
        - Swaps
      summary: Your swap orders.
      operationId: listSwapOrders
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - name: order_id
          in: query
          schema:
            type: string
          description: Filter by exact public id (`swpo_xxxxxxx`).
        - name: offer_id
          in: query
          schema:
            type: integer
        - name: of_account_id
          in: query
          schema:
            type: integer
          description: Match orders where this OF account appears on either side.
        - name: role
          in: query
          schema:
            type: string
            enum:
              - offer
              - order
          description: >-
            `offer` = orders placed against your offers; `order` = orders you
            placed.
        - name: status
          in: query
          schema:
            type: string
            enum:
              - waiting
              - accepted
              - rejected
              - completed
              - cancelled
        - $ref: '#/components/parameters/FromDate'
        - $ref: '#/components/parameters/ToDate'
        - name: sort
          in: query
          schema:
            type: string
            enum:
              - created_at_desc
              - created_at_asc
              - completed_at_desc
              - completed_at_asc
            default: created_at_desc
          description: >-
            Sort order.

            - `created_at_desc`: newest orders first (default).

            - `created_at_asc`: oldest orders first.

            - `completed_at_desc`: most recently completed first. NULL
            `completed_at` (still running / not completed) always sorts to the
            bottom regardless of direction.

            - `completed_at_asc`: earliest completed first. NULL `completed_at`
            always at the bottom.
      responses:
        '200':
          description: Paged list of swap orders.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SwapOrder'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: >-
            Server error. Body always reads `{success:false,
            error:"server_error", message:"Server error"}` (no internal details
            leak).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    Page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number, 1-indexed.
      example: 1
    PageSize:
      name: page_size
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 50
      description: Items per page. Default 50, max 100.
      example: 50
    FromDate:
      name: from
      in: query
      schema:
        type: string
        format: date
      description: Lower bound on the resource date (`YYYY-MM-DD`, UTC, inclusive).
      example: '2026-01-01'
    ToDate:
      name: to
      in: query
      schema:
        type: string
        format: date
      description: Upper bound on the resource date (`YYYY-MM-DD`, UTC, inclusive).
      example: '2026-01-31'
  schemas:
    SwapOrder:
      type: object
      description: >-
        Swap order you are involved in, either as the offer owner who received
        the order or as the buyer who placed it. ROMI in the per-side `stats`
        block is intentionally `null` for swaps (the trade is fan-for-fan with
        no per-fan price equivalent to CPL).
      properties:
        order_id:
          type: string
          example: swpo_xxxxxxx
        offer_id:
          type: integer
        quantity:
          type: integer
          description: Number of fans agreed for this order.
        max_days:
          type: integer
          nullable: true
          description: Hard deadline for the order in days.
        status:
          type: string
          enum:
            - waiting
            - accepted
            - rejected
            - completed
            - cancelled
        guaranteed_price:
          type: number
          format: float
          description: >-
            Per-fan guaranteed price floor agreed at order time (USD). No
            platform commission on top: `guaranteed_price × quantity` is the
            buyer's total cost.
        stats_public_arpu:
          type: boolean
          description: >-
            When true, ARPU and income are visible on both sides regardless of
            ownership.
        is_offer_mine:
          type: boolean
        is_order_mine:
          type: boolean
        offer_side:
          $ref: '#/components/schemas/SwapOrderSide'
        order_side:
          $ref: '#/components/schemas/SwapOrderSide'
        created_at:
          type: string
          format: date-time
          nullable: true
        created_at_ts:
          type: integer
          nullable: true
        started_at:
          type: string
          format: date-time
          nullable: true
          description: When the order's campaign went live.
        started_at_ts:
          type: integer
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        completed_at_ts:
          type: integer
          nullable: true
    Pagination:
      type: object
      description: >-
        Page-based pagination, returned by every list endpoint that isn't a
        cursor feed.
      properties:
        page:
          type: integer
          description: Current page number (1-indexed).
          example: 1
        page_size:
          type: integer
          description: Number of items per page. Default 50, max 100.
          example: 50
        total:
          type: integer
          description: Total number of records matching the filters.
          example: 150
        total_pages:
          type: integer
          description: Total pages available.
          example: 3
        has_next:
          type: boolean
          description: >-
            `true` when `page < total_pages` (i.e. there is at least one more
            page to fetch).
          example: true
    ErrorResponse:
      type: object
      description: Standard error envelope for all 4xx/5xx responses.
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always false on error responses.
        error:
          type: string
          description: Stable snake_case machine-readable error code. Branch on this.
          example: validation_failed
        message:
          type: string
          description: >-
            Human-friendly text. For 5xx this is always the literal `Server
            error`. For 4xx an actionable validation/auth message is returned.
        details:
          type: object
          nullable: true
          description: >-
            Optional per-field diagnostic information. On 422 carries `{<field>:
            ["error_code", ...]}`. On 402 (`insufficient_balance`) carries
            `{required, current}`. On 426 (`unpaid_invoices`) carries `{count,
            total, oldest_date_ts}`. Absent on most other errors.
          additionalProperties: true
        retry_after:
          type: integer
          nullable: true
          description: >-
            Seconds until the next request will succeed. Present only on 429
            responses (rate limit). Mirrors the `Retry-After` HTTP header.
    SwapOrderSide:
      type: object
      description: >-
        One side of a swap order: either the offer owner's slot (`offer_side`)
        or the buyer's slot (`order_side`). The marketing campaign attached to
        the side is the campaign run on that side's model. Income / ARPU fields
        under `stats` are nulled when the caller is not allowed to see them
        (i.e. when the side is not yours and the order owner has not opted in
        via `stats_public_arpu`).
      properties:
        is_mine:
          type: boolean
          description: True when this side runs on a model linked to your account.
        model:
          type: object
          nullable: true
          properties:
            of_account_id:
              type: integer
            username:
              type: string
              nullable: true
            performer_top:
              type: integer
              nullable: true
            subscribe_price:
              type: number
              format: float
        campaign_link:
          type: string
          format: uri
          nullable: true
          description: >-
            Outbound OnlyFans URL (campaign link / trial link / shared link).
            `null` until the campaign is live.
        stats:
          $ref: '#/components/schemas/OrderStats'
    OrderStats:
      type: object
      nullable: true
      description: >-
        Unified delivery-stats block used by /cpl/orders, /cpc/orders,
        /revshare/campaigns and /swaps/orders. `null` when the resource has no
        marketing data yet, or when the income side is hidden (swaps without
        `stats_public_arpu`).
      properties:
        fans_subscribed:
          type: object
          properties:
            total:
              type: integer
            today:
              type: integer
        transactions_sum:
          type: object
          nullable: true
          description: >-
            Sum of OnlyFans transactions on this resource's fans, USD. `null` on
            swap orders where the income side is hidden.
          properties:
            total:
              type: number
              format: float
            today:
              type: number
              format: float
        arpu:
          type: number
          format: float
          nullable: true
          description: >-
            transactions_sum.total / fans_subscribed.total. `null` when income
            is hidden.
        arpu_paying:
          type: number
          format: float
          nullable: true
          description: >-
            ARPU restricted to fans who paid at least once. `null` when income
            is hidden.
        romi:
          type: integer
          nullable: true
          description: >-
            ((transactions_sum.total / cost) - 1) * 100. `null` for revshare or
            when cost is 0.
        pay_subscribe:
          $ref: '#/components/schemas/OrderStatsBucket'
          description: Fans on an initial paid subscription.
        pay_resubscribe:
          $ref: '#/components/schemas/OrderStatsBucket'
          description: Fans on a recurring paid subscription.
        purchases_1:
          $ref: '#/components/schemas/OrderStatsBucket'
          description: Fans who made ≥ 1 paid purchase.
        purchases_2:
          $ref: '#/components/schemas/OrderStatsBucket'
          description: Fans who made ≥ 2 paid purchases.
        purchases_5:
          $ref: '#/components/schemas/OrderStatsBucket'
          description: Fans who made ≥ 5 paid purchases.
        whale:
          $ref: '#/components/schemas/OrderStatsBucket'
          description: Fans who spent ≥ $500 lifetime.
        messages_3:
          $ref: '#/components/schemas/OrderStatsBucket'
          description: Fans who exchanged ≥ 3 messages.
    OrderStatsBucket:
      type: object
      properties:
        total:
          type: integer
          description: Lifetime count.
        today:
          type: integer
          description: Added since today's midnight (server time).
        percent:
          type: number
          format: float
          description: '`total / fans_subscribed.total * 100`.'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key from the Studio Dashboard

````