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

# Issued-coupon stats

> Aggregate stats for issued coupons. total_issued = rewards redeemed (became coupons); used = coupons validated. Use reward_id for per-reward stats. A status filter is ignored so the breakdown spans all statuses.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/coupons/issued/stats/
openapi: 3.0.3
info:
  title: Zupy API v2
  version: 2.0.0
  description: >-
    Zupy API v2 — versioned, gateway-aware API with envelope responses, RFC 7807
    errors, and multi-auth support (JWT, API Key, Device Key).
servers:
  - url: https://api.zupy.com
    description: Production
security: []
tags:
  - name: Authentication
    description: OTP request and verification endpoints
  - name: Customers
    description: Customer management, points, history, and data operations
  - name: Loyalty Programs
    description: Loyalty program configuration and details
  - name: Rewards
    description: Loyalty reward catalog (definitions redeemed with points)
  - name: Companies
    description: Company information and loyalty configuration
  - name: Coupons
    description: >-
      Issued coupons (RewardRedemption) — both loyalty-reward redemptions and
      marketing claims
  - name: Wallet
    description: Apple Wallet pass generation and notifications
  - name: Webhooks
    description: Partner integration webhook endpoints
  - name: Webhook Management
    description: Configure and test outbound webhook delivery
paths:
  /api/v2/coupons/issued/stats/:
    get:
      tags:
        - Coupons
      summary: Issued-coupon stats
      description: >-
        Aggregate stats for issued coupons. total_issued = rewards redeemed
        (became coupons); used = coupons validated. Use reward_id for per-reward
        stats. A status filter is ignored so the breakdown spans all statuses.
      operationId: coupons_issued_stats
      parameters:
        - name: customer_id
          required: false
          in: query
          description: Restrict to one customer (LoyaltyUser id)
          schema:
            type: string
        - name: origin_type
          required: false
          in: query
          description: Coupon provenance
          schema:
            type: string
            enum:
              - loyalty_reward
              - marketing
        - name: reward_id
          required: false
          in: query
          description: 'Per-reward stats: restrict to one reward'
          schema:
            type: string
        - name: code
          required: false
          in: query
          description: Exact coupon_code lookup (case-insensitive)
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CouponStats'
                  meta:
                    type: object
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
      security:
        - apiKeyAuth: []
components:
  schemas:
    CouponStats:
      type: object
      properties:
        total_issued:
          type: integer
          readOnly: true
          description: Rewards redeemed = coupons issued
        used:
          type: integer
          readOnly: true
          description: Coupons validated/consumed
        usage_rate:
          type: number
          format: float
          readOnly: true
          description: used / total_issued * 100
        by_status:
          type: object
          additionalProperties:
            type: integer
          description: Count per status (active/used/expired/cancelled)
        by_origin:
          type: object
          additionalProperties:
            type: integer
          description: Count per origin (loyalty_reward/marketing)
    Error:
      type: object
      description: RFC 7807 Problem Details error response.
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
      required:
        - detail
        - instance
        - status
        - title
        - type
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Per-company partner API key (zupy_pk_…). Validated by Zupy against the
        company integration key hash (Story 14.x); send it on every request as
        the X-API-Key header. Scoped read-write to the owning company's data.

````