openapi: 3.0.3
info:
  title: Everflow Network API - Adjustment and Refund Reporting
  description: >
    Reporting adjustment and refund endpoints for the Everflow partner
    marketing platform.
    For more detail, see [Performance Data Adjustments](https://helpdesk.everflow.io/customer/performance-data-adjustments-clicks-conversions-revenue-payout) in the Help Center.
  version: 1.0.0
servers:
  - description: Production Server
    url: https://api.eflow.team/v1
tags:
  - name: Reporting
    description: Adjustment and refund reporting endpoints.
paths:
  /networks/reportingadjustments:
    get:
      summary: Get Reporting Adjustments
      tags:
        - Reporting
      parameters:
        - in: query
          name: from
          required: true
          schema:
            type: string
          description: "Start date in YYYY-MM-DD format. Uses the network's timezone."
        - in: query
          name: to
          required: true
          schema:
            type: string
          description: "End date in YYYY-MM-DD format. Uses the network's timezone."
        - in: query
          name: timezone_id
          required: false
          schema:
            type: integer
          description: "Timezone ID for the report. Defaults to the network's timezone."
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  adjustments:
                    type: array
                    items:
                      type: object
                      properties:
                        network_reporting_adjustment_id:
                          type: integer
                        network_id:
                          type: integer
                        network_affiliate_id:
                          type: integer
                        network_offer_id:
                          type: integer
                        network_employee_id:
                          type: integer
                        total_clicks:
                          type: integer
                        unique_clicks:
                          type: integer
                        conversions:
                          type: integer
                        payout:
                          type: number
                        revenue:
                          type: number
                        date_adjustment:
                          type: string
                        notes:
                          type: string
                        gross_sales:
                          type: number
                        impressions:
                          type: integer
                        media_buying_cost:
                          type: number
                        time_created:
                          type: integer
                          example: 1734455015
                        time_saved:
                          type: integer
                          example: 1734455015
                        deleted:
                          type: boolean
                        relationship:
                          type: object
                          properties:
                            snapshot:
                              type: object
                              properties:
                                network_reporting_adjustment_id:
                                  type: integer
                                network_id:
                                  type: integer
                                network_affiliate_id:
                                  type: integer
                                network_offer_id:
                                  type: integer
                                total_clicks:
                                  type: integer
                                unique_clicks:
                                  type: integer
                                conversions:
                                  type: integer
                                payout:
                                  type: number
                                revenue:
                                  type: number
                                event_revenue:
                                  type: number
                                gross_sales:
                                  type: number
                                impressions:
                                  type: integer
                                media_buying_cost:
                                  type: number
                                snapshot_timestamp:
                                  type: integer
                                snapshot_date:
                                  type: string
                                time_created:
                                  type: integer
                                  example: 1734455015
      security:
        - API Key: []
    post:
      summary: Create Reporting Adjustment
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              network_offer_id: 1
              network_affiliate_id: 1
              timezone_id: 90
              adjustment_date: "2026-03-01"
              payout: 1.0
              revenue: 2.0
              conversions: 1
            schema:
              type: object
              required:
                - network_offer_id
                - network_affiliate_id
              properties:
                network_offer_id:
                  type: integer
                  description: The offer ID for the adjustment.
                network_affiliate_id:
                  type: integer
                  description: The affiliate ID for the adjustment.
                adjustment_date:
                  type: string
                  description: "Date for the adjustment (format: YYYY-MM-DD)."
                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 ID.
                conversions:
                  type: integer
                  description: Conversion count adjustment.
                revenue:
                  type: number
                  description: Revenue adjustment amount.
                payout:
                  type: number
                  description: Payout adjustment amount.
                memo:
                  type: string
                  description: Internal notes about the adjustment.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                description: The created adjustment record.
      security:
        - API Key: []

  /networks/reportingadjustments/table:
    post:
      summary: Find Adjustments (Advanced)
      tags:
        - 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: "2025-01-01"
              to: "2025-01-31"
              timezone_id: 67
              query:
                filters:
                  - resource_type: offer
                    filter_id_value: "880"
                search_terms: []
            schema:
              type: object
              required:
                - from
                - to
              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 ID for the report.
                query:
                  type: object
                  properties:
                    filters:
                      type: array
                      items:
                        type: object
                        properties:
                          resource_type:
                            type: string
                            enum:
                              - offer
                              - affiliate
                              - advertiser
                          filter_id_value:
                            type: string
                    search_terms:
                      type: array
                      items:
                        type: object
                        properties:
                          search_type:
                            type: string
                            enum:
                              - notes
                          value:
                            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  adjustments:
                    type: array
                    items:
                      type: object
                      properties:
                        network_reporting_adjustment_id:
                          type: integer
                        network_id:
                          type: integer
                        network_affiliate_name:
                          type: string
                        network_offer_name:
                          type: string
                        network_advertiser_name:
                          type: string
                        network_offer_id:
                          type: integer
                        network_affiliate_id:
                          type: integer
                        network_advertiser_id:
                          type: integer
                        network_employee_id:
                          type: integer
                        network_employee_name:
                          type: string
                        total_clicks:
                          type: integer
                        unique_clicks:
                          type: integer
                        conversions:
                          type: integer
                        payout:
                          type: number
                        revenue:
                          type: number
                        gross_sales:
                          type: number
                        impressions:
                          type: integer
                        media_buying_cost:
                          type: number
                        date_adjustment:
                          type: string
                        notes:
                          type: string
                        currency_id:
                          type: string
                        time_created:
                          type: integer
                          example: 1734455015
                        time_saved:
                          type: integer
                          example: 1734455015
                        deleted:
                          type: boolean
                        snapshot:
                          type: object
                          properties:
                            network_reporting_adjustment_id:
                              type: integer
                            network_id:
                              type: integer
                            network_affiliate_id:
                              type: integer
                            network_offer_id:
                              type: integer
                            total_clicks:
                              type: integer
                            unique_clicks:
                              type: integer
                            conversions:
                              type: integer
                            payout:
                              type: number
                            revenue:
                              type: number
                            event_revenue:
                              type: number
                            gross_sales:
                              type: number
                            impressions:
                              type: integer
                            media_buying_cost:
                              type: number
                            snapshot_timestamp:
                              type: integer
                            snapshot_date:
                              type: string
                            time_created:
                              type: integer
                              example: 1734455015
                  paging:
                    type: object
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total_count:
                        type: integer
      security:
        - API Key: []

  /networks/reporting/refunds:
    post:
      summary: Search Refunds
      tags:
        - Reporting
      requestBody:
        required: true
        content:
          application/json:
            example:
              from: "2026-03-01"
              to: "2026-03-08"
              timezone_id: 90
              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 ID for the report.
                currency_id:
                  type: string
                  description: Currency code for reporting metrics.
                query:
                  type: object
                  description: Optional filters to narrow results.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  refunds:
                    type: array
                    items:
                      type: object
                      description: Refund record.
      security:
        - API Key: []

components:
  securitySchemes:
    API Key:
      description: The Everflow API key generated from the Control Center > Security.
      in: header
      name: X-Eflow-Api-Key
      type: apiKey
