> ## Documentation Index
> Fetch the complete documentation index at: https://docs.younegotiate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate report

> Generate a Superadmin report CSV. Bill Pay Donations DFA, Invoicing, COGS, Partner Summary Total, Partner Members, YouNegotiate Revenue, Compliance Consumer PII Comm Opt Out, Compliance Consumer Disputes/No Pay, Compliance Auto Expired Deleted Accounts, Consumer Payments, and Super Admin All Accounts reports are available for download.



## OpenAPI

````yaml /api/superadmin.openapi.yaml post /generate-reports
openapi: 3.1.0
info:
  title: YouNegotiate Superadmin API
  version: '2.0'
  description: Stateless API endpoints for the Superadmin portal.
servers:
  - url: https://api.hub.younegotiate.com
    description: Production
security: []
tags:
  - name: System
    description: Public superadmin domain system and health endpoints.
  - name: Authentication
    description: Superadmin login, logout, password reset, and password change endpoints.
  - name: Profile
    description: Authenticated superadmin profile endpoints.
  - name: Admin Configuration
    description: Platform configuration values and feature flag controls.
  - name: MailHub Users
    description: Superadmin management for EcoMail Hub / EcoPortal users.
  - name: Super Admin Users
    description: Superadmin management for platform operations users.
  - name: Consumers
    description: Superadmin consumer account list, detail, filter, and export endpoints.
  - name: Creditors
    description: Superadmin creditor account list and account access endpoints.
  - name: Sub Accounts
    description: Superadmin sub account list and export endpoints.
  - name: Reseller Partners
    description: Superadmin reseller partner list and report-history endpoints.
  - name: Special Plan Inquiries
    description: >-
      Superadmin special membership inquiry list, detail, resolve, and close
      endpoints.
  - name: Plans
    description: >-
      Superadmin membership plan list, create, update, reorder, visibility, and
      delete endpoints.
  - name: Failed - Canceled
    description: Superadmin failed or cancelled membership list and custom email endpoints.
  - name: Merchant Requests
    description: >-
      Superadmin merchant API request list, export, email, forwarding, progress,
      and approval endpoints.
  - name: Bill Pay Donations
    description: Superadmin Bill Pay gift donation list, export, and receipt endpoints.
  - name: Export & Reporting
    description: Superadmin generated report options and CSV download endpoints.
  - name: Communications / Templates
    description: >-
      Superadmin email and SMS template management for manual communications and
      campaigns.
  - name: Communications / Groups
    description: >-
      Superadmin communication group management for dynamic consumer targeting
      and campaign selection.
  - name: Communications / Schedule Campaign
    description: >-
      Superadmin email and SMS campaign scheduling, immediate send, and delivery
      queue endpoints.
  - name: Communications / Campaign Tracker
    description: >-
      Superadmin campaign tracker snapshots, refresh actions, and consumer
      exports.
  - name: Automated Communications
    description: >-
      Superadmin automated email/SMS templates, trigger configuration, and
      delivery history endpoints.
paths:
  /generate-reports:
    post:
      tags:
        - Export & Reporting
      summary: Generate report
      description: >-
        Generate a Superadmin report CSV. Bill Pay Donations DFA, Invoicing,
        COGS, Partner Summary Total, Partner Members, YouNegotiate Revenue,
        Compliance Consumer PII Comm Opt Out, Compliance Consumer Disputes/No
        Pay, Compliance Auto Expired Deleted Accounts, Consumer Payments, and
        Super Admin All Accounts reports are available for download.
      operationId: superadminGenerateReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuperadminGenerateReportRequest'
            example:
              report_type: bill_pay_donations_dfa
              company_id: all_members
              start_date: '2026-06-01'
              end_date: '2026-06-30'
      responses:
        '200':
          description: >-
            CSV report download returned. Columns depend on `report_type`;
            YouNegotiate Revenue exports include platform member counts plus
            hosting, add-on, payment, ecoCommunication, and Superadmin
            communication revenue metrics. Compliance Consumer PII Comm Opt Out
            exports include consumer name, SSN, ten mobile opt-out slots, ten
            email opt-out slots, and mobile/email PII profile verification
            flags. Compliance Consumer Disputes/No Pay exports include consumer
            account identifiers, date reported by consumer, and dispute/no-pay
            reason. Compliance Auto Expired Deleted Accounts exports include
            member name, consumer identifiers, account identifiers,
            placement/expiry dates, balance, and auto-deleted date. Consumer
            Payments exports include consumer identifiers, member paid to,
            payment type/date/amount/status, payment ID, payer source,
            processing fee percent, and processing fee revenue. Super Admin All
            Accounts exports include account/contact fields, current negotiation
            status, pay terms, negotiated payment values, balances, last/next
            plan payment details, and payment-plan schedule counts.
          content:
            text/csv:
              schema:
                type: string
                format: binary
              example: >
                Date,Donor Full Name,Donation Amount,Company/Creditor
                Name,Consumer Full Name,Qualify,Consumer DOB,Consumer Last 2
                SSN,Sent To DFA

                Jun 15, 2026,Export Donor,$300.00,Export Recovery,Export
                Consumer,Yes,Jan 12, 1970,32,No
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    SuperadminGenerateReportRequest:
      type: object
      additionalProperties: false
      required:
        - report_type
        - start_date
        - end_date
      properties:
        report_type:
          type: string
          enum:
            - bill_pay_donations_dfa
            - invoicing
            - cogs
            - partner_summary_total
            - partner_members
            - younegotiate_revenue
            - compliance_consumer_pii_opt_out
            - compliance_consumer_disputes_no_pay
            - compliance_auto_expired_deleted_accounts
            - consumer_payments
            - super_admin_all_accounts
          example: bill_pay_donations_dfa
        company_id:
          oneOf:
            - type: string
              enum:
                - all_members
            - type: integer
          nullable: true
          description: >-
            Use `all_members`, omit the field, or pass a company ID from the
            options endpoint.
          example: all_members
        start_date:
          type: string
          format: date
          description: >-
            Start date in YYYY-MM-DD format. The request cannot span more than
            two months.
          example: '2026-06-01'
        end_date:
          type: string
          format: date
          description: >-
            End date in YYYY-MM-DD format. Must be on or after `start_date` and
            not in the future.
          example: '2026-06-30'
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ValidationErrorResponse:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthenticated:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum token

````