Get Customer Coupons API
Retrieving a customer’s active coupons allows your application to show users what promotions or discounts they can apply during checkout.This API helps you display live coupon data directly within your storefront, mobile app, or POS system, ensuring customers can use their benefits conveniently.
Overview
The Get Customer Coupons API returns all active and eligible coupons linked to a specific customer.Each coupon includes details such as:
- 🟢 Coupon status (active, expired, or used)
- 💸 Discount type and value
- 📅 Expiration date
- 🔢 Usage limits and remaining uses
When to Use It
| Channel | Example Use |
|---|---|
| 🛍️ E-commerce | Display the customer’s available coupons on the checkout or profile page. |
| 📱 Mobile App | Show “My Coupons” in a loyalty or rewards tab. |
| 🏪 POS (Retail) | Allow cashiers to view and apply valid coupons when identifying a customer. |
Important: Filtering Is Done on Your End
Gameball’s API returns all coupons, not only the active or valid ones.To determine which coupons to display to customers, use the attributes returned in each coupon object.
| Attribute | Description | Usage Recommendation |
|---|---|---|
isExpired | true if the coupon’s expiry date has passed. | Hide expired coupons from the UI or show them under an “Expired” section. |
isActive | true if the coupon is currently active and not deactivated by the admin. | Show only active coupons to users. |
usageLimit | The total number of times this coupon can be used globally (across all customers). | Track whether the coupon has reached its max usage. |
limitPerCustomer | The maximum number of times this coupon can be used by a single customer. | Use to determine if the customer has remaining uses. |
usedCount | How many times has this coupon been used globally. | Compare with usageLimit to see if it’s still available. |
customerUsedCount | How many times has this specific customer used this coupon. | Compare with limitPerCustomer to check individual eligibility. |
isAvailableToUse | true if the coupon is both active and available for this customer to use. | Ideal flag to directly determine if the coupon should appear as “Usable.” |
Example Scenarios
Scenario 1: Displaying Active Coupons at Checkout
.png?fit=max&auto=format&n=E1xrJosZXF_642Xq&q=85&s=c22e8ce01bd0678ab0f5a13f10b70773)
1
Fetch coupons
Call the Get Customer Coupons API using the customer’s
customerId2
Display them in the UI
List all returned coupons so the customer can select one to apply at checkout.
3
Apply on selection
When the customer selects a coupon, pass its code to the Validate API before calling the Order API/Burn API.
To understand how to burn coupons, refer to this tutorial
Example Request
Example Response
Filtering Logic Example
Here’s a simple way to determine which coupons to show to customers in your frontend or app:Active
Not Expired
Not already used to their limit
Available for redemption
You can still display expired or used coupons in a separate “History” or “Expired Coupons” section for transparency.
Scenario 2: Displaying “My Coupons” in the Gameball Widget
If you’re using the built-in Gameball Widget, you don’t need to integrate this API directly; the My Coupons section automatically fetches and displays all active coupons for the logged-in customer.Key Notes for Developers
Always use the latest
customerId when retrieving coupons, especially for merged profiles (email + mobile).Coupons can be validated or locked through the Validate Coupon API before checkout.