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

# Payments

> Client-side payments across all your CPL orders.



## OpenAPI

````yaml GET /cpl/payments
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/payments:
    get:
      tags:
        - CPL
      summary: Payments
      description: Client-side payments across all your CPL orders.
      operationId: getCplPayments
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - name: order_id
          in: query
          schema:
            type: string
            maxLength: 32
          description: Filter to a single order's payments (e.g. `cplo_xxxxxxx`).
        - name: type
          in: query
          schema:
            type: string
            enum:
              - prepayment
              - chunk
              - postpayment
              - revert
        - $ref: '#/components/parameters/FromDate'
        - $ref: '#/components/parameters/ToDate'
        - name: sort
          in: query
          schema:
            type: string
            enum:
              - date_desc
              - date_asc
              - amount_desc
              - amount_asc
              - order_id_asc
              - order_id_desc
            default: date_desc
          description: |-
            Sort order.
            - `date_desc`: newest payments first (default).
            - `date_asc`: oldest payments first.
            - `amount_desc`: largest amount first.
            - `amount_asc`: smallest amount first.
            - `order_id_asc`: group by order id, ascending.
            - `order_id_desc`: group by order id, descending.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CplPayment'
                  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:
    CplPayment:
      type: object
      description: >-
        Single client-side CPL payment row. Each row is the audit-trail entry
        for money that left the wallet for one CPL order.
      properties:
        order_id:
          type: string
          example: cplo_xxxxxxx
          description: Public id of the owning CPL order.
        type:
          type: string
          enum:
            - prepayment
            - chunk
            - postpayment
            - revert
          description: >-
            What the entry represents. `prepayment` = upfront deposit (20% on
            PAYG, 100% otherwise). `chunk` = incremental charge as fans land
            (PAYG only). `postpayment` = settlement after delivery. `revert` =
            refund on cancel/over-prepay.
        amount:
          type: number
          format: float
          description: >-
            Charge in USD. Always positive; the sign is implied by `type`
            (revert = money flowing back to the wallet).
        quantity:
          type: integer
          nullable: true
          description: >-
            Interpreted by `type`: number of fans for
            prepayment/chunk/postpayment, refund size for revert. Null when not
            applicable.
        wallet_tx_uuid:
          type: string
          format: uuid
          nullable: true
          description: Wallet ledger entry uuid. Null on legacy rows.
        date:
          type: string
          format: date-time
        date_ts:
          type: integer
    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.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key from the Studio Dashboard

````