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

# Métricas de NFC-e

> Métricas agregadas da mecânica de leitura de NFC-e

# Métricas de NFC-e

Retorna métricas da mecânica de leitura de NFC-e da empresa.
Aceita filtros por período, granularidade e cliente.


## OpenAPI

````yaml GET /api/v1/public/nfce/metrics
openapi: 3.1.0
info:
  contact:
    email: support@indiqai.com
    name: IndiqAI Support
    url: https://indiqai.com/
  description: Especificação OpenAPI da API Pública IndiqAI.
  license:
    name: Proprietary
    url: https://indiqai.com/license
  title: IndiqAI API Pública
  version: 1.5.0
servers:
  - description: Produção
    url: https://api.indiqai.com
security: []
paths:
  /api/v1/public/nfce/metrics:
    get:
      tags:
        - API Pública
      summary: Métricas de NFC-e
      description: >-
        Métricas da mecânica de leitura de NFC-e (compras verificadas por nota
        fiscal).
      operationId: get_nfce_metrics_api_v1_public_nfce_metrics_get
      parameters:
        - in: query
          name: days
          required: false
          schema:
            default: 30
            maximum: 365
            minimum: 1
            title: Days
            type: integer
        - description: '"day", "week" ou "month"'
          in: query
          name: group_by
          required: false
          schema:
            default: day
            description: '"day", "week" ou "month"'
            title: Group By
            type: string
        - description: Filtrar por cliente específico
          in: query
          name: client_id
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: Filtrar por cliente específico
            title: Client Id
        - description: Chave de API
          in: header
          name: X-API-Key
          required: true
          schema:
            description: Chave de API
            title: X-Api-Key
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NfceMetricsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    NfceMetricsResponse:
      description: Métricas da mecânica de leitura de NFC-e.
      properties:
        avg_ticket_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Ticket Value
        clients_never_scanned:
          default: 0
          title: Clients Never Scanned
          type: integer
        duplicate_scans:
          default: 0
          title: Duplicate Scans
          type: integer
        invalid_scans:
          default: 0
          title: Invalid Scans
          type: integer
        period_days:
          default: 30
          title: Period Days
          type: integer
        points_issued_via_nfce:
          default: 0
          title: Points Issued Via Nfce
          type: integer
        scans_by_period:
          items:
            $ref: '#/components/schemas/NfceScanByPeriod'
          title: Scans By Period
          type: array
        top_clients:
          items:
            $ref: '#/components/schemas/NfceTopClient'
          title: Top Clients
          type: array
        top_products_by_value:
          items:
            $ref: '#/components/schemas/NfceTopProduct'
          title: Top Products By Value
          type: array
        total_purchase_value:
          default: 0
          title: Total Purchase Value
          type: number
        total_scans:
          default: 0
          title: Total Scans
          type: integer
        unique_clients_scanned:
          default: 0
          title: Unique Clients Scanned
          type: integer
        valid_scans:
          default: 0
          title: Valid Scans
          type: integer
      title: NfceMetricsResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    NfceScanByPeriod:
      properties:
        period:
          title: Period
          type: string
        scans:
          default: 0
          title: Scans
          type: integer
        valid:
          default: 0
          title: Valid
          type: integer
        value:
          default: 0
          title: Value
          type: number
      required:
        - period
      title: NfceScanByPeriod
      type: object
    NfceTopClient:
      properties:
        client_id:
          title: Client Id
          type: string
        name:
          title: Name
          type: string
        points_earned:
          default: 0
          title: Points Earned
          type: integer
        scans:
          default: 0
          title: Scans
          type: integer
        total_value:
          default: 0
          title: Total Value
          type: number
        valid_scans:
          default: 0
          title: Valid Scans
          type: integer
      required:
        - client_id
        - name
      title: NfceTopClient
      type: object
    NfceTopProduct:
      properties:
        occurrences:
          default: 0
          title: Occurrences
          type: integer
        product_name:
          title: Product Name
          type: string
        total_value:
          default: 0
          title: Total Value
          type: number
      required:
        - product_name
      title: NfceTopProduct
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````