openapi: 3.0.3
info:
  title: Everflow Affiliate API - Reporting
  description: >
    Reporting endpoints for the Everflow Affiliate API. These endpoints are
    accessed by affiliate/partner users using their own API key and return
    data scoped to the authenticated affiliate's account only.
    For more detail, see [Essential Reports For New Partners](https://helpdesk.everflow.io/collaborator/essential-reports-for-new-partners) in the Help Center.
  version: 1.0.0
servers:
  - description: Production Server
    url: https://api.eflow.team/v1
tags:
  - name: Affiliate Reporting
    description: Reporting endpoints available to affiliate users.
paths:
  /affiliates/reporting/entity/table:
    post:
      summary: Get Aggregated Reporting Data
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              currency_id: "USD"
              columns:
                - column: "offer"
              query:
                filters: []
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - currency_id
                - columns
              properties:
                from:
                  type: string
                  description: Start date for the reporting period. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date for the reporting period. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the request.
                currency_id:
                  type: string
                  description: Currency code for monetary values (e.g. "USD").
                columns:
                  type: array
                  minItems: 1
                  maxItems: 10
                  description: >
                    Columns to group/pivot data by. Minimum 1, maximum 10. Only one
                    time column (hour, date, week, month, year) is allowed per request.
                  items:
                    type: object
                    required:
                      - column
                    properties:
                      column:
                        type: string
                        enum:
                          - offer
                          - creative
                          - coupon_code
                          - offer_url
                          - country
                          - country_code
                          - region
                          - city
                          - dma
                          - carrier
                          - platform
                          - isp
                          - os_version
                          - device_type
                          - device_model
                          - device_make
                          - browser
                          - language
                          - sub1
                          - sub2
                          - sub3
                          - sub4
                          - sub5
                          - sub6
                          - sub7
                          - sub8
                          - sub9
                          - sub10
                          - source_id
                          - referer
                          - event_name
                          - connection_type
                          - campaign
                          - campaign_id
                          - tracking_domain
                          - hour
                          - date
                          - week
                          - month
                          - year
                        description: >
                          The dimension to group by. Time columns (hour, date, week,
                          month, year) are mutually exclusive — only one allowed at a time.
                query:
                  type: object
                  description: Query configuration.
                  properties:
                    filters:
                      type: array
                      description: >
                        Filters to narrow results. Same resource_type filters use OR
                        logic; different resource_type filters use AND logic.
                      items:
                        type: object
                        required:
                          - filter_id_value
                          - resource_type
                        properties:
                          filter_id_value:
                            type: string
                            description: The value to filter on (e.g. offer ID, country name, sub value).
                          resource_type:
                            type: string
                            enum:
                              - offer
                              - creative
                              - country
                              - country_code
                              - sub1
                              - sub2
                              - sub3
                              - sub4
                              - sub5
                              - sub6
                              - sub7
                              - sub8
                              - sub9
                              - sub10
                              - carrier
                              - device_platform
                              - device_type
                              - device_make
                              - browser
                              - language
                              - connection_type
                              - campaign
                              - source_id
                              - offer_url
                              - device_model
                              - os_version
                              - coupon_code
                            description: The resource type / dimension to filter on.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  table:
                    type: array
                    description: Array of reporting data rows.
                    items:
                      type: object
                      properties:
                        columns:
                          type: array
                          description: Dimension values for this row.
                          items:
                            type: object
                            properties:
                              column_type:
                                type: string
                                description: The column/dimension type (matches the requested column value).
                              id:
                                type: string
                                description: Dimension value identifier (e.g. offer ID, country name).
                              label:
                                type: string
                                description: Human-readable label for the dimension value.
                        reporting:
                          type: object
                          description: Aggregated metrics for this row.
                          properties:
                            imp:
                              type: integer
                              description: Impression count.
                            total_click:
                              type: integer
                              description: Total click count.
                            unique_click:
                              type: integer
                              description: Unique click count.
                            invalid_click:
                              type: integer
                              description: Invalid/filtered click count.
                            duplicate_click:
                              type: integer
                              description: Duplicate click count.
                            ctr:
                              type: number
                              description: Click-through rate (impressions to clicks).
                            cv:
                              type: integer
                              description: Conversion count.
                            view_through_cv:
                              type: integer
                              description: View-through conversion count.
                            event:
                              type: integer
                              description: Post-conversion event count.
                            cvr:
                              type: number
                              description: Conversion rate (percentage).
                            evr:
                              type: number
                              description: Event rate.
                            rpc:
                              type: number
                              description: Revenue per click.
                            rpm:
                              type: number
                              description: Revenue per mille (per 1,000 impressions).
                            revenue:
                              type: number
                              description: Total revenue (affiliate payout amount).
                            redirect_traffic_revenue:
                              type: number
                              description: Revenue from redirect/fallback traffic.
                            on_hold_conversion_count:
                              type: integer
                              description: Number of conversions currently on hold.
                            on_hold_potential_revenue:
                              type: number
                              description: Potential revenue from on-hold conversions.
      security:
        - API Key: []

  /affiliates/dashboard/summary:
    post:
      summary: Dashboard Summary
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              timezone_id: 67
              currency_id: "USD"
            schema:
              type: object
              required:
                - timezone_id
              properties:
                timezone_id:
                  type: integer
                  description: Timezone identifier for the summary calculations.
                from:
                  type: string
                  description: Optional start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: Optional end date. Format `YYYY-MM-DD`.
                currency_id:
                  type: string
                  description: Currency code for monetary values (e.g. "USD").
                compare_from:
                  type: string
                  description: Optional comparison start date. Format `YYYY-MM-DD`.
                compare_to:
                  type: string
                  description: Optional comparison end date. Format `YYYY-MM-DD`.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  revenue:
                    $ref: "#/components/schemas/DashboardMetric"
                  click:
                    $ref: "#/components/schemas/DashboardMetric"
                  conversion:
                    $ref: "#/components/schemas/DashboardMetric"
                  cvr:
                    $ref: "#/components/schemas/DashboardMetricNoTrend"
                  events:
                    $ref: "#/components/schemas/DashboardMetric"
                  evr:
                    $ref: "#/components/schemas/DashboardMetricNoTrend"
                  impression:
                    $ref: "#/components/schemas/DashboardMetric"
                  redirect_revenue:
                    $ref: "#/components/schemas/DashboardMetric"
                  on_hold_potential_revenue:
                    $ref: "#/components/schemas/DashboardMetric"
                  on_hold_conversion_count:
                    $ref: "#/components/schemas/DashboardMetric"
      security:
        - API Key: []

  /affiliates/reporting/clicks/{transactionId}:
    get:
      summary: Get Click By ID
      description: >
        Returns full details for a single click by its transaction ID.
      tags:
        - Affiliate Reporting
      parameters:
        - name: transactionId
          in: path
          required: true
          description: The transaction ID of the click.
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction_id:
                    type: string
                    description: Unique transaction identifier.
                  is_unique:
                    type: integer
                  unix_timestamp:
                    type: integer
                  tracking_url:
                    type: string
                  source_id:
                    type: string
                  sub1:
                    type: string
                  sub2:
                    type: string
                  sub3:
                    type: string
                  sub4:
                    type: string
                  sub5:
                    type: string
                  sub6:
                    type: string
                  sub7:
                    type: string
                  sub8:
                    type: string
                  sub9:
                    type: string
                  sub10:
                    type: string
                  revenue_type:
                    type: string
                  revenue:
                    type: number
                  user_ip:
                    type: string
                  error_code:
                    type: integer
                  error_message:
                    type: string
                  currency_id:
                    type: string
                  coupon_code:
                    type: string
                  idfa:
                    type: string
                  idfa_md5:
                    type: string
                  idfa_sha1:
                    type: string
                  google_ad_id:
                    type: string
                  google_ad_id_md5:
                    type: string
                  google_ad_id_sha1:
                    type: string
                  android_id:
                    type: string
                  android_id_md5:
                    type: string
                  android_id_sha1:
                    type: string
                  relationship:
                    type: object
                    properties:
                      offer:
                        type: object
                        properties:
                          network_offer_id:
                            type: integer
                          network_id:
                            type: integer
                          network_tracking_domain_id:
                            type: integer
                          name:
                            type: string
                          offer_status:
                            type: string
                      geolocation:
                        type: object
                        properties:
                          country_code:
                            type: string
                          country_name:
                            type: string
                          region_code:
                            type: string
                          region_name:
                            type: string
                          city_name:
                            type: string
                          dma:
                            type: integer
                          dma_name:
                            type: string
                          carrier_name:
                            type: string
                          carrier_code:
                            type: integer
                          isp_name:
                            type: string
                          organization:
                            type: string
                          postal_code:
                            type: string
                          timezone:
                            type: string
                          is_mobile:
                            type: boolean
                          is_proxy:
                            type: boolean
                      device_information:
                        type: object
                        properties:
                          is_mobile:
                            type: boolean
                          platform_name:
                            type: string
                          os_version:
                            type: string
                          brand:
                            type: string
                          model:
                            type: string
                          is_tablet:
                            type: boolean
                          browser_name:
                            type: string
                          browser_version:
                            type: string
                          device_type:
                            type: string
                          language:
                            type: string
                          http_accept_language:
                            type: string
                          is_robot:
                            type: boolean
                          is_filter:
                            type: boolean
                      query_parameters:
                        type: object
        "404":
          description: Click not found.
      security:
        - API Key: []
  /affiliates/reporting/clicks/stream:
    post:
      summary: Raw Clicks Stream
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01 00:00:00"
              to: "2026-03-14 23:59:59"
              timezone_id: 90
              query:
                filters:
                  - filter_id_value: "882"
                    resource_type: "offer"
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
              properties:
                from:
                  type: string
                  description: "Start date (format: `YYYY-MM-DD HH:mm:SS`)."
                to:
                  type: string
                  description: "End date (format: `YYYY-MM-DD HH:mm:SS`). Maximum 14 days from start."
                timezone_id:
                  type: integer
                  description: Timezone ID for the request.
                query:
                  type: object
                  description: Optional filters.
                  properties:
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          filter_id_value:
                            type: string
                            description: The value to filter by.
                          resource_type:
                            type: string
                            enum:
                              - offer
                              - creative
                              - country
                              - carrier
                              - device_platform
                              - device_type
                              - device_make
                              - browser
                              - language
                              - connection_type
                              - campaign
                              - source_id
                              - offer_url
                              - device_model
                              - s1
                              - s2
                              - s3
                              - s4
                              - s5
                              - coupon_code
                            description: The dimension to filter on.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  clicks:
                    type: array
                    description: >-
                      Array of click records. NOTE: this key is named `clicks` on a populated response; the endpoint emits `table` only when the result set is empty (`{"table": []}`). Handle both.
                    items:
                      type: object
                      properties:
                        transaction_id:
                          type: string
                          description: Unique 32-character transaction identifier.
                        is_unique:
                          type: integer
                          description: 1 if unique click, 0 if duplicate.
                        unix_timestamp:
                          type: integer
                        tracking_url:
                          type: string
                        source_id:
                          type: string
                        sub1:
                          type: string
                        sub2:
                          type: string
                        sub3:
                          type: string
                        sub4:
                          type: string
                        sub5:
                          type: string
                        sub6:
                          type: string
                        sub7:
                          type: string
                        sub8:
                          type: string
                        sub9:
                          type: string
                        sub10:
                          type: string
                        revenue_type:
                          type: string
                        revenue:
                          type: number
                        referer:
                          type: string
                        error_code:
                          type: integer
                        user_ip:
                          type: string
                        error_message:
                          type: string
                        currency_id:
                          type: string
                        coupon_code:
                          type: string
                        idfa:
                          type: string
                        idfa_md5:
                          type: string
                        idfa_sha1:
                          type: string
                        google_ad_id:
                          type: string
                        google_ad_id_md5:
                          type: string
                        google_ad_id_sha1:
                          type: string
                        android_id:
                          type: string
                        android_id_md5:
                          type: string
                        android_id_sha1:
                          type: string
                        relationship:
                          type: object
                          properties:
                            offer:
                              type: object
                              properties:
                                network_offer_id:
                                  type: integer
                                network_id:
                                  type: integer
                                network_tracking_domain_id:
                                  type: integer
                                name:
                                  type: string
                                offer_status:
                                  type: string
                            geolocation:
                              type: object
                              properties:
                                country_code:
                                  type: string
                                country_name:
                                  type: string
                                region_code:
                                  type: string
                                region_name:
                                  type: string
                                city_name:
                                  type: string
                                dma:
                                  type: integer
                                dma_name:
                                  type: string
                                carrier_name:
                                  type: string
                                carrier_code:
                                  type: integer
                                isp_name:
                                  type: string
                                organization:
                                  type: string
                                postal_code:
                                  type: string
                                timezone:
                                  type: string
                                is_mobile:
                                  type: boolean
                                is_proxy:
                                  type: boolean
                            device_information:
                              type: object
                              properties:
                                is_mobile:
                                  type: boolean
                                platform_name:
                                  type: string
                                os_version:
                                  type: string
                                brand:
                                  type: string
                                model:
                                  type: string
                                is_tablet:
                                  type: boolean
                                browser_name:
                                  type: string
                                browser_version:
                                  type: string
                                device_type:
                                  type: string
                                language:
                                  type: string
                                http_accept_language:
                                  type: string
                                is_robot:
                                  type: boolean
                                is_filter:
                                  type: boolean
                            query_parameters:
                              type: object
      security:
        - API Key: []

  /affiliates/reporting/conversions:
    post:
      summary: Conversion Report
      tags:
        - Affiliate Reporting
      parameters:
        - in: query
          name: page
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
          description: The page of results to retrieve.
        - in: query
          name: page_size
          required: false
          schema:
            type: integer
            minimum: 1
            default: 50
          description: The number of results to return per page.
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              show_conversions: true
              show_events: true
              query:
                filters: []
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`. Must be within the last 365 days.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`. Must be within the last 365 days.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the date range.
                show_conversions:
                  type: boolean
                  description: >
                    Must be explicitly set to `true` to include conversion records
                    in the response. Does not default to true — omitting this field
                    will return no conversions.
                show_events:
                  type: boolean
                  description: Include post-conversion event records in the response.
                  default: false
                query:
                  type: object
                  description: Query configuration with optional filters.
                  properties:
                    filters:
                      type: array
                      description: Filters to narrow results.
                      items:
                        type: object
                        properties:
                          filter_id_value:
                            type: string
                          resource_type:
                            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  conversions:
                    type: array
                    description: Array of conversion/event records.
                    items:
                      type: object
                      properties:
                        conversion_id:
                          type: string
                          description: Unique conversion identifier.
                        transaction_id:
                          type: string
                          description: Associated click transaction ID.
                        conversion_unix_timestamp:
                          type: integer
                          description: Unix timestamp of the conversion.
                        click_unix_timestamp:
                          type: integer
                          description: Unix timestamp of the associated click.
                        revenue:
                          type: number
                          description: Revenue for the conversion.
                        sale_amount:
                          type: number
                          description: Sale amount (for revenue share offers).
                        event:
                          type: string
                          description: Event name (for post-conversion events).
                        is_event:
                          type: boolean
                          description: Whether this record is an event.
                        source_id:
                          type: string
                        revenue_type:
                          type: string
                        sub1:
                          type: string
                        sub2:
                          type: string
                        sub3:
                          type: string
                        sub4:
                          type: string
                        sub5:
                          type: string
                        sub6:
                          type: string
                        sub7:
                          type: string
                        sub8:
                          type: string
                        sub9:
                          type: string
                        sub10:
                          type: string
                        adv1:
                          type: string
                        adv2:
                          type: string
                        adv3:
                          type: string
                        adv4:
                          type: string
                        adv5:
                          type: string
                        adv6:
                          type: string
                        adv7:
                          type: string
                        adv8:
                          type: string
                        adv9:
                          type: string
                        adv10:
                          type: string
                        session_user_ip:
                          type: string
                        conversion_user_ip:
                          type: string
                        country:
                          type: string
                        region:
                          type: string
                        city:
                          type: string
                        dma:
                          type: integer
                        carrier:
                          type: string
                        isp:
                          type: string
                        platform:
                          type: string
                        os_version:
                          type: string
                        device_type:
                          type: string
                        brand:
                          type: string
                        browser:
                          type: string
                        language:
                          type: string
                        http_user_agent:
                          type: string
                        referer:
                          type: string
                        app_id:
                          type: string
                        idfa:
                          type: string
                        idfa_md5:
                          type: string
                        idfa_sha1:
                          type: string
                        google_ad_id:
                          type: string
                        google_ad_id_md5:
                          type: string
                        google_ad_id_sha1:
                          type: string
                        android_id:
                          type: string
                        android_id_md5:
                          type: string
                        android_id_sha1:
                          type: string
                        currency_id:
                          type: string
                        is_view_through:
                          type: boolean
                        order_id:
                          type: string
                        coupon_code:
                          type: string
                        relationship:
                          type: object
                          properties:
                            offer:
                              type: object
                              properties:
                                network_offer_id:
                                  type: integer
                                network_id:
                                  type: integer
                                network_tracking_domain_id:
                                  type: integer
                                name:
                                  type: string
                                offer_status:
                                  type: string
                            events_count:
                              type: integer
                              description: Number of post-conversion events associated with this conversion.
                  paging:
                    type: object
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total_count:
                        type: integer
      security:
        - API Key: []

  /affiliates/reporting/conversions/export:
    post:
      summary: Export Conversions
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              show_conversions: true
              show_events: true
              format: "csv"
              query:
                filters: []
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - format
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the date range.
                show_conversions:
                  type: boolean
                  description: Include conversion records.
                  default: true
                show_events:
                  type: boolean
                  description: Include post-conversion event records.
                  default: false
                format:
                  type: string
                  enum:
                    - csv
                    - json
                  description: Export format.
                query:
                  type: object
                  properties:
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          filter_id_value:
                            type: string
                          resource_type:
                            type: string
      responses:
        "200":
          description: OK. Response format depends on the `format` parameter.
      security:
        - API Key: []

  /affiliates/reporting/conversions/{conversionId}:
    get:
      summary: Get Conversion By ID
      description: >
        Returns full details for a single conversion by its ID.
      tags:
        - Affiliate Reporting
      parameters:
        - name: conversionId
          in: path
          required: true
          description: The numeric ID of the conversion.
          schema:
            type: integer
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  conversion_id:
                    type: string
                    description: Unique conversion identifier.
                  transaction_id:
                    type: string
                  conversion_unix_timestamp:
                    type: integer
                  click_unix_timestamp:
                    type: integer
                  revenue:
                    type: number
                  sale_amount:
                    type: number
                  event:
                    type: string
                    description: Event name (for post-conversion events).
                  is_event:
                    type: boolean
                  source_id:
                    type: string
                  revenue_type:
                    type: string
                  sub1:
                    type: string
                  sub2:
                    type: string
                  sub3:
                    type: string
                  sub4:
                    type: string
                  sub5:
                    type: string
                  sub6:
                    type: string
                  sub7:
                    type: string
                  sub8:
                    type: string
                  sub9:
                    type: string
                  sub10:
                    type: string
                  adv1:
                    type: string
                  adv2:
                    type: string
                  adv3:
                    type: string
                  adv4:
                    type: string
                  adv5:
                    type: string
                  adv6:
                    type: string
                  adv7:
                    type: string
                  adv8:
                    type: string
                  adv9:
                    type: string
                  adv10:
                    type: string
                  session_user_ip:
                    type: string
                  conversion_user_ip:
                    type: string
                  country:
                    type: string
                  region:
                    type: string
                  city:
                    type: string
                  dma:
                    type: integer
                  carrier:
                    type: string
                  isp:
                    type: string
                  platform:
                    type: string
                  os_version:
                    type: string
                  device_type:
                    type: string
                  brand:
                    type: string
                  browser:
                    type: string
                  language:
                    type: string
                  http_user_agent:
                    type: string
                  referer:
                    type: string
                  app_id:
                    type: string
                  idfa:
                    type: string
                  idfa_md5:
                    type: string
                  idfa_sha1:
                    type: string
                  google_ad_id:
                    type: string
                  google_ad_id_md5:
                    type: string
                  google_ad_id_sha1:
                    type: string
                  android_id:
                    type: string
                  android_id_md5:
                    type: string
                  android_id_sha1:
                    type: string
                  currency_id:
                    type: string
                  is_view_through:
                    type: boolean
                  order_id:
                    type: string
                  coupon_code:
                    type: string
                  relationship:
                    type: object
                    properties:
                      offer:
                        type: object
                        properties:
                          network_offer_id:
                            type: integer
                          network_id:
                            type: integer
                          network_tracking_domain_id:
                            type: integer
                          name:
                            type: string
                          offer_status:
                            type: string
                      events_count:
                        type: integer
                        description: Number of post-conversion events associated with this conversion.
        "404":
          description: Conversion not found.
      security:
        - API Key: []

  /affiliates/reporting/entity/table/export:
    post:
      summary: Export Aggregated Data
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              currency_id: "USD"
              columns:
                - column: "offer"
              format: "csv"
              query:
                filters: []
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - currency_id
                - columns
                - format
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier.
                currency_id:
                  type: string
                  description: Currency code for monetary values.
                columns:
                  type: array
                  description: Columns to group/pivot data by.
                  items:
                    type: object
                    required:
                      - column
                    properties:
                      column:
                        type: string
                        description: The dimension to group by.
                format:
                  type: string
                  enum:
                    - csv
                    - json
                  description: Export format.
                query:
                  type: object
                  properties:
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          filter_id_value:
                            type: string
                          resource_type:
                            type: string
      responses:
        "200":
          description: OK. Response format depends on the `format` parameter.
      security:
        - API Key: []

  /affiliates/reporting/entity:
    post:
      summary: Get Reporting Entity Summary
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              currency_id: "USD"
              columns:
                - column: "offer"
              query:
                filters: []
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - currency_id
              properties:
                from:
                  type: string
                  description: Start date for the reporting period. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date for the reporting period. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the request.
                currency_id:
                  type: string
                  description: Currency code for monetary values (e.g. "USD").
                columns:
                  type: array
                  description: Columns to include in the summary.
                  items:
                    type: object
                    properties:
                      column:
                        type: string
                        description: The dimension to include.
                query:
                  type: object
                  description: Query configuration.
                  properties:
                    filters:
                      type: array
                      description: Filters to narrow results.
                      items:
                        type: object
                        properties:
                          filter_id_value:
                            type: string
                          resource_type:
                            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  summary:
                    $ref: "#/components/schemas/FullReportingMetrics"
                  performance:
                    type: array
                    description: Array of daily performance data points over the requested date range.
                    items:
                      type: object
                      properties:
                        unix:
                          type: integer
                          description: Unix timestamp for the day.
                        reporting:
                          $ref: "#/components/schemas/FullReportingMetrics"
                  table:
                    type: array
                    description: Array of reporting data rows.
                    items:
                      type: object
                      properties:
                        columns:
                          type: array
                          description: Dimension values for this row.
                          items:
                            type: object
                            properties:
                              column_type:
                                type: string
                                description: The column/dimension type.
                              id:
                                type: string
                                description: Dimension value identifier.
                              label:
                                type: string
                                description: Human-readable label for the dimension value.
                        reporting:
                          $ref: "#/components/schemas/FullReportingMetrics"
                  incomplete_results:
                    type: boolean
                    description: True if results exceeded the row limit and were truncated.
      security:
        - API Key: []

  /affiliates/reporting/daily:
    post:
      summary: Get Daily Report
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              currency_id: "USD"
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - currency_id
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the date range.
                currency_id:
                  type: string
                  description: Currency code for monetary values.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  summary:
                    $ref: "#/components/schemas/FullReportingMetrics"
                  performance:
                    type: array
                    description: Array of daily performance data points over the requested date range.
                    items:
                      type: object
                      properties:
                        unix:
                          type: integer
                          description: Unix timestamp for the day.
                        reporting:
                          $ref: "#/components/schemas/FullReportingMetrics"
                  table:
                    type: array
                    description: Array of daily reporting rows.
                    items:
                      type: object
                      properties:
                        columns:
                          type: array
                          description: Dimension values for this row.
                          items:
                            type: object
                            properties:
                              column_type:
                                type: string
                                description: The column/dimension type (e.g. "date").
                              id:
                                type: string
                                description: Dimension value identifier.
                              label:
                                type: string
                                description: Human-readable label for the dimension value.
                        reporting:
                          $ref: "#/components/schemas/FullReportingMetrics"
                  incomplete_results:
                    type: boolean
                    description: True if results exceeded the row limit and were truncated.
      security:
        - API Key: []

  /affiliates/reporting/offer:
    post:
      summary: Get Offer Report
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              currency_id: "USD"
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - currency_id
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the date range.
                currency_id:
                  type: string
                  description: Currency code for monetary values.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  table:
                    type: array
                    description: Array of offer reporting rows.
                    items:
                      type: object
                      properties:
                        offer:
                          type: object
                          properties:
                            network_offer_id:
                              type: integer
                            name:
                              type: string
                        reporting:
                          type: object
                          description: Aggregated metrics for this offer.
                          properties:
                            imp:
                              type: integer
                              description: Impression count.
                            total_click:
                              type: integer
                              description: Total click count.
                            unique_click:
                              type: integer
                              description: Unique click count.
                            invalid_click:
                              type: integer
                              description: Invalid/filtered click count.
                            duplicate_click:
                              type: integer
                              description: Duplicate click count.
                            ctr:
                              type: number
                              description: Click-through rate (impressions to clicks).
                            cv:
                              type: integer
                              description: Conversion count.
                            view_through_cv:
                              type: integer
                              description: View-through conversion count.
                            event:
                              type: integer
                              description: Post-conversion event count.
                            cvr:
                              type: number
                              description: Conversion rate (percentage).
                            evr:
                              type: number
                              description: Event rate.
                            rpc:
                              type: number
                              description: Revenue per click.
                            rpm:
                              type: number
                              description: Revenue per mille (per 1,000 impressions).
                            revenue:
                              type: number
                              description: Total revenue (affiliate payout amount).
                            redirect_traffic_revenue:
                              type: number
                              description: Revenue from redirect/fallback traffic.
                            on_hold_conversion_count:
                              type: integer
                              description: Number of conversions currently on hold.
                            on_hold_potential_revenue:
                              type: number
                              description: Potential revenue from on-hold conversions.
                  performance:
                    type: array
                    description: Array of daily performance data points over the requested date range.
                    items:
                      type: object
                      properties:
                        unix:
                          type: integer
                          description: Unix timestamp for the day.
                        reporting:
                          type: object
                          description: Aggregated metrics for this day.
                          properties:
                            imp:
                              type: integer
                              description: Impression count.
                            total_click:
                              type: integer
                              description: Total click count.
                            unique_click:
                              type: integer
                              description: Unique click count.
                            invalid_click:
                              type: integer
                              description: Invalid/filtered click count.
                            duplicate_click:
                              type: integer
                              description: Duplicate click count.
                            ctr:
                              type: number
                              description: Click-through rate (impressions to clicks).
                            cv:
                              type: integer
                              description: Conversion count.
                            view_through_cv:
                              type: integer
                              description: View-through conversion count.
                            event:
                              type: integer
                              description: Post-conversion event count.
                            cvr:
                              type: number
                              description: Conversion rate (percentage).
                            evr:
                              type: number
                              description: Event rate.
                            rpc:
                              type: number
                              description: Revenue per click.
                            rpm:
                              type: number
                              description: Revenue per mille (per 1,000 impressions).
                            revenue:
                              type: number
                              description: Total revenue (affiliate payout amount).
                            redirect_traffic_revenue:
                              type: number
                              description: Revenue from redirect/fallback traffic.
                            on_hold_conversion_count:
                              type: integer
                              description: Number of conversions currently on hold.
                            on_hold_potential_revenue:
                              type: number
                              description: Potential revenue from on-hold conversions.
                  summary:
                    type: object
                    description: Summary totals across all rows for the requested date range.
                    properties:
                      imp:
                        type: integer
                        description: Total impression count.
                      total_click:
                        type: integer
                        description: Total click count.
                      unique_click:
                        type: integer
                        description: Unique click count.
                      invalid_click:
                        type: integer
                        description: Invalid/filtered click count.
                      duplicate_click:
                        type: integer
                        description: Duplicate click count.
                      ctr:
                        type: number
                        description: Click-through rate (impressions to clicks).
                      cv:
                        type: integer
                        description: Total conversion count.
                      view_through_cv:
                        type: integer
                        description: View-through conversion count.
                      event:
                        type: integer
                        description: Post-conversion event count.
                      cvr:
                        type: number
                        description: Conversion rate (percentage).
                      evr:
                        type: number
                        description: Event rate.
                      rpc:
                        type: number
                        description: Revenue per click.
                      rpm:
                        type: number
                        description: Revenue per mille (per 1,000 impressions).
                      revenue:
                        type: number
                        description: Total revenue (affiliate payout amount).
                      redirect_traffic_revenue:
                        type: number
                        description: Revenue from redirect/fallback traffic.
                      on_hold_conversion_count:
                        type: integer
                        description: Number of conversions currently on hold.
                      on_hold_potential_revenue:
                        type: number
                        description: Potential revenue from on-hold conversions.
                  incomplete_results:
                    type: boolean
                    description: True if results exceeded the row limit and were truncated.
      security:
        - API Key: []

  /affiliates/reporting/postconversions:
    post:
      summary: Search Post-Conversion Events
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              columns:
                - column: "offer"
                - column: "event_name"
              query:
                filters: []
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
                - columns
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the date range.
                columns:
                  type: array
                  description: >
                    Columns to break down the data by. Must include one column
                    and one pivot. See `ReportingPostConversionColumnOptions` for
                    available column values and `reportingPostConversionPivotOptions`
                    for available pivot values.
                  items:
                    type: object
                    required:
                      - column
                    properties:
                      column:
                        type: string
                        description: The dimension to group by.
                query:
                  type: object
                  properties:
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          filter_id_value:
                            type: string
                          resource_type:
                            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  report:
                    type: array
                    description: >
                      Array of aggregated post-conversion event rows. Each row
                      contains dimension columns and aggregated reporting metrics,
                      matching the same format as entity/table.
                    items:
                      type: object
                      properties:
                        columns:
                          type: array
                          description: Dimension values for this row.
                          items:
                            type: object
                            properties:
                              column_type:
                                type: string
                                description: The column/dimension type (matches the requested column value).
                              id:
                                type: string
                                description: Dimension value identifier.
                              label:
                                type: string
                                description: Human-readable label for the dimension value.
                        reporting:
                          type: object
                          description: Aggregated metrics for this row.
                          properties:
                            imp:
                              type: integer
                              description: Impression count.
                            total_click:
                              type: integer
                              description: Total click count.
                            ctr:
                              type: number
                              description: Click-through rate.
                            cv:
                              type: integer
                              description: Conversion count.
                            view_through_cv:
                              type: integer
                              description: View-through conversion count.
                            event:
                              type: integer
                              description: Post-conversion event count.
                            evr:
                              type: number
                              description: Event rate.
                            revenue:
                              type: number
                              description: Total revenue.
                            view_through_event:
                              type: integer
                              description: View-through event count.
      security:
        - API Key: []

  /affiliates/reporting/onhold:
    post:
      summary: Search On-Hold Conversions
      tags:
        - Affiliate Reporting
      parameters:
        - in: query
          name: page
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
          description: The page of results to retrieve.
        - in: query
          name: page_size
          required: false
          schema:
            type: integer
            minimum: 1
            default: 50
          description: The number of results to return per page.
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              show_conversions: true
              query:
                filters: []
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the date range.
                show_conversions:
                  type: boolean
                  description: >
                    Must be explicitly set to `true` to include on-hold conversion
                    records in the response.
                show_events:
                  type: boolean
                  description: Include on-hold post-conversion event records in the response.
                  default: false
                query:
                  type: object
                  properties:
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          filter_id_value:
                            type: string
                          resource_type:
                            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  conversions:
                    type: array
                    description: Array of on-hold conversion records.
                    items:
                      type: object
                      properties:
                        on_hold_conversion_id:
                          type: string
                          description: Unique on-hold conversion identifier.
                        network_id:
                          type: integer
                          description: Network identifier.
                        holding_period_end:
                          type: integer
                          description: Unix timestamp when the holding period ends.
                        status:
                          type: string
                          description: Status of the on-hold conversion.
                        conversion:
                          type: object
                          description: Nested conversion details.
                          properties:
                            conversion_id:
                              type: string
                            transaction_id:
                              type: string
                            conversion_unix_timestamp:
                              type: integer
                            revenue:
                              type: number
                            sale_amount:
                              type: number
                            event_name:
                              type: string
                            sub1:
                              type: string
                            sub2:
                              type: string
                            sub3:
                              type: string
                            sub4:
                              type: string
                            sub5:
                              type: string
                            sub6:
                              type: string
                            sub7:
                              type: string
                            sub8:
                              type: string
                            sub9:
                              type: string
                            sub10:
                              type: string
                            relationship:
                              type: object
                              properties:
                                offer:
                                  type: object
                                events_count:
                                  type: integer
                  paging:
                    type: object
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total_count:
                        type: integer
      security:
        - API Key: []

  /affiliates/reporting/onhold/summary:
    post:
      summary: Get On-Hold Conversions Summary
      tags:
        - Affiliate Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-31"
              timezone_id: 67
              show_conversions: true
            schema:
              type: object
              required:
                - from
                - to
                - timezone_id
              properties:
                from:
                  type: string
                  description: Start date. Format `YYYY-MM-DD`.
                to:
                  type: string
                  description: End date. Format `YYYY-MM-DD`.
                timezone_id:
                  type: integer
                  description: Timezone identifier for the date range.
                show_conversions:
                  type: boolean
                  description: >
                    Must be explicitly set to `true` to include on-hold conversion
                    records in the summary.
                show_events:
                  type: boolean
                  description: Include on-hold post-conversion event records in the summary.
                  default: false
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                description: Summary of on-hold conversions.
                properties:
                  total:
                    type: integer
                    description: Total number of on-hold conversions.
                  on_hold:
                    type: integer
                    description: Number of conversions still on hold.
                  approved:
                    type: integer
                    description: Number of approved conversions.
                  rejected:
                    type: integer
                    description: Number of rejected conversions.
                  potential_revenue:
                    type: number
                    description: Potential revenue from on-hold conversions.
                  realized_revenue:
                    type: number
                    description: Realized revenue from approved conversions.
                  has_multi_currencies:
                    type: boolean
                    description: Whether the results span multiple currencies.
                  currency_id:
                    type: string
                    description: Currency code for the monetary values.
      security:
        - API Key: []

  /affiliates/reporting/onhold/{onHoldId}:
    get:
      summary: Get On-Hold Conversion Details
      description: >
        Returns details for a specific on-hold conversion by its ID.
      tags:
        - Affiliate Reporting
      parameters:
        - in: path
          name: onHoldId
          required: true
          schema:
            type: integer
          description: The on-hold conversion ID to retrieve.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                description: On-hold conversion details.
                properties:
                  on_hold_conversion_id:
                    type: string
                    description: Unique on-hold conversion identifier.
                  network_id:
                    type: integer
                    description: Network identifier.
                  holding_period_end:
                    type: integer
                    description: Unix timestamp when the holding period ends.
                  status:
                    type: string
                    description: Status of the on-hold conversion.
                  conversion:
                    type: object
                    description: Nested conversion details.
                    properties:
                      conversion_id:
                        type: string
                      transaction_id:
                        type: string
                      conversion_unix_timestamp:
                        type: integer
                      revenue:
                        type: number
                      sale_amount:
                        type: number
                      event_name:
                        type: string
                      sub1:
                        type: string
                      sub2:
                        type: string
                      sub3:
                        type: string
                      sub4:
                        type: string
                      sub5:
                        type: string
                      sub6:
                        type: string
                      sub7:
                        type: string
                      sub8:
                        type: string
                      sub9:
                        type: string
                      sub10:
                        type: string
                      relationship:
                        type: object
                        properties:
                          offer:
                            type: object
                          events_count:
                            type: integer
      security:
        - API Key: []

components:
  schemas:
    DashboardMetric:
      type: object
      description: A dashboard metric with period comparisons and trend.
      properties:
        today:
          type: number
          description: Value for today.
        yesterday:
          type: number
          description: Value for yesterday.
        current_month:
          type: number
          description: Value for the current month to date.
        last_month:
          type: number
          description: Value for the previous month.
        trending_percentage:
          type: number
          description: Percentage change indicating the trend direction.
    DashboardMetricNoTrend:
      type: object
      description: >
        A dashboard metric with period comparisons but no trending percentage.
        Used for rate metrics like CVR and EVR.
      properties:
        today:
          type: number
          description: Value for today.
        yesterday:
          type: number
          description: Value for yesterday.
        current_month:
          type: number
          description: Value for the current month to date.
        last_month:
          type: number
          description: Value for the previous month.
    FullReportingMetrics:
      type: object
      description: Full set of aggregated reporting metrics.
      properties:
        imp:
          type: integer
          description: Impression count.
        total_click:
          type: integer
          description: Total click count.
        unique_click:
          type: integer
          description: Unique click count.
        invalid_click:
          type: integer
          description: Invalid/filtered click count.
        duplicate_click:
          type: integer
          description: Duplicate click count.
        ctr:
          type: number
          description: Click-through rate (impressions to clicks).
        cv:
          type: integer
          description: Conversion count.
        view_through_cv:
          type: integer
          description: View-through conversion count.
        event:
          type: integer
          description: Post-conversion event count.
        cvr:
          type: number
          description: Conversion rate (percentage).
        evr:
          type: number
          description: Event rate.
        rpc:
          type: number
          description: Revenue per click.
        rpm:
          type: number
          description: Revenue per mille (per 1,000 impressions).
        revenue:
          type: number
          description: Total revenue (affiliate payout amount).
        redirect_traffic_revenue:
          type: number
          description: Revenue from redirect/fallback traffic.
        on_hold_conversion_count:
          type: integer
          description: Number of conversions currently on hold.
        on_hold_potential_revenue:
          type: number
          description: Potential revenue from on-hold conversions.
  securitySchemes:
    API Key:
      description: >
        The affiliate's API key generated from the Affiliate Portal.
        Uses the same X-Eflow-Api-Key header as the Network API, but the key
        belongs to the affiliate user rather than the network admin.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
