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

# Get sales metrics

> Retrieves aggregated sales metrics for a specified date range. Returns hourly or daily granularity with order counts and sales totals grouped by currency.



## OpenAPI

````yaml /swagger/management-api.json get /api/v1/{team_slug}/{app_slug}/orders/metrics
openapi: 3.0.0
info:
  contact:
    email: support@enad.io
    name: API support
    url: http://enad.io/support
  description: This is the documentation for Public API v1
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://enad.io/terms/
  title: Public API
  version: '1.0'
servers:
  - url: //api.enad.io
security: []
paths:
  /api/v1/{team_slug}/{app_slug}/orders/metrics:
    get:
      tags:
        - Orders
      summary: Get sales metrics
      description: >-
        Retrieves aggregated sales metrics for a specified date range. Returns
        hourly or daily granularity with order counts and sales totals grouped
        by currency.
      parameters:
        - description: App slug
          in: path
          name: app_slug
          required: true
          schema:
            type: string
        - description: Team slug
          in: path
          name: team_slug
          required: true
          schema:
            type: string
        - description: Start date (YYYY-MM-DD)
          in: query
          name: start_date
          required: true
          schema:
            type: string
        - description: End date (YYYY-MM-DD)
          in: query
          name: end_date
          required: true
          schema:
            type: string
        - description: Granularity of the metrics (hour, day)
          in: query
          name: granularity
          schema:
            type: string
      responses:
        '200':
          description: Sales metrics with order counts retrieved successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_pkg_webserver_v1.OkResponse-internal_pkg_webserver_v1_SalesMetricsDataResponse
        '400':
          description: Invalid date format or missing parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
      security:
        - BearerAuth: []
components:
  schemas:
    internal_pkg_webserver_v1.OkResponse-internal_pkg_webserver_v1_SalesMetricsDataResponse:
      properties:
        data:
          $ref: >-
            #/components/schemas/internal_pkg_webserver_v1.SalesMetricsDataResponse
        details:
          description: >-
            Additional contextual information about the response. Used to
            provide supplementary details beyond the main data payload, such as
            validation warnings or processing notes
          items:
            type: string
          type: array
        success:
          type: boolean
      type: object
    internal_pkg_webserver_v1.ErrorMessage:
      properties:
        details:
          items:
            type: string
          type: array
        message:
          type: string
        success:
          type: boolean
      type: object
    internal_pkg_webserver_v1.SalesMetricsDataResponse:
      properties:
        daily_metrics:
          items:
            $ref: >-
              #/components/schemas/internal_pkg_webserver_v1.DailySalesMetricResponse
          type: array
        hourly_metrics:
          items:
            $ref: >-
              #/components/schemas/internal_pkg_webserver_v1.HourlySalesMetricResponse
          type: array
        total_order_count:
          type: integer
        total_sales_by_currency:
          items:
            $ref: '#/components/schemas/internal_pkg_webserver_v1.SalesByCurrency'
          type: array
      type: object
    internal_pkg_webserver_v1.DailySalesMetricResponse:
      properties:
        day:
          type: string
        order_count:
          type: integer
        sales_by_currency:
          items:
            $ref: '#/components/schemas/internal_pkg_webserver_v1.SalesByCurrency'
          type: array
      type: object
    internal_pkg_webserver_v1.HourlySalesMetricResponse:
      properties:
        hour:
          type: string
        order_count:
          type: integer
        sales_by_currency:
          items:
            $ref: '#/components/schemas/internal_pkg_webserver_v1.SalesByCurrency'
          type: array
      type: object
    internal_pkg_webserver_v1.SalesByCurrency:
      properties:
        currency_code:
          type: string
        total_compensated_sales:
          type: number
        total_sales_amount:
          type: number
      type: object

````