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

# Monthly revenue trend

> Powers the **Revenue vs target** line chart on the **Overview** screen and the **Commission vs revenue trend** chart on the **Commissions** screen.

Returns one data point per calendar month for the requested year, filling months with zero revenue as `0.00` so the frontend can render a continuous series without gaps.



## OpenAPI

````yaml /openapi/commercial.yaml get /api/v1/analytics/sales/trend
openapi: 3.0.3
info:
  title: Commercial Service API
  version: 1.0.0
  description: |2-

        **Commercial Service API** - Lead management and campaign workflow system.

        ## Versioning
        The API uses URL path versioning (e.g., `/api/v1/`, `/api/v2/`).
        Current version: **v1**
        
servers:
  - url: https://api.capedigital.co.ke/commercial
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/analytics/sales/trend:
    get:
      tags:
        - Sales Analytics
      summary: Monthly revenue trend
      description: >-
        Powers the **Revenue vs target** line chart on the **Overview** screen
        and the **Commission vs revenue trend** chart on the **Commissions**
        screen.


        Returns one data point per calendar month for the requested year,
        filling months with zero revenue as `0.00` so the frontend can render a
        continuous series without gaps.
      operationId: analytics_sales_trend_list
      parameters:
        - in: query
          name: year
          schema:
            type: integer
          description: Four-digit year, e.g. `2026`.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RevenueTrendPoint'
              examples:
                2026Jan–May:
                  value:
                    - - month_label: Jan
                        month_start: '2026-01-01'
                        total_contracted_revenue: '18200000.00'
                      - month_label: Feb
                        month_start: '2026-02-01'
                        total_contracted_revenue: '17800000.00'
                      - month_label: Mar
                        month_start: '2026-03-01'
                        total_contracted_revenue: '22400000.00'
                      - month_label: Apr
                        month_start: '2026-04-01'
                        total_contracted_revenue: '19100000.00'
                      - month_label: May
                        month_start: '2026-05-01'
                        total_contracted_revenue: '21400000.00'
                  summary: 2026 Jan–May
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    RevenueTrendPoint:
      type: object
      properties:
        month_label:
          type: string
        month_start:
          type: string
          format: date
        total_contracted_revenue:
          type: string
          format: decimal
          pattern: ^-?\d{0,16}(?:\.\d{0,2})?$
      required:
        - month_label
        - month_start
        - total_contracted_revenue
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````