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

> Your CPL (Cost Per Lead) orders.



## OpenAPI

````yaml GET /cpl/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:
  /cpl/orders:
    get:
      tags:
        - CPL
      summary: Orders
      description: Your CPL (Cost Per Lead) orders.
      operationId: getCplOrders
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - name: order_id
          in: query
          schema:
            type: string
          description: Filter by order public ID
        - name: of_account_id
          in: query
          schema:
            type: integer
          description: Filter by OnlyFans account ID
        - name: status
          in: query
          schema:
            type: string
            enum:
              - waiting
              - accepted
              - rejected
              - completed
              - cancelled
          description: Filter by order status
        - name: offer_id
          in: query
          schema:
            type: integer
          description: >-
            Filter by partner-offer or client-offer numeric id (matches
            `offer_id` field in the response).
        - name: offer_type
          in: query
          schema:
            type: string
            enum:
              - partner
              - client
          description: >-
            Filter by offer kind. `partner` = an offer published by a
            partner/contractor; `client` = your own client offer.
        - name: source
          in: query
          schema:
            type: string
          description: >-
            Filter by traffic source where the campaign is running (e.g.
            `instagram`, `tiktok`, `reddit`). Use `other` to match sources not
            in the standard catalog.
        - name: auto_renewal
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
              - '1'
              - '0'
          description: >-
            When set to `true` / `1`, returns only orders configured for
            auto-renewal.
        - name: slow
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
              - '1'
              - '0'
          description: >-
            When set to `true` / `1`, returns only "slow" orders: active, older
            than 7 days, with fewer than 10 fans subscribed in the last 7 days.
            Useful for spotting orders that need attention.
        - $ref: '#/components/parameters/SinceChangedAt'
        - $ref: '#/components/parameters/UntilChangedAt'
        - name: sort
          in: query
          schema:
            type: string
            enum:
              - created_at_desc
              - created_at_asc
              - changed_at_desc
              - changed_at_asc
              - completed_at_desc
              - arpu_desc
              - romi_desc
              - total_income_desc
              - fans_desc
              - fans_today_desc
            default: created_at_desc
          description: >-
            Sort order.

            - `completed_at_desc`: by campaign end date (most recent first).

            - `arpu_desc`: average revenue per fan, descending.

            - `romi_desc`: return on marketing investment, descending.

            - `total_income_desc`: total income from the campaign, descending.

            - `fans_desc`: total subscribers, descending.

            - `fans_today_desc`: subscribers added since today's midnight UTC
            (real-time).
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CplOrder'
                  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
    SinceChangedAt:
      name: since_changed_at
      in: query
      schema:
        type: integer
        minimum: 0
      description: >-
        Delta-sync filter. Return only rows whose `changed_at` is at or after
        this UNIX timestamp. Pair with `until_changed_at` for a window.
      example: 1738000000
    UntilChangedAt:
      name: until_changed_at
      in: query
      schema:
        type: integer
        minimum: 0
      description: >-
        Delta-sync filter. Return only rows whose `changed_at` is strictly
        before this UNIX timestamp. Useful to lock the upper bound while
        paginating an open delta range.
      example: 1738604800
  schemas:
    CplOrder:
      type: object
      properties:
        order_id:
          type: string
          description: Unique order public ID
          example: cplo_xxxxxxx
        order_number:
          type: integer
          nullable: true
          description: Sequential order number for your account
          example: 42
        offer_id:
          type: integer
          description: Numeric offer id (matches the `offer_id` query parameter).
          example: 1
        offer_type:
          type: string
          enum:
            - partner
            - client
          description: >-
            Offer kind. `partner` = an offer published by a partner/contractor;
            `client` = your own client offer.
          example: partner
        goal:
          type: string
          enum:
            - subscription
            - messages
            - first_purchase
            - paid_subscription
          description: >-
            What the order pays per. Always `subscription` for partner offers.
            Client offers can target other actions:

            - `subscription`: counted on each new subscriber (default).

            - `messages`: fan exchanged at least 3 messages.

            - `first_purchase`: fan made their first paid action (PPV / tip /
            paid post).

            - `paid_subscription`: fan converted from free trial to paid
            subscription.
          example: subscription
        offer_marketer_uuid:
          type: string
          description: Stable UUID of the marketer who published the offer.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        offer_marketer_name:
          type: string
          description: >-
            Marketer's display name. Uses your custom partner display name if
            you've set one.
          example: 🥷 Owen
        of_account_id:
          type: integer
          description: Your OnlyFans account id this order is buying subscribers for.
          example: 123456
        source:
          type: string
          description: >-
            Human-readable traffic source name (e.g. `Reddit`, `Twitter`).
            Matches the source the marketing campaign is actually running on.
          example: Reddit
        quantity_ordered:
          type: integer
          description: Number of goal events (subscribers / messages / etc) ordered.
          example: 50
        quantity_delivered:
          type: integer
          description: Number of goal events delivered so far.
          example: 32
        campaign_url:
          type: string
          description: >-
            Tracking URL the marketer is sending traffic to (OnlyFans campaign /
            trial / shared link).
          example: https://onlyfans.com/.../c...
        price_per_subscriber:
          type: number
          format: float
          description: Agreed price per goal event in USD.
          example: 3.5
        clicks_count:
          type: integer
          description: >-
            Total OnlyFans page visits attributed to this order. Returned only
            for link-based campaigns; trials and smartlinks return 0.
          example: 245
        total_spent:
          type: number
          format: float
          description: >-
            Total amount spent in USD. Active orders show budgeted spend;
            completed orders show delivered spend.
          example: 112
        status:
          type: string
          enum:
            - waiting
            - accepted
            - rejected
            - completed
            - cancelled
          description: Order status
          example: completed
        can_cancel:
          type: boolean
          description: True when the order can still be cancelled.
        auto_renewal:
          type: object
          description: Auto-renewal settings for the order.
          properties:
            enabled:
              type: boolean
              description: Whether auto-renewal is on.
              example: true
            quantity:
              type: integer
              description: Subscribers to repeat per renewal cycle (0 if disabled).
              example: 50
            max_price:
              type: number
              format: float
              description: Maximum price per subscriber the auto-renewal will accept.
              example: 4
        pay_as_you_go:
          type: object
          description: >-
            Incremental billing snapshot. PAYG-on orders pay 20% deposit
            upfront, then chunk by chunk as fans land. PAYG-off orders show
            `paid` matching the full settled amount and `pending = 0`.
          properties:
            enabled:
              type: boolean
              description: True when the order was placed in pay-as-you-go mode.
            paid:
              type: number
              format: float
              description: >-
                Money already pulled from the wallet for this order: prepayment
                + chunks − reverts.
            pending:
              type: number
              format: float
              description: >-
                Money still owed (only meaningful when `enabled=true`). 0 for
                non-PAYG orders.
            payments_count:
              type: integer
              description: >-
                Number of payment rows recorded for this order (use
                `/cpl/payments?order_id=...` to fetch them).
        stats:
          $ref: '#/components/schemas/OrderStats'
        created_at:
          type: string
          format: date-time
          description: Creation date (ISO 8601)
          example: '2026-01-15T12:00:00+00:00'
        created_at_ts:
          type: integer
          description: Creation date as a Unix timestamp
          example: 1736942400
        changed_at:
          type: string
          format: date-time
          description: >-
            Last time anything visible on this order changed: order status,
            payment status, marketing data (new fan, transaction, click), or
            stat recalc. Use with the `since_changed_at` query param for
            delta-sync polling.
          example: '2026-05-05T13:24:30+00:00'
        changed_at_ts:
          type: integer
          description: Last-changed date as a Unix timestamp
          example: 1746450270
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: Completion date (ISO 8601)
          example: '2026-01-20T18:30:00+00:00'
    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.
    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

````