> ## 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 location discount analytics



## OpenAPI

````yaml /api-reference/analytics-v1.json get /v1/locations/{location_id}/analytics/discounts
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/locations/{location_id}/analytics/discounts:
    get:
      tags:
        - Analytics
      summary: Retrieve location discount analytics
      operationId: AnalyticsV1Controller_retrieveLocationDiscounts
      parameters:
        - name: location_id
          in: path
          required: true
          schema:
            type: string
          example: loc_r8v4n2c6tz
        - 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 location discount analytics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationDiscountAnalytics'
        '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:
    LocationDiscountAnalytics:
      type: object
      required:
        - object
        - location_id
        - period
        - currency
        - summary
        - discounts
      properties:
        object:
          type: string
          enum:
            - location_discount_analytics
        location_id:
          type: string
          example: loc_r8v4n2c6tz
        period:
          $ref: '#/components/schemas/AnalyticsPeriod'
        currency:
          type: string
          example: EUR
        summary:
          $ref: '#/components/schemas/AnalyticsDiscountSummary'
        discounts:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsDiscountBreakdown'
    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
    AnalyticsDiscountSummary:
      type: object
      required:
        - redemption_count
        - amount
      properties:
        redemption_count:
          type: integer
          example: 38
          description: >-
            Number of discount applications; multiple discounts on one order
            count separately.
        amount:
          type: number
          example: 126.5
          description: Total value granted through discounts.
    AnalyticsDiscountBreakdown:
      type: object
      required:
        - name
        - redemption_count
        - amount
      properties:
        name:
          type: string
          example: WELCOME10
        redemption_count:
          type: integer
          example: 18
        amount:
          type: number
          example: 62.5
  securitySchemes:
    organization-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Location/organization API key.

````