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

# Get Client Order Stats



## OpenAPI

````yaml /api/openapi-finindex.json get /api/v1/clients/{client_id}/orders/stats
openapi: 3.1.0
info:
  title: Finindex API — ERP · Finance · Accounting
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/clients/{client_id}/orders/stats:
    get:
      tags:
        - Clients
      summary: Get Client Order Stats
      operationId: get_client_order_stats_api_v1_clients__client_id__orders_stats_get
      parameters:
        - name: client_id
          in: path
          required: true
          schema:
            type: string
            title: Client Id
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Comma-separated statuses
            title: Status
          description: Comma-separated statuses
        - name: date_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Date From
        - name: date_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Date To
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Search order # or style'
            title: Search
          description: 'Search order # or style'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientOrderStats'
        '401':
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    ClientOrderStats:
      properties:
        totalOrders:
          type: integer
          title: Totalorders
        activeOrders:
          type: integer
          title: Activeorders
        totalValue:
          type: number
          title: Totalvalue
        averageOrderValue:
          type: number
          title: Averageordervalue
        lastOrderDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastorderdate
      type: object
      required:
        - totalOrders
        - activeOrders
        - totalValue
        - averageOrderValue
      title: ClientOrderStats
      description: Aggregate metrics for a client's sales orders.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````