Skip to main content
PUT
/
api
/
v4.0
/
integrations
/
configurations
/
coupon
cURL
curl --request PUT \
  --url https://api.gameball.co/api/v4.0/integrations/configurations/coupon \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "url": "https://api.mywebsite.com/coupons",
  "method": "POST",
  "queryParams": [
    {
      "key": "appId",
      "value": "12345"
    }
  ],
  "headers": [
    {
      "key": "X-Client-Version",
      "value": "1.0"
    }
  ],
  "payload": "{ \"couponCode\": \"DISCOUNT10\" }",
  "couponMapping": {
    "fixed": "fixed_discount",
    "percentage": "percentage_discount",
    "freeProduct": "free_product",
    "freeShipping": "free_delivery"
  },
  "enableFreeProduct": true,
  "enableFixedRate": true,
  "enableFreeShipping": true,
  "enablePercentage": true,
  "platforms": [
    {
      "displayName": "<string>",
      "value": "<string>"
    }
  ]
}
'
{}

Update Coupon Configurations

This API call updates your coupon configurations, allowing you to modify details about how coupons are structured, authenticated, and mapped within Gameball.
Security: Provide both apikey and secretkey headers.

Authorizations

apikey
string
header
required

Body

application/json
url
string
required

The URL of your API endpoint where coupons are created. Gameball will send requests to this endpoint whenever a coupon needs to be generated.

Example:

"https://api.mywebsite.com/coupons"

method
string
required

The HTTP method used to send requests to the coupon creation endpoint. Allowed values are POST, PUT or GET.

Example:

"POST"

queryParams
object[]

List of query parameters used in the request. Those that will be appended to the URL endpoint. These are used to pass specific parameters required by your coupon system as part of the URL itself, often for identification, filtering, or configuration purposes. Each query parameter is defined by a key-value pair, allowing you to tailor requests based on requirements in your API.

headers
object[]

List of headers used in the request.

payload
string

This specifies the structure of the JSON body Gameball will send to your endpoint when creating a coupon. Since different systems may use varying parameter names and structures, you can customize this payload to align with your system's requirements. You should define the JSON payload with placeholders that Gameball will replace with actual data when sending the request. Example: { "customerId": "{{playerUniqueId}}", "amount": "{{value}}", "code": "{{code}}" }

Example:

"{ \"couponCode\": \"DISCOUNT10\" }"

couponMapping
object

A dictionary mapping coupon attributes to specific keys in your system.

enableFreeProduct
boolean

Indicates whether free product coupons are enabled.

Example:

true

enableFixedRate
boolean

Indicates whether fixed-rate discount coupons are enabled.

Example:

true

enableFreeShipping
boolean

Indicates whether free shipping coupons are enabled.

Example:

true

enablePercentage
boolean

Indicates whether percentage-based discount coupons are enabled.

Example:

true

platforms
object[]

List of platforms for which the coupon configurations are applied in your system.

Response

200

Coupon configurations updated successfully