The Debit request is used for providing information about the bet operation from the player.
If the Debit request fails due to a non-business problem, such as a connection timeout, unavailable resource, network problems, etc., RubyPlay will immediately send the corresponding Cancel request to undo possible funds withdrawal from the player's balance. RubyPlay doesn't retry Debit requests.
In case of non-determined (unpredicted) HTTP server errors with HTTP Status Code 5xx (500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511) from the wallet's side, RubyPlay will also immediately send the corresponding Cancel request to cancel the initial Debit request. RubyPlay doesn't retry the Debit requests in this situation as well.
It is also possible to explicitly trigger the Cancel request for canceling the Debit request apart from responding with HTTP Status Code 5xx. For this purpose, the response to the Debit request must contain HTTP Status Code 200 "OK" and the HTTP body must contain a "code" property equal to "501" (Retry / cancel triggered).
If the Debit request receives the response with the HTTP Status Code 200 "OK" and the response code (described in the Response Codes) is considered failed (100, 101, 102, 103, 104, 105, 106, 107), RubyPlay will not send the Cancel request (because the Operator has already responded with the description of the problem). RubyPlay doesn't retry the Debit requests in this situation as well.
API Call Sample:
- Generated server url.http://integrator-gaming-platform.io/rest/v1/api/debit
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
http://integrator-gaming-platform.io/rest/v1/api/debit \
-H 'Content-Type: application/json' \
-d '{
"sessionToken": "0Ja8M7KvY",
"playerId": "24681",
"promotionId": "123456",
"externalCampaignId": "123456",
"currencyCode": "EUR",
"gameId": "rp_12",
"country": "US",
"amount": 2,
"roundId": "444277",
"transactionId": "1000",
"deviceType": "desktop",
"gameRoundEnd": false,
"freeRound": true,
"purchasedFeature": "freespins",
"reelsPosition": [
{
"property1": {},
"property2": {}
}
],
"autoPlayNotification": true
}'{ "code": "0", "description": "Success", "balance": 500.45 }
Request Schema:
Login session token, provided by the Operator side. Used in all requests initiated by RubyPlay (the RGS) when invoking the Operator GP service.
Unique player ID on the Operator side.
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).
External ID of the campaign if a free round is reported and the external ID was set during the campaign creation.
Currency used by the current player.
Unique game ID on the Operator side.
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.
The amount used in the transaction.
Game round ID. One game round can contain several transactions. When the last transaction is sent, the game round is being closed and no transactions can be processed within the same game round anymore.
Unique transaction ID. Can be used in the retries to send a transaction (for example, in case of failure). Transaction ID has to be idempotent during handling. It means if transaction is retried with the same transaction ID, the status of the original transaction is returned instead of creating a new one.
Device type. Possible game modes: desktop for playing game using PC, mobile for playing game using mobile phone.
Flag of the end of the game round (true if the game round is over, and false otherwise). When the last transaction is sent, the game round is being closed and no transactions can be processed within the same game round anymore.
Indicates whether the round is free or paid.
Type of in-game feature purchased in the round.
Reels position report used for regulatory purposes. Can be configured separately.
Indicates whether autoplay mode is enabled.
Response Schema:
Response code.
Short description of the response code.
The player's balance in the currency which was sent in the currencyCode field of the Balance request.