JRGS Casino API

Overview

The two halves of a JRGS integration: the launch API you call, and the seamless wallet you implement.

JRGS is a remote game server (RGS). It runs the games, decides every outcome and keeps the round journal. The money stays with you: the RGS never holds a player balance, and every stake and win moves through your wallet.

An integration has two halves, and they go in opposite directions.

Who calls whomSigned withPages
Launch APIyour platform calls the RGS, to list games and start sessionsyour Ed25519 private keyLaunching a game
Walletthe RGS calls your wallet, to read balances and move moneya shared HMAC-SHA256 secret, both waysWallet

Both are described on Authentication and signing. Each also has a machine-readable OpenAPI document; see the Reference section in the sidebar.

A round at a glance

  1. Launch. Your platform calls POST /sessions for a player and a game. The RGS answers with a launchUrl; you send the player's browser to it. The game client opens the session with the single-use token in that URL.
  2. Debit. When the player places a bet, the RGS calls your POST /debit with the stake. A debit your wallet refuses is a bet that is not played.
  3. Outcome. The RGS decides the outcome from the game's certified math and records it in its journal.
  4. Credit. The RGS calls your POST /credit with the win, even when the win is 0, which settles the round.
  5. Rollback. If a debit's outcome is unknown, the RGS does not guess: it calls POST /rollback for that debit, and you return the stake if you took it. Unknown means a timeout or network failure, any non-2xx status other than 401 or 403, an answer the RGS cannot read or whose signature does not hold, DUPLICATE, or an error code that is not on the list.

Credits and rollbacks settle money that is already decided, so the RGS keeps repeating them, with the same transactionId, until it gets a final answer. Your wallet must therefore be idempotent by transactionId. The details are on Retries, idempotency and reconciliation, and what each answer means for the money on Errors and money states.

Amounts

Every amount, in both APIs, is an integer number of micro-units of the currency: 1000000 is 1.00, 200000 is 0.20. There are no decimals and no floating point anywhere in the protocol. A currency is its ISO 4217 code, such as GBP.

Where to go next

On this page