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

# Invoice details

> Pricing breakdown plus per-transaction trail and refunds for one invoice.



## OpenAPI

````yaml GET /revshare/invoices/{public_id}
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:
  /revshare/invoices/{public_id}:
    get:
      tags:
        - RevShare
      summary: Invoice details
      description: >-
        Pricing breakdown plus per-transaction trail and refunds for one
        invoice.
      operationId: getRevshareInvoice
      parameters:
        - $ref: '#/components/parameters/PublicIdPath'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/RevshareInvoiceDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Invoice not found
          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:
    PublicIdPath:
      name: public_id
      in: path
      required: true
      schema:
        type: string
        pattern: ^[a-z0-9_]+$
      description: >-
        Resource public id. Format varies by endpoint: `cplo_xxxxxxx` for CPL
        orders, `cpco_xxxxxxx` for CPC orders, `swpo_xxxxxxx` for swap orders,
        `cpcr_xxxxxxx` for CPC creatives, `revi_xxxxxxx` for RevShare invoices.
      example: cplo_xxxxxxx
  schemas:
    RevshareInvoiceDetails:
      type: object
      description: RevShare invoice with full pricing breakdown and per-transaction trail.
      properties:
        id:
          type: string
        account:
          $ref: '#/components/schemas/Account'
        status:
          type: string
          enum:
            - paid
            - new
            - processing
            - cancelled
        price:
          type: number
          format: float
          description: Original (pre-discount) invoice amount.
        your_price:
          type: number
          format: float
          description: Amount you owe after your tier discount.
        your_discount:
          type: number
          format: float
          description: '`price − your_price`.'
        service_fee:
          type: number
          format: float
          description: Platform commission added on top.
        final_price:
          type: number
          format: float
          description: >-
            What is actually pulled from your wallet: `your_price +
            service_fee`.
        date:
          type: string
          format: date-time
          nullable: true
        date_ts:
          type: integer
          nullable: true
        transactions:
          type: array
          description: Transactions that contributed to this invoice.
          items:
            type: object
            properties:
              of_transaction_id:
                type: string
              of_user_id:
                type: integer
              invoice_amount:
                type: number
                format: float
              date:
                type: string
                format: date-time
                nullable: true
        refunds:
          type: array
          description: >-
            Refund / chargeback rows applied against the invoice. Same shape as
            `transactions`; `invoice_amount` is the refund amount.
          items:
            type: object
            properties:
              of_transaction_id:
                type: string
              of_user_id:
                type: integer
              invoice_amount:
                type: number
                format: float
              date:
                type: string
                format: date-time
                nullable: 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.
    Account:
      type: object
      description: Standard mini-block referencing one of your OnlyFans accounts.
      properties:
        of_account_id:
          type: integer
        username:
          type: string
          nullable: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key from the Studio Dashboard

````