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

# Retrieve metrics by date range

> This endpoint provides metrics such as revenue, order counts, and subscription statistics for a specified date range. The `x-store-id` header is required for authentication. Default date range is the last 30 days if not specified. The response includes gross and net revenue, number of orders, new customers, and Monthly Recurring Revenue (MRR) along with Annual Recurring Revenue (ARR).



## OpenAPI

````yaml /api-reference/webhooks-api.json get /v1/metrics
openapi: 3.1.0
info:
  title: Webhooks & Events
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security:
  - storeIdHeader: []
paths:
  /v1/metrics:
    get:
      tags:
        - Metrics
      summary: Retrieve metrics by date range
      description: >-
        This endpoint provides metrics such as revenue, order counts, and
        subscription statistics for a specified date range. The `x-store-id`
        header is required for authentication. Default date range is the last 30
        days if not specified. The response includes gross and net revenue,
        number of orders, new customers, and Monthly Recurring Revenue (MRR)
        along with Annual Recurring Revenue (ARR).
      parameters:
        - name: start_date
          in: query
          schema:
            type: string
            format: date
          description: Start date for the metric period.
        - name: end_date
          in: query
          schema:
            type: string
            format: date
          description: End date for the metric period.
      responses:
        '200':
          description: Successful retrieval of metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsResponse'
        '400':
          description: Bad Request - Invalid date format or range.
        '401':
          description: Unauthorized - Store ID header missing.
        '500':
          description: Internal Server Error.
      security:
        - storeIdHeader: []
components:
  schemas:
    MetricsResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            period:
              type: object
              properties:
                start:
                  type: string
                  format: date-time
                end:
                  type: string
                  format: date-time
            orders:
              type: object
              properties:
                count:
                  type: integer
                gross_revenue:
                  type: number
                net_revenue:
                  type: number
            subscriptions:
              type: object
              properties:
                active:
                  type: integer
                mrr:
                  type: number
                arr:
                  type: number
            customers:
              type: object
              properties:
                new_in_period:
                  type: integer
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````