Transactions
Transactions API is responsible for all the player's wallet 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 external ID used by integrator to uniquely identify the player in Gameball |
bodyHashed | string | eHashed body with SHA1 algorithm. As described in Hashing Transaction Messages section |
Example
Send Gameball the following to get a player's balance with his playerUniqueId
Hold Points
POST
/integrations/transaction/hold
The API call is used to hold a specific amount of points from the player’s points balance. This is used to guarantee availability of redemption points 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. A hold will be active in Gameball for 10 minutes and expires if Gameball did not receive a follow Redeem transaction
Headers
Name | Type | Description |
---|---|---|
APIKey | string | client API key |
Request Body
Name | Type | Description |
---|---|---|
playerUniqueId | string | Player external ID used by integrator to uniquely identify the player in Gameball |
amount | string | Monetary value that equivalent number of points to be set to hold in Gameball. |
transactionTime | string | UTC transaction datetime |
bodyHashed | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section |
otp | string | One time password as received by user in case of redemption transaction (required if OTP is enabled) |
Examples
Hold player points with playerUniqueId
equivalent to amount
of "98.89" in case OTP
is disabled
Hold player points with external id playerUniqueId
equivalent to amount
of "99.99" in case OTP
is enable
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 from received after calling Hold Points API |
playerUniqueId | string | Player external ID used by integrator to uniquely identify the player in Gameball |
amount | number | Monetary value that equivalent number of points to be set to hold in Gameball. |
transactionOnClientSystemId | string | Correlation Id provided by integrator system used to map transaction on Gameball to a transaction at integrator system |
transactionTime | string | UTC transaction datetime |
bodyHashed | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section |
Examples
Sends Gameball to redeem an amount
equivalent to "10" for player playerUniqueId
.
Sends Gameball to redeem an amount
equivalent to "99.25" for player with external id playerUniqueId
.
Reverse Transaction
POST
/integrations/transaction/cancel
The API is used to cancel a purchase reward transaction or refund a points redemption transaction in Gameball. After successful submission the cancelled 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 |
---|---|---|
playerUniqueId | string | Player external ID used by integrator to uniquely identify the player in Gameball |
transactionOnClientSystemId | string | Correlation Id provided by integrator system used to map transaction on Gameball to a transaction at integrator system |
reversedTransactionOnClientSystemId | string | Integrator system transaction ID of the transaction to be cancelled\refunded |
transactionTime | string | UTC transaction datetime |
bodyHashed | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section |
Examples
Sends Gameball to cancelled a transaction
with id equals “234567891”
Reverse Hold
POST
/integrations/transaction/hold
The API call is used to cancel previously held points . It can be called against non-expired previous hold requests within the 5 minutes life cycle or against any unused held unredeemed points.
Headers
Name | Type | Description |
---|---|---|
API Key | string | client API key |
Request Body
Name | Type | Description |
---|---|---|
playerUniqueId | string | Player external ID used by integrator to uniquely identify the player in Gameball |
holdReference | string | Hold reference number to be cancelled as received from Gameball |
transactionTime | string | UTC transaction datetime |
bodyHashed | string | Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section |
Example
Remove hold player points with external id playerUniqueId
with holdReference
equals “9245fe4a-d402-451c-b9ed-9c1a04247482“
Hashing Transaction Messages
All transactions endpoints requires a digital signature BodyHashed to be sent with the body payload. This digital signature is used to verify and guarantee the authenticity of the request.
BodyHashed is SH1 hashing of body payload parameters and secure TransactionKey encoded with base64 encoding. When Gameball receives a transactions request, it computes the BodyHashed value and compares it against the one sent with the request. If the two hashes match then the request processed otherwise its blocked.
BodyHashed is computed according to the below algorithm. Variables found in this algorithm must be equal to their equivalent values in the request payload.
Variable | Value |
|
|
| This is extracted from request payload parameter transaction time without any separator. Time must be 24 format. For example: 200430163519 |
|
|
| Client salt key, provided by Gameball |
For request that have no Amount
or transaction time parameters. They are substituted in the algorithm by empty string. Below is an example showing the hashing of a request with no Amount
.
Note: In case Amount
value is 0, it is sent with a value of 0, not as an empty string.
Last updated