Transactions
Transactions API is responsible for all the player's points transactions.
Transactions are player's points transactions, through which they earn and redeem points. Transactions have two types: accumulation and deduction. Learn more about Transactions through our Help Center.
The following APIs use Hashing Function SHA1, Check how Hashing is done below
Player Points Balance
POST
/integrations/transaction/balance
The API call is used to retrieve player's current points balance available for redemption and the corresponding equivalent amount.
Headers
Name | Type | Description |
---|---|---|
APIKey | string | Client API key |
Request Body
Name | Type | Description |
---|---|---|
playerUniqueId | string | Player unique identifier used to uniquely identify the player on Gameball. |
hash | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section. Note: hashing is automatically handled when using server-side SDKs. |
Response Description
Attribute | Description |
| Player points |
| The actual value equivalent to player points. |
| Store currency |
| The custom name selected instead of points, which appears to players. |
Usage Example
The example shown is a request sent to Gameball to get a player's balance with his playerUniqueId
Hold Points
POST
/integrations/transaction/hold
The API is used to hold a specific amount of points from the player’s points balance. This is used to guarantee the availability of the points to be redeemed until the checkout process is completed. After a successful call, the API returns a hold reference number that is used later in the redemption API. Hold is active at Gameball for 10 minutes and automatically expires afterwards.Once the hold expires, the points are returned back to the player balance if this hold was not followed by a Redeem transaction.
Headers
Name | Type | Description |
---|---|---|
APIKey | string | Client API key |
Request Body
Name | Type | Description |
---|---|---|
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. |
playerUniqueId | string | Player unique identifier used to uniquely identify the player on Gameball. |
amount | string | Monetary value in the system currency to be held from the player points balance on Gameball. |
hash | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section. Note: hash is automatically handled when using server-side SDKs. |
Response Description
Attribute | Description |
| Player unique identifier used to uniquely identify the player on Gameball. |
| Monetary value in the system currency to be held from the player points balance on Gameball. |
| Hold reference ID to be used in points redemption. |
| Time of transaction in your system in UTC, e.g. order datetime, invoice datetime. Note: transactionTime is automatically handled when using server-side SDKs. |
Usage Example
The example shown is a request sent to Gameball to hold player points with playerUniqueId
"player456" equivalent to amount
of "98.89".
Redeem Points
POST
/integrations/transaction/redeem
The API enables the player to use Gameball points as a payment method since it can be substituted for monetary values. A successful call will return the ID of the redeemed transaction reference created at Gameball.
Headers
Name | Type | Description |
---|---|---|
APIKey | string | Client API key |
Request Body
Name | Type | Description |
---|---|---|
holdReference | string | Hold reference ID received after calling Hold Points API. |
playerUniqueId | string | Player unique identifier used to uniquely identify the player on Gameball. |
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. |
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. |
hash | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section. Note: hash is automatically handled when using server-side SDKs. |
Response Description
Attribute | Description |
| Player unique identifier used to uniquely identify the player on Gameball. |
| Player attributes used to create/update the Player with unique Id in Gameball. Player Object is described in Object Reference section. |
| Transaction ID on Gameball system. |
| 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. |
| Hold reference ID to be used in points redemption. |
| Time of transaction in your system in UTC, e.g. order datetime, invoice datetime. Note: transactionTime is automatically handled when using server-side SDKs. |
Usage Example
The example shown is a request sent to Gameball to redeem an amount
equivalent to the amount held in the holdReference
for player with playerUniqueId
"player456".
Redemption can be sent along with events and reward using Actions Composite API endpoint.
Reverse Transaction
POST
/integrations/transaction/cancel
The API is used to cancel a purchase reward transaction or refund a points redemption transaction on Gameball. Using transactionId
, Gameball will check if there is a purchase reward transaction or a redemption transaction linked to this transactionId
, then complete the process. After successful submission, the canceled or refunded transaction will update the player’s point balance accordingly.
Headers
Name | Type | Description |
---|---|---|
APIKey | string | Client API key |
Request Body
Name | Type | Description |
---|---|---|
amount | number | The amount to be refunded from the transaction. The whole order is cancelled if not provided |
playerUniqueId | string | Player unique identifier used to uniquely identify the player on Gameball |
transactionId | string | Unique transaction ID which identifies the underlying transaction in your system, e.g. order number, invoice number. |
reversedTransactionId | string | Unique transaction ID which identifies the underlying reversed transaction in your system, e.g. canceled order number, refunded invoice number. It will be used for reversing any reward or redemption transaction on Gameball. |
transactionTime | string | Time of transaction in your system in UTC, e.g. canceled order datetime, refunded invoice datetime. Note: transactionTime is automatically handled when using server-side SDKs. |
hash | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section. Note: hashing is automatically handled when using server-side SDKs. |
Response Description
Attribute | Description |
| Player unique identifier used to uniquely identify the player on Gameball. |
| Transaction ID on Gameball system. |
| Unique transaction ID which identifies the underlying reversed transaction in your system, e.g. canceled order number, refunded invoice number. It will be used for reversing any reward or redemption transaction on Gameball. |
| Unique transaction ID which identifies the underlying transaction in your system, e.g. order number, invoice number. |
| Time of transaction in your system in UTC, e.g. canceled order datetime, refunded invoice datetime. Note: transactionTime is automatically handled when using server-side SDKs. |
Usage Example
The example shown is a request sent to Gameball after canceling a transactionId
“234567891” on your system.
Reverse Hold
POST
/integrations/transaction/hold
The API call is used to cancel previously held points. It can be called to cancel non-expired hold requests within the 10 minutes validity period.
Headers
Name | Type | Description |
---|---|---|
API Key | string | Client API key |
Request Body
Name | Type | Description |
---|---|---|
playerUniqueId | string | Player unique identifer used to uniquely identify the player on Gameball. |
holdReference | string | Hold reference number to be cancelled as received from Gameball. |
transactionTime | string | Time of transaction in your system in UTC, e.g. canceled hold datetime. Note: transactionTime is automatically handled when using server-side SDKs. |
hash | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section. Note: hash is automatically handled when using server-side SDKs. |
Response Description
Attribute | Description |
| Player unique identifier used to uniquely identify the player on Gameball. |
| Monetary value equivalent to the number of points that was released from hold in Gameball. |
| Hold reference ID cancelled/refunded. |
| Time of transaction in your system in UTC, e.g. canceled order datetime, refunded invoice datetime. Note: transactionTime is automatically handled when using server-side SDKs. |
Usage Example
The example shown is a request sent to Gameball to remove held points with playerUniqueId
"player456" an holdReference
equals “9245fe4a-d402-451c-b9ed-9c1a04247482“.
Manual Transaction
POST
/integrations/transaction/manual
Access manual points reward API to reward your players for each unit currency they actually paid for your product or service or for an arbitrary amount.
Headers
Name | Type | Description |
---|---|---|
APIKey | string | Client API key |
Request Body
Name | Type | Description |
---|---|---|
points | integer | Number of points to be rewarded to or deducted from the player. a "+" value is accumulation while a "-" value is deduction. |
reason | string | Represents the reason you wish to specify as to why the player is being rewarded. |
username | string | Represents the username of the user in your system that is performing the manual reward for the player. |
playerUniqueId | string | Player unique identifier used to uniquely identify the player on Gameball. |
amount | number | Monetary value that the player will be rewarded for based on the Redemption Rate. (Amount must be positive). |
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. |
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. |
hash | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section. Note: hashing is automatically handled when using server-side SDKs. |
playerAttributes | object | An object containing all of the attributes of the player. Player object is described in Object Reference section. |
Either the amount or the points should be sent along with the request.
In case the player doesn't exist on Gameball before sending the Manual Transaction API call, the player will be created automatically on Gameball and granted the points.
Response Description
Attribute | Description |
| Player unique identifier used to uniquely identify the player on Gameball. |
| An object containing all of the attributes of the player. Player Object is described in Object Reference section. |
| Transaction ID on Gameball system. |
| Monetary value that the player will be rewarded for based on the Redemption Rate. (Amount must be positive) |
| 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. |
| Time of transaction in your system in UTC, e.g. order datetime, invoice datetime. Note:transactionTime is automatically handled when using server-side SDKs. |
| The number of points rewarded to the player for the specified amount |
List Transactions
POST
/integrations/transaction/list
Used to get transactions from Gameball. The result are paged and can be filtered.
Query Parameters
Name | Type | Description |
---|---|---|
page | string | result page number. Starts from 1 |
limit | string | result page size. Default is 50 transactions and max is 200 |
Headers
Name | Type | Description |
---|---|---|
APIKey | string | Client API Key |
Request Body
Name | Type | Description |
---|---|---|
transactionId | string | ID of transaction to be retrieved. If provided, the details of the transaction and its related transactions are returned |
direction | string | "+" or "-" to return deduction or addition transactions |
from | object | from date |
to | object | to date |
hash | string | Hashed body with SH1 algorithm. As described in hashing transaction messages section |
Response Description
Attribute | Description |
transactions | array of paged transactions ordered by date desc. |
count | returned transactions list count |
total | total number of transactions avialable matching the applied filters |
transaction object
Attribute | Description |
transactionId | Transaction ID as recieved from external system |
gameballTrasnactionId | Transaction ID on Gameball system. |
type | Transaction type string. Can be one of the following AchievementReward PaymentReward Refund Redemption Expiry Cancel Migration ManualAccumulation DiscountCode ManualDeduction ManualReward |
direction | string "+" or "-" indicating transaction was an addition or deduction |
playerUniqueId | Player unique identifier used to uniquely identify the player on Gameball. |
points | Number of points involved in the transaction |
amount | Monetary amount involved in the transaction |
transactionTime | Time of transaction in UTC |
merchantName | Merchant name for transaction |
branchName | Branch Name for transaction |
Last updated