Object Reference
This section provides a list of the objects dealt with using the available API endpoints.

Cashback Object

The cashback object is returned in the Configurations API response body. It describes the cashback program configurations.
Parameter
Type
Description
rewardFactor
number
In case you have different merchants (brands) on your platform, The rewardFactor defines the specific cashback percentage for the paid amount to be rewarded to your players.
Example: If you give 5% cashback (when the customer pays 100 USD, they will get 5 USD cashback). The rewardFactor would be 0.05
amountRewardThreshold
integer
Defines the amount of unit currencies needed to reward the player as per cashback rules. Example: For every 10 USD spent the player gets rewarded by 5 points, implies that the amountRewardThreshold is "10".
rewardWalletFactor
integer
Determines the points rewarded for each unit currency your player spends.
Example: 2 points for every 1 USD spent, implies that the rewardWalletFactor is "2"
rewardRankFactor
integer
In case your level up method is score, this factor determines the score rewarded for each unit currency your player spends.
Example: 2 Score for every 1 USD spent, implies that the rewardRankFactor is "2"
1
{
2
"rewardFactor":0.3,
3
"amountRewardThreshold":10,
4
"rewardWalletFactor":3,
5
"rewardRankFactor":1
6
}
Copied!

Challenge Object

Represents the challenge object that describes a configured challenge and tracks the relative player's progress.
Parameter
Type
Description
id
integer
Unique identifier for the challenge.
name
string
Challenge Name
description
string
Challenge Description
rankReward
integer
Awarded rank upon challenge completion
walletReward
integer
Awarded points upon challenge completion
repeatable
boolean
A flag that indicates whether the challenge is repeatable or not.
maxAchievement
integer
An integer that defines how many times a player can achieve that challenge.
type
string
The type of the challenge. Possible values are as follows: SignUp
SocialMedia
ScheduledChallenge
EventBased
HighScore
Birthday
Anniversary
visibility
string
Defines the visibility of the challenge. Possible values are:
  • "AlwaysVisibile"
  • "NotVisible"
  • "VisibleIfEarned"
icon
string
The icon's URL of the challenge.
availability
object
"availability":{
"minLevel": 4,
"tags": ["VIP"]
}
An object that describes challenge availability to players.
  • minLevel : Minimum required level for the player to be eligible to the achieve the challenge.
  • tags: Array of tags for which the challenge is available.
1
{
2
"id":3350,
3
"name":"view product + tag internal",
4
"description":"",
5
"rankReward":3,
6
"walletReward":10,
7
"repeatable":true,
8
"maxAchievement":0,
9
"type":"EventBased",
10
"visibility":"AlwaysVisible",
11
12
"availability":{
13
"minLevel":5,
14
"tags":[
15
"2nd tag"
16
]
17
}
18
}
Copied!

Event Object

The Event object is how you record any actions your users perform, along with any metadata that describe the action. For further elaboration on events check Understand your players' events.β€Œ

Event and Metadata example:

Event Name
Key
Value
buy
product_id
a123456
​
price
30
​
product_category
fashion
​
product_tags
men & new_collection
1
"buy": {
2
"product_id": "a123456",
3
"price": 30,
4
"product_category": "fashion"
5
"product_tags": ["men", "new_collection"]
6
}
Copied!
The following example shows a collection of events
1
"events": {
2
"buy": {
3
"category": "Electronics",
4
"amount": 300
5
},
6
"travel": {
7
"destinations": ["Paris", "Cairo"],
8
"tickets": 4,
9
"season": "Winter"
10
},
11
"visit_branch": {}
12
}
Copied!

Leaderboard object

Defines the player rank and progress in the leaderboard based on the specified query parameters.
Parameter
Type
Description
displayName
string
Player's display name.
playerUniqueId
string
Unique identifier for a player at Gameball.
progress
integer
Player's progress (based on the specified query parameters).
rank
integer
Player's Rank (based on the specified query parameters).
levelName
string
Level Name.
Example: "Bronze"
levelIcon
string
Level's icon URL.
1
{
2
"displayName": "Player 1",
3
"playerUniqueId": "5097238429738",
4
"progress": 1748,
5
"rank":1,
6
"levelName": "Bronze",
7
"levelIcon": "https://cdn.gameball.co/uploads/c007/[email protected]"
8
}
Copied!

Level Object

Contains information about the player's current level.β€Œ

Parameters Description

Parameter
Type
Description
minProgress
integer
The required score to reach the level.
order
integer
Level Order
icon
string
icon URL of the level.
name
string
Level Name
benefits
object
"benefits":{
"rankReward":0,
"walletReward":0,
"levelDiscount":0,
"discountCapping":0,
"others":[]
}
The benefits object is defined as follows:
  • rankReward: Score rewarded upon reaching that level.
  • walletReward : Points rewarded upon reaching that level.
  • levelDiscount: The discount amount that the level grants.
  • discountCapping: The maximum value to which the discount is applicable. Example: 10% discount for maximum order price 100 USD
  • others: An array of statement(s) that can be used to describe the benefits of the level.
1
{
2
"name": "Gold",
3
"description": null,
4
"levelStartScore": 7500,
5
"levelOrder": 4,
6
"iconPath": "https://cdn.gameball.co/uploads/Client 1/[email protected]",
7
"benefits": {
8
"scoreEnteryReward": 0,
9
"pointsEnteryReward": 0,
10
"levelDiscount": null,
11
"discountCapping": null
12
}
13
}
Copied!

LineItems Object

Represent a Product in your system with its relative information, this object is used in the Orders API.
Attribute
Type
Description
productId
string
The ID of the product that the line item belongs to
sku
string
The item's SKU (stock keeping unit).
title
string
The title of the product.
category
array
Product category (fashion, electronics.. etc). It can be one category or multiple categories.
Example:["natural","cosmetics"]
collection
array
Collection ID(s) to which the product belongs. It can be one collection or multiple collections. This will be also based on the available collections in your store.
Example:["14313","4343"]
tags
array
Tag(s) attached to the item in the order.
Example:["VIP", "Elite"]
weight
number
Item weight. Must be positive.
vendor
string
The name of the item's supplier.
Example:"nike"
1
{
2
"productId":"197765",
3
"tag": ["VIP"],
4
"category": [
5
"natural",
6
"cosmetics"
7
],
8
"weight": "20",
9
"vendor": "nike",
10
"collection": ["14313", "4343"]
11
}
Copied!

Merchant Object

Holds information of merchant and its branchβ€Œ

Parameters Description

Parameter
Type
Description
uniqueId
string
Merchant unique id or code
name
string
Merchant name
branch
string
Optional branch information
branch.uniqueId
string
Branch unique id or code
branch.name
string
Branch name
1
"merchant": {
2
"uniqueId": "string",
3
"name": "string",
4
"branch": {
5
"uniqueId": "string",
6
"name": "string"
7
}
8
}
Copied!

Notification Object

Represents a notification that your player receives.
Attribute
Type
Description
notificationId
string
Unique Identifier for a notification
title
string
Notification Title
body
string
Notification Body
isRead
boolean
Indicates whether the notification is read or not.
createdAt
string
Notification's creation date, as an ISO8601 timestamp.
Example: "2019-09-21T16:53:28.190Z"
lang
string
The language in which the notification is displayed. In case the lang is not provided in the request, defaultlang is returned.
Note: The language provided should be as per configured languages in your account.
Example: "en", "fr".
icon
string
Notification's icon URL.
1
{
2
"notificationId" : "123",
3
"title": "New level!",
4
"body": "Keep it up! You are now on Bronze ",
5
"isRead": true,
6
"createdAt": "2021-05-12T00:08:09.646174",
7
"lang": "en",
8
"icon": "https://cdn.gameball.co/uploads/client776/ad8b2587-959f-48fd-ab58-a643323652begb-icon-level-13.png"
9
}
Copied!

Score Object

Contains info about the player's score.β€Œ

Parameters Description

Parameter
Type
Description
scoreBalance
string
Player Score
scoreName
string
The naming of the score points that appears to the player.
1
"score": {
2
"scoreBalance": 15830,
3
"scoreName": "Score"
4
}
Copied!

PlayerAttributes Object

Contains all of the attributes describing your player.β€Œ

Parameters Description

Parameter
Type
Description
displayName
string
Player's display name
firstName
string
Player's first name
lastName
string
Player's last name
gender
string
Player's gender. Example: M or F, Male or Female.
email
string
Player's email
dateOfBirth
string
Player's date of birth
Example: "1980-09-19T00:00:00.000Z"
joinDate
string
Player join date at your system.
Example: "2019-09-19T21:06:29.158Z"
tags
string
Comma separated string of tags to be attached to the player.
Example: "VIP,Platinum"
community
string
Describe which community a player belongs to.
custom
object
Key value pairs of any extra player attributes.
{"class" : "E2022", "weight" : 78}
1
"playerAttributes": {
2
"displayName":"Jon Snow",
3
"firstName": "Jon",
4
"lastName": "Snow",
5
"email":"[email protected]",
6
"gender":"M",
7
"dateOfBirth":"1980-09-19T00:00:00.000Z",
8
"joinDate":"2019-09-19T21:06:29.158Z",
9
"tags": "VIP,Platinum",
10
"custom":{
11
"location":"Miami",
12
"graduationDate":"2018-07-04T21:06:29.158Z",
13
"isMarried":false
14
}
15
}
Copied!

Points Object

Contains information about the player's points.β€Œ

Parameters Description

Parameter
Type
Description
pointsBalance
number
Player Points
pointsValue
number
The actual value equivalent to player points.
currency
string
Store Currency
pointsName
string
The naming of the rewarding points that appears to the player.
1
"points": {
2
"pointsBalance": 11500,
3
"pointsValue": 115,
4
"currency": "USD",
5
"pointsName": "Points"
6
}
Copied!

Referral Object

The referral object is returned in the configurations API response body. It describes the referral program configurations.
Parameter
Type
Description
referralMethod
string
Defines how the referral program rewards your players, Possible values:
  • "PlayerAndFriend" denotes that both the referring and the referred player should be rewarded. The referred player also should complete the sign up process and perform a certain action according to your configurations.
  • "PlayerOnly" denotes that only the referring player that should be rewarded after a successful referral.
  • "PlayerAndGuest" denotes that both the referring and the referred player should be rewarded. Referred Player Registration is optional, but he would be rewarded after placing a successful order.
eventName
string
The name of the event which is linked to the referral action
eventMetaData
string
The event metadata which value should be monitored and checked for completing the referral.
playerReward
object
"playerReward":{
"extraReward":{
"rewardEvery":5,
"rewardType":null,
"score":2,
"point":1,
"voucher":null
},
"rewardType":"Vouchers",
"score":0,
"point":0,
"voucher":{
"voucherType":"Free Shipping",
"productId":"",
"productName":"",
"value":0
}
}
An object that defines the referring player's reward.
The playerReward object is defined as follows:
  • extraReward: An object that defines the extra reward the referring player is granted after completing specific number of referrals. "extraReward":{
    "rewardEvery":5,
    "rewardType":null,
    "score":2,
    "point":1,
    "voucher":null
    }
    • rewardEvery:Defines the frequency upon which the referring player is rewarded
    • rewardType : Defines the type of the reward, possible values are:
      • "Vouchers"
      • "Score&Points"
    • score: Score rewarded as an extra reward.
    • points: Points rewarded as an extra reward.
    • voucher: An object that defines the rewarded voucher.
    "voucher": {
    "voucherType":"Free Product",
    "productId":"6161866621123",
    "productName":"Antique Drawers",
    "value":250
    }
  • rewardEvery:Defines the frequency upon which the referring player is rewarded
  • rewardType : Defines the type of the reward, possible values are:
    • "Vouchers"
    • "Score&Points"
  • score: Score rewarded as an extra reward.
  • points: Points rewarded as an extra reward.
  • voucher: An object that defines the rewarded voucher.
friendReward
object
Defines the referred player reward configurations in case the referralMethod is "PlayerAndFriend" meaning that the referred player should also be rewarded.
The object is the same as the playerReward object excluding the extraReward.
1
{
2
"referralMethod":"PlayerAndFriend",
3
"eventName":"",
4
"eventMetaData":null,
5
"playerReward":{
6
"extraReward":{
7
"rewardEvery":5,
8
"rewardType":null,
9
"score":2,
10
"point":1,
11
"voucher":null
12
},
13
"rewardType":"Vouchers",
14
"score":0,
15
"point":0,
16
"voucher":{
17
"voucherType":"Free Shipping",
18
"productId":"",
19
"productName":"",
20
"value":0
21
}
22
},
23
"friendReward":{
24
"rewardType":"Vouchers",
25
"score":0,
26
"point":0,
27
"voucher":{
28
"voucherType":"Free Product",
29
"productId":"6161866621123",
30
"productName":"Antique Drawers",
31
"value":250
32
}
33
}
34
}
Copied!

Transaction object

Describes any transaction made in your system.
Attribute
Type
Description
transactionId
string
Unique transaction ID which identifies the underlying transaction in your system, e.g. order number, invoice number. It will be used for reversing any reward or redemption transaction on Gameball.
gameballTrasnactionId
integer
Transaction ID on Gameball system.
type
string
Transaction type string. Can be one of the following:
AchievementReward
PaymentReward
Refund
Redemption
Expiry
Cancel
Migration
ManualAccumulation
DiscountCode
ManualDeduction
ManualReward
direction
string
Either "+" or "-" indicating transaction was an addition or deduction
playerUniqueId
string
Player unique identifier used to uniquely identify the player on Gameball.
points
integer
Number of points involved in the transaction
amount
number
Monetary amount involved in the transaction
transactionTime
string
Time of transaction in your system in UTC, e.g. order datetime, invoice datetime.
Note: transactionTime is automatically handled when using server-side SDKs.
Example: "2019-09-19T16:14:09.895Z"
merchantName
string
Merchant name for transaction
branchName
string
Branch Name for transaction
1
{
2
"transactionId":"trx123",
3
"gameballTransactionId":"gbtrx123",
4
"transactionTime":"2019-09-21T16:53:28.190Z",
5
"type":"Cash Back",
6
"direction":"+",
7
"playerUniqueId":"1234",
8
"points":500,
9
"amount":10,
10
"merchantName":"merchant",
11
"branchName":"branch"
12
}
Copied!
Last modified 4mo ago