Comment on page


Components diagram

To integrate Trueplay, the operator should provide access to game data using the “Send Game Transaction” endpoint.
After receiving game data, Trueplay creates a user account in its database and assigns it a Trueplay ID.
Additionally, once a user visits the Trueplay loyalty program page, they are immediately added to the Trueplay database.
The Operator needs to integrate the “Get Loyalty Page” endpoint to receive a link to the loyalty program.
To enable users to make deposits and withdrawals at the casino, the operator should implement the following endpoints:
  • Get User Balance — to inform Trueplay about the user’s current casino balance.
  • Token Exchange — for Trueplay to update the user’s casino balance when they make a withdrawal.
When a user purchases tokens, Trueplay sends a notification about payment in the player’s account currency. This is similar to making a deposit.
Users should also be able to receive tokens for promotional activities in the casino. For this purpose, the integration includes several endpoints that also need to be implemented:
1. Tokens for Registration: The user will receive tokens when placing their first bet or visiting the loyalty page. If it is necessary to credit tokens before the user performs these actions, there is an optional “Create User” endpoint. This endpoint adds a user to the Trueplay database. The user gets registration tokens right after Trueplay receives this request.
2. KYC Tokens: The operator should notify Trueplay that the user has passed KYC. The operator should set up the “Update User Account” endpoint so that they can change the status of passing the KYC check from false to true.
3. Deposit Tokens: In the Marketing Campaign section of the admin panel, the operator should create a promo campaign and add users who made a deposit to the casino using the Deposit API method: (link).
Important Aspects for Cashback Calculation. If your casino offers sports betting, you need to make the following updates:
  • For WIN transactions on the “Sportsbook” game type, you must send transactions with losses as WIN = 0.
  • For other transactions with the WIN type relating to the “Sportsbook” game type, in the reference ID parameter send the identifier of the BET to which this reward relates.
  • IMPORTANT! WIN = 0 transactions require a unique transaction identifier.

Trueplay endpoints

Get Loyalty page
The method to get link on loyalty page to open in iframe into Casino.
ID of user on Operator side
Localization of user loyalty page Default language of loyalty page: ENG
Available languages: CS, DE, ES, FR, HU, ID, JA, LT, LV, PL, PT, BN, RU, SK, TR, BN
Operator key issued by TruePlay to access TruePlay API
200: OK
Request is succesful
400: Bad Request
Invalid request parameters provided
401: Unauthorized
Requester is unauthorized to perform an action
403: Forbidden
Requester is forbidden to perform an action
404: Not Found
Resource not found
Get user balance
Send game transaction

Operator endpoints

Get User Balance
Token Exchange

Request signature

Requests from TruePlay include X-REQUEST-SIGNATURE header.
Example of how to generate a signature for SecretKey = secret
node Welcome to Node.js v16.13.0. Type ".help" for more information. var crypto = require('crypto'); undefined var hasher = crypto.createHash('md5'); undefined var hashed = hasher.update('{"id":"103193","action":"CREDIT","amount":4.123,"currency":"USD","exchangeRate":0.00203250655485,"tokenAmount":2500,"operatorId":123,"operatorUserId":"333"}') undefined var hash = hashed.digest('hex'); undefined var hmac = crypto.createHmac('sha512', 'secret'); undefined hmac.update(hash); Hmac { _options: undefined, [Symbol(kHandle)]: Hmac {}, [Symbol(kState)]: { [Symbol(kFinalized)]: false } } var sign = hmac.digest('base64'); undefined console.log('signature: ' + sign); signature: IifPVbfXptagZ6qSXH9vYrQiqSP4sKIC+hV+39z2K+FlLzRoEboPGTTymjmeuAhN1i0ICDyyrrufYspgAJmxHQ==

Marketing Campaigns

Create user account
Update user account
Send user deposit
The operator can also define a user segment to add to the campaign using API. The Marketing Campaigns API supports the following methods
Get all Active marketing campaigns
Get marketing campaign participants by campaign ID
Assign user to the marketing campaign
Delete user from marketing campaign