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

# Income Stats

> Earnings per pricing model — all-time (`total`), last 30 days (`monthly`, fixed window regardless of `from`/`to`), not-yet-released (`pending`) — plus a daily dataset.

The `ppc` block is present only when you have PPC offers.

Cached for 15 minutes.

How much you've earned, split by pricing model. This is the same data as the **Income** widget in the partner dashboard.

The response has the panels `total`, `revshare`, `cpl` and, only if you have PPC offers, `ppc`. Each panel contains:

| Field     | Description                                                                  |
| --------- | ---------------------------------------------------------------------------- |
| `total`   | All-time earnings                                                            |
| `monthly` | Earnings in the last 30 days. This window is fixed and ignores `from` / `to` |
| `pending` | Earnings that haven't been released yet                                      |
| `dataset` | Day-by-day earnings for the `from` / `to` period                             |

## Period

`from` and `to` accept a Unix timestamp or a `Y-m-d` date.

* Default: the last 14 days.
* Maximum range: 366 days.
* A `to` date in the future is treated as now.

The period only affects `dataset`. The `total`, `monthly` and `pending` values stay the same whatever period you pass.

<Info>Responses are cached for 15 minutes.</Info>


## OpenAPI

````yaml api/openapi-partners.json GET /api/marketer/stats/income
openapi: 3.0.2
info:
  title: OnlyTraffic Marketer API
  version: 2.0.0
  description: >-
    Partner (marketer) API for OnlyTraffic.


    **Authentication:** pass your API key in the `Authorization` header.


    **Pagination:** all list endpoints accept `offset` (default 0) and `limit`
    (default 50, max 1000) as query parameters or JSON body fields.


    **Dates:** every timestamp field has two variants — an ISO 8601 string
    (`*_at`) and a Unix timestamp integer (`*_at_ts` / `*_ts`).


    **Legacy endpoints** (`?do=…`) are still available for backward
    compatibility but are not extended further.
servers:
  - url: https://partner.onlytraffic.com
security: []
tags:
  - name: RevShare
    description: RevShare campaigns and financial data
  - name: CPL
    description: Cost-Per-Lead orders placed against your offers
  - name: CPC
    description: Cost-Per-Click orders
  - name: Subscribers
    description: Fans acquired through your campaigns
  - name: Stats
    description: Dashboard-style statistics widgets (fans, income, conversion)
  - name: Legacy
    description: Old `?do=` endpoints kept for backward compatibility
paths:
  /api/marketer/stats/income:
    get:
      tags:
        - Stats
      summary: Income statistics
      description: >-
        Earnings per pricing model — all-time (`total`), last 30 days
        (`monthly`, fixed window regardless of `from`/`to`), not-yet-released
        (`pending`) — plus a daily dataset.


        The `ppc` block is present only when you have PPC offers.


        Cached for 15 minutes.
      parameters:
        - $ref: '#/components/parameters/stats_from'
        - $ref: '#/components/parameters/stats_to'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                oneOf:
                  - title: Success
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - success
                      data:
                        $ref: '#/components/schemas/StatsIncome'
                  - $ref: '#/components/schemas/ErrorResponse'
              example:
                status: success
                data:
                  revshare:
                    total: 10250.4
                    monthly: 1200.75
                    pending: 340.2
                    dataset:
                      - date: '2026-07-15'
                        amount: 42.1
                      - date: '2026-07-16'
                        amount: 55.8
                    label: RevShare
                  cpl:
                    total: 4820
                    monthly: 960.5
                    pending: 250
                    dataset:
                      - date: '2026-07-15'
                        amount: 19
                      - date: '2026-07-16'
                        amount: 104
                    label: CPL
                  total:
                    total: 15070.4
                    monthly: 2161.25
                    pending: 590.2
                    dataset:
                      - date: '2026-07-15'
                        amount: 61.1
                      - date: '2026-07-16'
                        amount: 159.8
                    label: Total
      security:
        - api_key: []
components:
  parameters:
    stats_from:
      name: from
      in: query
      schema:
        oneOf:
          - type: integer
          - type: string
            format: date
        example: '2026-06-01'
      description: >-
        Dataset period start — unix timestamp or Y-m-d. Default: 14 days ago.
        Max range: 366 days.
    stats_to:
      name: to
      in: query
      schema:
        oneOf:
          - type: integer
          - type: string
            format: date
        example: '2026-07-01'
      description: >-
        Dataset period end — unix timestamp or Y-m-d. Default: now (values in
        the future are clamped to now).
  schemas:
    StatsIncome:
      type: object
      description: >-
        Income widget data, one panel per pricing model. `ppc` is present only
        when the marketer has PPC offers.
      properties:
        total:
          $ref: '#/components/schemas/StatsIncomePanel'
        revshare:
          $ref: '#/components/schemas/StatsIncomePanel'
        cpl:
          $ref: '#/components/schemas/StatsIncomePanel'
        ppc:
          $ref: '#/components/schemas/StatsIncomePanel'
    ErrorResponse:
      title: Error
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Human-readable error description.
        error_code:
          type: integer
          description: '422: bad request params. 404: not found. 429: rate limit exceeded.'
    StatsIncomePanel:
      type: object
      properties:
        total:
          type: number
          description: All-time earnings.
        monthly:
          type: number
          description: Earnings in the last 30 days (fixed window).
        pending:
          type: number
          description: Earnings not yet released.
        dataset:
          type: array
          description: One entry per day of the requested period.
          items:
            type: object
            properties:
              date:
                type: string
                format: date
              amount:
                type: number
        label:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header

````