Skip to content

Voucher Analytics API Documentation

This API allows vendor to manage coupon.


Endpoints Overview

The Voucher Analytics API provides vendors and authorized vendor roles with insights into coupon performance, including redemption counts, total sales, discount amounts, and customer engagement.

Method Endpoint Description
GET /api/v1/checkout/vendor/coupon-analytics/global_and_shop_coupons/ Get Insights for Global and Shop-Specific Coupons
GET /api/v1/checkout/vendor/coupon-analytics/shop_specific_coupons/ Get Insights for Shop-Specific Coupons

Coupon Analytics

1. Get Insights for Global and Shop-Specific Coupons

Endpoint

  • URL: /api/v1/checkout/vendor/coupon-analytics/global_and_shop_coupons/
  • Method: GET
  • Permission Required: AllowAny

Description

Fetches performance metrics for both global and shop-specific coupons.

Example Request

This is the example request

GET /api/v1/checkout/vendor/coupon-analytics/global_and_shop_coupons/


Success

{
    "total_redemptions": 14,
    "total_sales": 3320.0,
    "total_discount": 1200.0,
    "net_sales": 2120.0,
    "unique_customers": 0,
    "coupon": [
        {
            "code": "FLAT100",
            "discount_percent": 0.0,
            "money_value_off": 100.0,
            "usage_count": 1,
            "total_sales": null,
            "total_discount": null,
            "net_sales": null,
            "unique_customers": 0
        },
        {
            "code": "FLAT500",
            "discount_percent": 0.0,
            "money_value_off": 100.0,
            "usage_count": 1,
            "total_sales": 150.0,
            "total_discount": 100.0,
            "net_sales": 50.0,
            "unique_customers": 0
        }
    ]
}


2. Get Insights for Shop-Specific Coupons

Endpoint

  • URL: /api/v1/checkout/vendor/coupon-analytics/shop_specific_coupons/
  • Method: GET
  • Permission Required: IsAuthenticated

Description

Fetches performance metrics only for the coupons associated with the logged-in vendor's shop.

Example Request

This is the example request

GET /api/v1/checkout/vendor/coupon-analytics/shop_specific_coupons/


Success

{
    "total_redemptions": 0,
    "total_sales": 0.0,
    "total_discount": 0.0,
    "net_sales": 0.0,
    "unique_customers": 0,
    "coupon": [
        {
            "code": "WINE200",
            "discount_percent": 20.0,
            "money_value_off": 0.0,
            "usage_count": 0,
            "total_sales": null,
            "total_discount": null,
            "net_sales": null,
            "unique_customers": 0
        },
        {
            "code": "WINE0",
            "discount_percent": 20.0,
            "money_value_off": 0.0,
            "usage_count": 0,
            "total_sales": null,
            "total_discount": null,
            "net_sales": null,
            "unique_customers": 0
        }
    ]
}