Skip to main content

Apply Coupon

Apply a discount coupon to the shopping cart.

Authentication

Requires user authentication (optional for guest users).

Request Body

coupon
string
required
Coupon code to apply (case-insensitive, will be converted to uppercase)
platform
string
default:"app"
Platform identifier (app/web/offline)

Response

Returns the updated cart with coupon discount applied.
products
object
Products in cart with updated pricing
meta
object
Cart metadata including coupon details and calculations
meta.items
array
Array of metadata items including coupon information
calculations
object
Updated cart totals with coupon discount

Coupon Validation Flow

  1. Code Sanitization - Coupon code is sanitized and converted to uppercase
  2. TSS Points Check - Coupons cannot be used with TSS points
  3. Coupon Validation - Checks validity against:
    • Date range (start_date to end_date)
    • Platform eligibility (app/web/both/all)
    • User eligibility (new users, specific users)
    • Product categories
    • Minimum order amount
    • Usage limits
  4. Cart Update - Applies discount to eligible products
{
  "products": {
    "items": [
      {
        "prod_id": 12345,
        "product": "Classic T-Shirt",
        "price": 799,
        "quantity": 2,
        "sub_total": 1598,
        "coupon_discount": 200
      }
    ]
  },
  "meta": {
    "items": [
      {
        "name": "coupon",
        "coupon": "SAVE200",
        "message": "Coupon applied successfully"
      },
      {
        "name": "calculations",
        "sub_total": 1598,
        "coupon_discount": 200,
        "total": 1398
      }
    ]
  }
}

Error Responses

title
string
Error title
description
string
Detailed error message
{
  "title": "Invalid Coupon",
  "description": "This coupon is not valid for your cart"
}

Get Valid Coupons

Retrieve all valid coupons applicable to the current cart.

Request Body

platform
string
default:"app"
Platform identifier (app/web/offline)

Response

Returns an array of valid coupons for the current cart.
id
integer
Coupon ID
coupon_id
integer
Coupon identifier
voucher_code
string
Coupon code
message
string
Coupon description/message
type
string
Voucher type (percentage/fixed)
discount
number
Discount value (percentage or fixed amount)
min_amount
number
Minimum order amount required
min_quantity
integer
Minimum quantity of items required
voucher_percentage_max_val
number
Maximum discount cap for percentage coupons
categories
array
Array of category IDs this coupon applies to
[
  {
    "id": 101,
    "coupon_id": 101,
    "voucher_code": "SAVE200",
    "message": "Get ₹200 off on orders above ₹1499",
    "type": "fixed",
    "discount": 200,
    "min_amount": 1499,
    "min_quantity": 1,
    "voucher_percentage_max_val": null,
    "categories": [12, 45, 67]
  },
  {
    "id": 102,
    "coupon_id": 102,
    "voucher_code": "FIRST20",
    "message": "Get 20% off on your first order",
    "type": "percentage",
    "discount": 20,
    "min_amount": 999,
    "min_quantity": 1,
    "voucher_percentage_max_val": 500,
    "categories": [12, 34, 45, 67]
  }
]

Coupon Restrictions

  • Cannot be combined with TSS points
  • Cannot be combined with app discount (if enabled)
  • Some products may be excluded from coupon discounts
  • User-specific coupons require authentication
  • Platform-specific coupons (app-only or web-only)
  • Time-based restrictions (date range validity)
  • Usage limit per user

Coupon Types

  • Fixed Amount - Flat discount (e.g., ₹200 off)
  • Percentage - Percentage discount with optional maximum cap
  • MxN Offers - Buy M, get N free
  • Category-Specific - Applies only to certain product categories
  • New User - Valid only for first-time customers
  • User-Specific - Targeted coupons for specific users

Build docs developers (and LLMs) love