Coupons

The Coupons API can be used to validate individual or multiple coupon codes, create and manage hold coupons for future use, burn held coupons, and release held coupons when no longer needed.

This endpoint is only available for our GURU clients only 👑

Available Endpoints

POST - Validate Single Coupon

https://api.gameball.co/api/v3.0/integrations/coupons/{coupon}/validate

mobile or email should replace customerId in case (only if) your account supports channel merging.

Request

Path Parameters

Body

Response

Coupon Object

Sample Response

{
    "valid": true,
    "coupon": {
        "code": "teg17zlvne",
        "type": "percentage",
        "value": 10.0,
        "usageLimit": 1000,
        "limitPerCustomer": 10,
        "startDate": null,
        "expiryDate": null,
        "capping": 0.0,
        "minOrderValue": 0.0,
        "productId": null,
        "variantId": null,
        "collections": null,
        "combinesWith": {
            "orderDiscounts": true,
            "productDiscounts": false,
            "shippingDiscounts": false
        }
    },
    "holdReference": "b07ae032db4e4e73b3b42019922f00aa",
    "dateToExpire": "2024-08-01T13:32:52.8353324Z"
}

Usage Example

The example shown is a request sent to Gameball to validate a coupon for specific customer.

curl -X POST "https://api.gameball.co/api/v3.0/integrations/coupons/{coupon}/validate" \
-H "APIKey: 807b041b7d35425988e354e1f6bce186" \
-H "SecretKey: klmb041b7d354259l3u4ft35e1q2r3703" \
-H "Content-Type: application/json" \
-d '{
  "customerId": "player456",
  "mobile": "010XXXXXXXX",
  "email": "player@email.com",
  "lock": true,
  "holdReference": null
}'

POST - Validate Multiple Coupon

https://api.gameball.co/api/v3.0/integrations/coupons/validate

mobile or email should replace customerId in case (only if) your account supports channel merging.

Please note that coupons must allow combination to use validate them together.

Request

Header

Body

Response

Coupon Object

Sample Response

{
    "valid": true,
    "coupons": [
        {
            "code": "teg17zlvne",
            "type": "percentage",
            "value": 10.0,
            "usageLimit": 1000,
            "limitPerCustomer": 10,
            "startDate": null,
            "expiryDate": null,
            "capping": 0.0,
            "minOrderValue": 0.0,
            "productId": null,
            "variantId": null,
            "collections": null,
            "combinesWith": {
                "orderDiscounts": true,
                "productDiscounts": false,
                "shippingDiscounts": false
            }
        },
        {
            "code": "4ik4o6rsjp",
            "type": "fixed",
            "value": 20.0,
            "usageLimit": 10,
            "limitPerCustomer": 1,
            "startDate": null,
            "expiryDate": "2040-12-31T21:59:00Z",
            "capping": 0.0,
            "minOrderValue": 100.0,
            "productId": null,
            "variantId": null,
            "collections": null,
            "combinesWith": {
                "orderDiscounts": true,
                "productDiscounts": false,
                "shippingDiscounts": false
            }
        }
    ],
    "holdReference": "baf808b3d0554a81b32b2ff500f52c79",
    "dateToExpire": "2024-08-01T13:29:41.905912Z"
}

Usage Example

The example shown is a request sent to Gameball to validate multiple coupons for specific customer.

curl -X POST "https://api.gameball.co/api/v3.0/integrations/coupons/validate" \
-H "APIKey: 807b041b7d35425988e354e1f6bce186" \
-H "Content-Type: application/json" \
-d '{
  "customerId": "player456",
  "mobile": "010XXXXXXXX",
  "email": "player@email.com",
  "coupons": ["coupon_code_1", "coupon_code_2"],
  "lock": true,
  "holdReference": null
}'

POST - Burn Coupons

https://api.gameball.co/api/v3.0/integrations/coupons/{holdReference}/burn

Note: If the coupon code has already been sent and used via the Order API, you do not need to use this API for burning the coupons. The Order API will handle the processing and redemption of the coupons automatically, ensuring the coupon is burned.

Request

Headers

Path Parameters

Usage Example

curl -X POST "https://api.gameball.co/api/v3.0/integrations/coupons/{holdReference}/burn" \
-H "APIKey: 807b041b7d35425988e354e1f6bce186" \
-H "SecretKey: klmb041b7d354259l3u4ft35e1q2r3703"

DELETE - Release Coupons

https://api.gameball.co/api/v3.0/integrations/coupons/{holdReference}/release

Request

Header

Path Parameters

Usage Example

curl -X DELETE "https://api.gameball.co/api/v3.0/integrations/coupons/{holdReference}/release" \
-H "APIKey: 807b041b7d35425988e354e1f6bce186" \
-H "SecretKey: klmb041b7d354259l3u4ft35e1q2r3703"