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

# Retrieve organization order analytics



## OpenAPI

````yaml /api-reference/analytics-v1.json get /v1/organizations/{organization_id}/analytics/orders
openapi: 3.0.0
info:
  title: Chataigne Analytics API
  description: Retrieve analytics for Chataigne locations and organizations.
  version: '2026-05-01'
  contact: {}
servers:
  - url: https://server.chataigne.ai
security: []
tags: []
paths:
  /v1/organizations/{organization_id}/analytics/orders:
    get:
      tags:
        - Analytics
      summary: Retrieve organization order analytics
      operationId: AnalyticsV1Controller_retrieveOrganizationOrders
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
          example: busorg_k3m9x2p7qw
        - name: from
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: >-
            Start of the analytics period. If both `from` and `to` are omitted,
            the period defaults to the last 30 days.
        - name: to
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: >-
            End of the analytics period. If both `from` and `to` are omitted,
            the period defaults to now.
        - name: service_type
          in: query
          required: false
          schema:
            type: string
            enum:
              - delivery
              - collection
          description: Restrict order-backed statistics to delivery or collection orders.
      responses:
        '200':
          description: The organization order analytics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationOrderAnalytics'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The principal is not allowed to perform this request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - organization-api-key: []
components:
  schemas:
    OrganizationOrderAnalytics:
      type: object
      required:
        - object
        - organization_id
        - period
        - summary
        - daily
      properties:
        object:
          type: string
          enum:
            - organization_order_analytics
        organization_id:
          type: string
          example: busorg_k3m9x2p7qw
        period:
          $ref: '#/components/schemas/AnalyticsPeriod'
        summary:
          type: object
          required:
            - order_count
          properties:
            order_count:
              type: integer
              example: 1280
              description: Eligible orders across the organization’s locations.
        daily:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsDailyOrderCount'
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - authorization_error
                - not_found_error
                - conflict_error
                - rate_limit_error
                - idempotency_error
                - api_error
            code:
              type: string
              example: resource_missing
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
              example: req_8f2c…
            details:
              type: object
              additionalProperties: true
    AnalyticsPeriod:
      type: object
      required:
        - from
        - to
        - service_type
      properties:
        from:
          type: string
          format: date-time
          nullable: true
        to:
          type: string
          format: date-time
          nullable: true
        service_type:
          type: string
          enum:
            - delivery
            - collection
          nullable: true
    AnalyticsDailyOrderCount:
      type: object
      required:
        - date
        - order_count
      properties:
        date:
          type: string
          format: date
          example: '2026-06-01'
        order_count:
          type: integer
          example: 12
  securitySchemes:
    organization-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Location/organization API key.

````