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

# Get revenue breakdown by product

> Returns revenue broken down by product for the selected period, with a comparison to the prior period.



## OpenAPI

````yaml /api-reference/v2/specs/2026-04-01.json get /insights/revenue/by-product
openapi: 3.1.0
info:
  title: Alguna Public API
  version: '2026-04-01'
servers:
  - url: https://api.alguna.io
security:
  - bearerAuth: []
tags:
  - name: Billing Events and Metrics
  - name: Credit Notes
  - name: Credits
  - name: Customer Portal Sessions
  - name: Customers
  - name: Insights
  - name: Invoices
  - name: Payments
  - name: Plans
  - name: Product Bundles
  - name: Products
  - name: Refunds
  - name: Revenue Schedules
  - name: Subscription Changes
  - name: Subscription Versions
  - name: Subscriptions
  - name: Wallet Grants
  - name: Wallets
paths:
  /insights/revenue/by-product:
    get:
      tags:
        - Insights
      summary: Get revenue breakdown by product
      description: >-
        Returns revenue broken down by product for the selected period, with a
        comparison to the prior period.
      operationId: get-revenue-by-product
      parameters:
        - in: header
          name: Alguna-Version
          required: true
          schema:
            enum:
              - '2026-04-01'
            type: string
        - in: query
          name: customer_id
          required: true
          schema:
            description: Optional customer ID to filter by
            example: cust_abc123
            type: string
        - in: query
          name: date_range
          required: true
          schema:
            description: Time period for the query.
            enum:
              - this_month
              - last_month
              - two_months_ago
              - this_quarter
              - last_quarter
              - two_quarters_ago
              - this_year
              - last_year
              - last_twelve_months
              - all_time
            example: this_month
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevenueByProductResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    RevenueByProductResponse:
      properties:
        currency:
          description: ISO 4217 currency code
          example: USD
          type: string
        products:
          description: Products ordered by revenue
          items:
            $ref: '#/components/schemas/InsightsProductEntry'
          type: array
      required:
        - currency
        - products
      type: object
    ErrorResponse:
      properties:
        detail:
          type: string
        status:
          format: int64
          type: integer
      required:
        - status
        - detail
      type: object
    InsightsProductEntry:
      properties:
        comparison_amount:
          description: Amount for the previous comparison period
          example: '68000.00'
          type: string
        primary_amount:
          description: Amount for the selected period
          example: '75000.00'
          type: string
        product_id:
          description: Product ID
          example: prod_abc123
          type: string
        product_name:
          description: Product name
          example: API Usage
          type: string
        product_type:
          description: Pricing class
          enum:
            - fixed
            - metered
          example: metered
          type: string
      required:
        - comparison_amount
        - primary_amount
        - product_id
        - product_name
        - product_type
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http

````