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

# Mrr Report Api

> Retrieve Monthly Recurring Revenue (MRR) metrics report. This endpoint provides comprehensive MRR analytics including: MRR Beginning of Period, New MRR, Churn MRR, Expansion MRR, Contraction MRR, MRR End of Period, ARR, MRR Change, and Net Revenue Retention (NRR). Data is grouped by metric type for easy integration with dashboards and analytics tools.



## OpenAPI

````yaml get /api/v1/metrics/mrr
openapi: 3.1.0
info:
  title: NinjaAPI
  version: 1.0.0
  description: ''
servers:
  - url: https://api.justpaid.io
security: []
paths:
  /api/v1/metrics/mrr:
    get:
      summary: Mrr Report Api
      description: >-
        Retrieve Monthly Recurring Revenue (MRR) metrics report. This endpoint
        provides comprehensive MRR analytics including: MRR Beginning of Period,
        New MRR, Churn MRR, Expansion MRR, Contraction MRR, MRR End of Period,
        ARR, MRR Change, and Net Revenue Retention (NRR). Data is grouped by
        metric type for easy integration with dashboards and analytics tools.
      operationId: loopfour_backend_external_api_metrics_api_mrr_report_api
      parameters:
        - in: query
          name: year
          schema:
            description: >-
              The year for which to retrieve MRR metrics. Defaults to current
              year.
            example: 2025
            maximum: 2100
            minimum: 2000
            title: Year
            type: integer
          required: false
          description: >-
            The year for which to retrieve MRR metrics. Defaults to current
            year.
          example: 2025
        - in: query
          name: months_ahead
          schema:
            default: 12
            description: >-
              Number of months to project forward from the specified year.
              Defaults to 12 months. Maximum 60 months (5 years).
            example: 12
            maximum: 60
            minimum: 0
            title: Months Ahead
            type: integer
          required: false
          description: >-
            Number of months to project forward from the specified year.
            Defaults to 12 months. Maximum 60 months (5 years).
          example: 12
        - name: year
          in: query
          description: >-
            The year for which to retrieve MRR metrics. Defaults to the current
            year if not specified. Must be between 2000 and 2100.
          required: false
          schema:
            type: integer
            minimum: 2000
            maximum: 2100
            example: 2025
        - name: months_ahead
          in: query
          description: >-
            Number of months to project forward from the specified year. This
            allows you to retrieve forward-looking MRR projections. Defaults to
            12 months. Maximum of 60 months (5 years).
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 60
            example: 12
      responses:
        '200':
          description: MRR report retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MRRReportResponseSchema'
              example:
                request_id: req_abc123def456
                data:
                  - name: New MRR
                    values:
                      - year: 2025
                        month: 1
                        amount: 5000.5
                      - year: 2025
                        month: 2
                        amount: 6200.75
                  - name: Churn MRR
                    values:
                      - year: 2025
                        month: 1
                        amount: -500
                      - year: 2025
                        month: 2
                        amount: -300
        '400':
          description: Bad Request - Invalid query parameters
          content:
            application/json:
              example:
                request_id: req_abc123def456
                error_code: INVALID_INPUT
                detail:
                  - type: less_than_equal
                    message: Input should be less than or equal to 60
                    field: months_ahead
        '401':
          description: Authentication failed - Invalid or missing API key
          content:
            application/json:
              example:
                request_id: req_abc123def456
                error_code: AUTHENTICATION_ERROR
                message: Authentication failed
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                request_id: req_abc123def456
                error_code: INTERNAL_SERVER_ERROR
                message: An unexpected error occurred
      security:
        - HttpBearerAuth: []
components:
  schemas:
    MRRReportResponseSchema:
      description: >-
        Complete MRR report response.


        Contains all 9 MRR metric types, each with their time series values.

        Data is grouped by metric type (not by month) for easier consumption in
        dashboards.
      properties:
        request_id:
          description: Unique request identifier for debugging and tracing
          example: req_abc123def456
          title: Request Id
          type: string
        data:
          description: >-
            List of metric groups. Each group contains time series data for one
            of the 9 MRR metrics.
          items:
            $ref: '#/components/schemas/MetricGroupSchema'
          title: Data
          type: array
      required:
        - request_id
        - data
      title: MRRReportResponseSchema
      type: object
    MetricGroupSchema:
      description: >-
        Grouping of time series values for a specific metric type.


        Each metric group contains all monthly values for one of the 9 MRR
        metric types.
      properties:
        name:
          description: >-
            Name of the metric. One of: MRR Beginning of Period, New MRR, Churn
            MRR, Expansion MRR, Contraction MRR, MRR End of Period, ARR, MRR
            Change, NRR
          example: New MRR
          title: Name
          type: string
        values:
          description: Time series values for this metric across all months
          items:
            $ref: '#/components/schemas/TimeSeriesValueSchema'
          title: Values
          type: array
      required:
        - name
        - values
      title: MetricGroupSchema
      type: object
    TimeSeriesValueSchema:
      description: |-
        Individual time series data point for a metric.

        Represents a single month's value for a specific MRR metric.
      properties:
        year:
          description: Year of the metric value
          example: 2025
          title: Year
          type: integer
        month:
          description: Month of the metric value (1-12)
          example: 1
          maximum: 12
          minimum: 1
          title: Month
          type: integer
        amount:
          description: >-
            The metric amount for this month. Can be negative for churn and
            contraction metrics.
          example: 5000.5
          title: Amount
          type: number
      required:
        - year
        - month
        - amount
      title: TimeSeriesValueSchema
      type: object
  securitySchemes:
    HttpBearerAuth:
      type: http
      scheme: bearer

````