Skip to content
Last updated

Balance

The Balance request is used for receiving the information about the player's balance.

All currency communication between the Operator and RubyPlay is done in units of that particular currency. For example, if a user has a USD balance 500.45 in his wallet, then the balance field in the response body must be:

{
	...
	"balance": 500.45
	...
}

API Call Sample:

curl -i -X POST \
  http://integrator-gaming-platform.io/rest/v1/api/balance \
  -H 'Content-Type: application/json' \
  -d '{
    "sessionToken": "0Ja8M7KvY",
    "playerId": "24681",
    "promotionId": "123456",
    "externalCampaignId": "123456",
    "currencyCode": "EUR",
    "gameId": "rp_12",
    "country": "US"
  }'
Response
application/json
{ "code": "0", "description": "Success", "balance": 500.45 }

Request Schema:

sessionTokenstringrequired

Login session token, provided by the Operator side. Used in all requests initiated by RubyPlay (the RGS) when invoking the Operator GP service.

Example: "0Ja8M7KvY"
playerIdstringrequired

Unique player ID on the Operator side.

Example: "24681"
promotionIdstring

The ID of the campaign if a free round is reported. The wallet is expected to return the promotion balance for the specified promotionId along with its status, even if the campaign is no longer available (completed or expired).

Example: "123456"
externalCampaignIdstring

External ID of the campaign if a free round is reported and the external ID was set during the campaign creation.

Example: "123456"
currencyCodestringrequired

Currency used by the current player.

Example: "EUR"
gameIdstringrequired

Unique game ID on the Operator side.

Example: "rp_12"
countrystring

ISO 3166-1 alpha 2 country code. It corresponds to a country the played launched the game from, defined by client IP of the game init request.

Example: "US"

Response Schema:

codestring

Response code.

Example: "0"
descriptionstring

Short description of the response code.

Example: "Success"
balancenumberrequired

The player's balance in the currency which was sent in the currencyCode field of the Balance request.

Example: 500.45