Gameball Developers Guide
v3.0
Ask or search…
K

Cashback Rule 🤝

APIs to create, update or delete Redemption Rules and Configurations

Available Endpoints

Type
Description
Endpoint
POST
integrations/client/cashback/config/rule
PUT
integrations/client/cashback/rule/{ruleId}
PUT
integrations/client/cashback/rule
PUT
integrations/client/cashback/config
DELETE
integrations/client/cashback/rule/{ruleId}

Object Documentation

Cashback Rule

Attribute
Type
Description
id
integer
Id of the cashback rule
isDefaultRule
boolean
A boolean indicating if the cashback rule is the default one
minAmountToSpend
double
Amount needed to be spent in order to be rewarded the cashback
pointsRewardedAsCashback
double
Points awarded for the amount specified in minAmountToSpend
availableTo
Object
An AvailableTo object specifying the availability of the rule (To whom this rule will be applied on)

AvailableTo Object

Attribute
Type
Description
level
Object
A Level object indicating the level that the rule is available to,
The Level object has the following attributes:
  • levelName
    • String
  • levelId
    • integer
tags
array
An array of tag names that the rule is available to

POST - Create Cashback Rule

https://api.gameball.co/api/v3.0/integrations/client/cashback/config/rule
This API is used to create a client's cashback rule

Request

Attribute
Type
Required
Description
Authorization
string
Yes
Partner Access Token, The token is of type Bearer
storeId
string
Yes
Id of the store on the partner's system

Body

Note that you can only create cashback rules that are limited to a certain level or tags, you cannot create a general default cashback rule that is available to all players (A default cashback rule is created once a client is created automatically)
Attribute
Type
Required
Text
minAmountToSpend
double
Yes
Amount needed to be spent in order to be rewarded the cashback
pointsRewardedAsCashback
double
Yes
Points awarded for the amount specified in minAmountToSpend
availableTo
Object
Yes
An AvailableTo object specifying the availability of the rule (To whom this rule will be applied on)
(If left empty or null it will be applied to all)

Sample Request

{
"pointsRewardedAsCashback": 10.0,
"minAmountToSpend": 5,
"availableTo": {
"level": {
"levelId": 1234
}
}
}

Response

Body

Sample Response

{
"id": 12345,
"isDefault": false,
"minAmountToSpend": 6.0,
"pointsRewardedAsCashback": 10.0,
"availableTo": {
"level": {
"levelId": 12345,
"levelName": "Bronze"
},
"tags": []
}
}

PUT - Update Cashback Rule

https://api.gameball.co/api/v3.0/integrations/client/cashback/rule/{ruleId}
This API is used to update a client's cashback rule

Request

Header

Attribute
Type
Required
Description
Authorization
string
Yes
Partner Access Token, The token is of type Bearer
storeId
string
Yes
Id of the store on the partner's system

Path Parameters

Attribute
Type
Description
ruleId
integer
Id of the client's cashback rule

Body

Only parameters that will be updated should be sent

Sample Request

{
"amountToSpendForReward": 2,
"pointsRewardedAsCashback": 37
}

Response

Body

Sample Response

{
"id": 12345,
"isDefault": false,
"minAmountToSpend": 2.0,
"pointsRewardedAsCashback": 37.0,
"availableTo": {
"level": {
"levelId": 12345,
"levelName": "Bronze"
},
"tags": []
}
}

PUT - Update Default Rule

https://api.gameball.co/api/v3.0/integrations/client/cashback/rule
This API is used to update the default cashback rule (Cashback rule that applies to all players)

Request

Header

Attribute
Type
Required
Description
Authorization
string
Yes
Partner Access Token, The token is of type Bearer
storeId
string
Yes
Id of the store on the partner's system

Body

Attribute
Type
Description
isActive
boolean
A Boolean indicating if the cashback program is active
minAmountToSpend
double
Amount needed to be spent in order to be rewarded the cashback
pointsRewardedAsCashback
double
Points awarded for the amount specified in minAmountToSpend
{
"amountToSpendForReward": 2,
"pointsRewardedAsCashback": 37
}

Response

Body

Sample Response

{
"id": 12345,
"isDefault": true,
"minAmountToSpend": 2.0,
"pointsRewardedAsCashback": 37.0,
"availableTo": {
"level": {
"levelId": null,
"levelName": null
},
"tags": []
}
}

PUT - Update Cashback Configurations

https://api.gameball.co/api/v3.0/integrations/client/cashback/config
This API is used to updated general configrations of the cashback program

Request

Header

Attribute
Type
Required
Description
Authorization
string
Yes
Partner Access Token, The token is of type Bearer
storeId
string
Yes
Id of the store on the partner's system

Body

Only parameters that will be updated should be sent
Attribute
Type
Text
isCashbackActive
boolean
A Boolean flag indicating if the Cashback program is active for the client
returnWindowDuration
integer
Number of days that the player can return an order and points get deducted accordingly

Sample Request

{
"isCashbackActive": false,
"returnWindowDuration": 20
}

Response

Body

Attribute
Type
Description
isCashbackActive
boolean
A Boolean flag indicating if the Cashback program is active for the client
returnWindowDuration
integer
Number of days that the player can return an order and points get deducted accordingly

Sample Response

{
"isCashbackActive": false,
"returnWindowDuration": 20
}

DELETE - Delete Cashback Rule

https://api.gameball.co/api/v3.0/integrations/client/cashback/rule/{ruleId}
This API deletes a client's cashback rule

Request

Header

Attribute
Type
Required
Description
Authorization
string
Yes
Partner Access Token, The token is of type Bearer
storeId
string
Yes
Id of the store on the partner's system

Path Parameters

Default rule cannot be deleted
Parameter
Type
Description
ruleId
integer
Id of the client's cashback rule

Response

Body

No Response Body

Sample Response

true