https://your-app-api/coupon/create.

Coupon Redemption Workflow
The integration workflow involves two primary actions:- Initiating Redeem Request: Triggered when a customer wants to redeem points for a coupon or receives a campaign-based coupon reward.
- Coupon Generation: Gameball sends an HTTP request to your specified endpoint for creating coupons, based on your system configurations.
This integration guide will walk you through two main steps: setting up your coupon system integration and enabling customer redemption and usage of those coupons.
Integration Guide Structure
- Integrate Your Coupon System
Configure Gameball to work with your coupon system: endpoint details, request parameters, and payload structures in the Gameball dashboard. Once completed, Gameball can automatically generate coupons in your system based on customers’ redeemed points or campaign rewards. - Customer Coupon Redemption and Usage
After configuration, learn how customers redeem points to obtain coupons and how to use those coupons during checkout.
Setting Up Coupon Configuration in Gameball
To start, access the coupon configuration section in the Gameball dashboard and provide the necessary details about your coupon endpoint.
Attributes
urlstring (Required)The URL of your API endpoint where coupons are created. Gameball sends requests to this endpoint whenever a coupon needs to be generated.
method
string (Required)HTTP method used to send requests to the coupon creation endpoint. Common values are
POST or PUT.
contentType
string (Required)Request content type expected by your server. Common values:
application/json or application/x-www-form-urlencoded.
authentication
object (Optional)Authentication details required to access the coupon API (e.g.,
Basic or Bearer).
queryParams
array (Optional)Query parameters appended to the endpoint URL (key-value pairs) for identification, filtering, or configuration.
headers
array (Optional)Custom headers required for the request (e.g., API keys).
payload
object (Optional)Structure of the JSON body Gameball sends to your endpoint when creating a coupon. Use placeholders that Gameball replaces with actual data.
couponMapping
object (Optional)Enable/disable supported coupon types in your system.
platforms
array (Optional)Platforms where the configuration applies (web, mobile, POS).
Testing and Validating Configuration
After setting up your configurations:- Use Test Connection in the Gameball dashboard to ensure the integration is working, or use the Get Coupon Configuration API to view or verify your existing configuration. This API provides details on your current setup, helping ensure that Gameball correctly communicates with your couponing system.
- Confirm that your coupon creation endpoint returns a
200status for successful coupon creation.
Example Coupon Model
Define a coupon model in your system that matches Gameball structure. This enables consistent data exchange between Gameball and your coupon system.Coupon Creation Endpoint
Create an endpoint in your system for Gameball to call when generating coupons.Example using e-commerce platform (WooCommerce)
Please note that the same steps can be applied to different platforms with slight changes based on your platform; we are only using WooCommerce for the sake of this example.
Integrating With WooCommerce coupon API
We are only interested in the create coupon endpoint, so we can safely ignore other endpoints related to coupons.- Search for the API responsible for creating coupons (e.g., WooCommerce Create a coupon).
- Fill in the configurations based on the create coupon endpoint’s request structure. For example, WooCommerce expects the following JSON when creating a new coupon:
- Coupon creation endpoint: https://example.com/wp-json/wc/v3/coupons
- Method: POST
- Request Headers (example OAuth header keys/values)
discount_type → coupon_type), adjust accordingly:
code is required, so the following is also valid:
The coupon creation endpoint must return HTTP 200 for the coupon to be created successfully.
- Define coupon type values. For WooCommerce, discount types include
percent,fixed_cart, andfixed_product. Enable the corresponding types in the Gameball dashboard and provide the matching values. - Click Test Connection to verify your configuration.
Coupon Redemption Guide
Once a coupon is redeemed or awarded to a customer, it can be applied to an order, allowing the customer to enjoy discounts or offers based on the coupon configurations. Overview of Coupon Redemption Scenarios- Coupon as a Campaign Reward
Configure campaigns in the dashboard where customers can win coupons as rewards. When a customer completes campaign criteria, Gameball issues a coupon to the customer’s account for later use. - Manual Coupon Redemption
Customers can redeem points for a coupon by specifying aruleIdin the redemption payload. Retrieve rule IDs using the Get Redemption Configurations endpoint.
Manual Coupon Redemption
If a customer opts to redeem a coupon using their points, follow the steps below to ensure a smooth redemption process: 1. Retrieve Redemption Rules Use the Get Redemption Configurations endpoint to fetch available redemption rules.ruleId.