Skip to main content
POST
/
api
/
v4.0
/
integrations
/
coupons
/
{code}
/
validate
cURL
curl --request POST \
  --url https://api.gameball.co/api/v4.0/integrations/coupons/{code}/validate \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "customerId": "<string>",
  "email": "<string>",
  "mobile": "<string>",
  "lock": true,
  "pin": "<string>"
}
'
{
  "isValid": true,
  "lockReference": "<string>",
  "discountAmount": 123,
  "discountType": "<string>"
}
This API validates a single coupon identified by {code} and checks its eligibility for use by a customer. It also supports a locking feature, where setting the lock flag to True reserves the coupon by creating a lock reference. This ensures the coupon cannot be used by others during the lock session, preventing conflicts or double usage. By default, the lock flag is False, allowing only validation without reserving the coupon.
Channel Merging Available
If your system uses different customer IDs across multiple channels (e.g., online and offline), Gameball’s channel merging feature helps unify customer profiles. By including the customer’s mobile number or email (based on your merging configuration) with each request, Gameball will combine activities into a single profile.
For more information, head to the Channel Merging Guide.

Path Parameters

code
string
required
The coupon code to validate.

Request Body

customerId
string
required
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email or anything that uniquely identifies the customer.
email
string
Customer’s email address.
This is required if your account uses email-based channel merging.
mobile
string
Customer’s mobile number.
This is required if your account uses mobile-based channel merging.
lock
boolean
Whether to lock the coupon for exclusive use. When set to true, creates a lock reference to reserve the coupon.
pin
string
Pin code required for the coupon, if applicable.

Response

isValid
boolean
Whether the coupon is valid and can be used.
lockReference
string
Reference ID for the locked coupon, if locking was requested.
discountAmount
number
The discount amount that will be applied.
discountType
string
Type of discount (fixed, percentage, shipping, etc.).

Authorizations

apikey
string
header
required

Path Parameters

code
string
required

Body

application/json
customerId
string
required
email
string
mobile
string
lock
boolean
pin
string

Response

200 - application/json

Coupon validated successfully

isValid
boolean
lockReference
string
discountAmount
number
discountType
string