What a casino API is
An API is a defined way for one system to ask another for information or for an action. A casino API applies that idea to running an online casino: your platform asks for games and opens them, and the content side asks your platform about balances and bets. The contract names the requests, the fields, the answers and the errors, so that two teams can build against it without talking to each other every day.
The WGC API is a server-to-server interface. Your server calls it with a key in the X-API-Key header, and every answer arrives in the same envelope: an ok flag, a request id and either data or an error. Your code should branch only on the error code, because the message is written for people. Browsers do not call the API, and cross-origin calls are not supported, so the key stays on your server.
The four jobs of a casino API
1. The catalog. Your platform asks for the games issued to its account, 200 per page. Each game has a stable publicId that identifies it in your catalog and a universalId that is the same for the same game across the catalog. It also has a name, a type, image addresses and flags for demo, free spins and similar capabilities. After the first full download you send the time of your last sync and receive only the changes, with a flag for games to take down.
2. Opening a game. When a player picks a game in your lobby, your server asks the API to open it. The request carries the player id, the currency, the mode (real or demo) and one game number. The answer is a launch link that the player's browser opens, in a frame if you prefer. The unopened link works for five minutes, and an opened link works while the player is active.
3. The wallet. During play, the game needs a balance and has to record bets and wins. In a seamless wallet model, the player's money stays on your platform, so the API calls you: WGC sends signed requests to your Callback URL with three commands, one to read the balance, one to record a bet together with its win, and one to cancel a bet. This is the subject of the seamless wallet page.
4. Status lookups. Afterwards, your platform can ask what became of an operation, a round or a session, using its own numbers. An operation has a status such as accepted, refused, failed or unknown, and a round reports the bet, the win and the difference.
Two directions of calls
It helps to picture the calls going both ways. In the first direction your server calls WGC: it reads the catalog, opens games and looks up statuses. In the second direction WGC calls your platform: it reads balances and records bets, wins and cancellations. Both directions are part of the same contract, and an integration is finished only when both work.
The second direction carries the stricter rules, because it moves money. Each call is signed with HMAC-SHA256 and your account secret, and your handler should verify the signature on the raw body before parsing it. WGC waits three seconds for your answer. A bet is recorded once per transaction id, so a repeated call neither debits the player twice nor changes the balance returned.
How one round travels
Here is the path of a single game, step by step.
- Your platform has synchronized the catalog and shows the games in its lobby.
- The player chooses a game, and your server asks to open it.
- WGC returns a launch link, and the player's browser opens it.
- The game asks for the balance. WGC calls your Callback URL, you answer, and the game starts.
- For each bet, WGC calls you again with the bet and, usually in the same call, its win.
- If your answer does not arrive in time, the bet is refused to the studio, the operation becomes unknown and WGC later asks you to cancel it with a rollback.
- After the round, your platform can look up the operation, the round or the session by its own numbers.
What makes a casino API easy to check
A technical team should be able to judge an API before committing to it. With WGC, the description of the API is public: an OpenAPI file and a documentation page, both open without a key. If they differ, the file is right. The API does not break without notice: new fields may appear, so you ignore the ones you do not know, and a field is removed only after a deprecation notice and not earlier than 90 days later.
Limits are written down as well. By default a key can open 600 games a minute, and catalog and status requests allow 120 a minute. Your manager can raise the limits of an account on request.
Testing does not need real money. A test key opens a test game, WGC Test Slot, that makes real calls to your Callback URL. In the back office, an integration check shows a live log of every call, and an integration test runs 14 checks of your wallet. Examples of handlers, a check script and a go-live checklist are public. You can read more on the integration page and in demo and test mode.
What a casino API is not
A casino API is not a casino for players. WGC does not run a casino, does not hold player balances and does not register players: your platform keeps its own players and their money. Access to the client area is issued personally by a manager, and there is no self-service sign-up. A casino API is also not a promise about a game's result: a chosen RTP is a setting handed to the studio, and not every game accepts it.
For the full list of requests and how they fit together, see the Casino API overview.