> For the complete documentation index, see [llms.txt](https://docs.hub88.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hub88.io/developer-docs/hub88-apis/core-api-flow.md).

# Core API flow

## Core communication flow between Supplier and Operator APIs&#x20;

The entire data exchange flow goes through Hub88, because of this it's essential that an integration to either Operator API or Supplier API is built dependent on the use-case.&#x20;

The data flow starts from **player** side, who chooses a **game** on online casino site (brand). This triggers calls from Operator side through Operator API to Hub88, which calls Suppliers through Supplier API, to get the necessary game contents (game\_url).

Once the gameplay has started, **Supplier** **needs** to call **Hub88** and **update** user **balance** based on the results and in-game activities. Hub88 then makes this data available for the Operator, which they are **expected** to **display** to the **user**.  &#x20;

{% hint style="info" %}
If you are building the integration with Hub88 as an **Operator**, you can make the first requests in **DEMO** mode.&#x20;

For **DEMO** mode, when calling the [`POST /operator/generic/v2/game/url`](https://docs.hub88.io/developer-docs/operator-api-reference/games-api.md#get-a-game-url)  endpoint, the Operator has to pass `"currency":"XXX"`. Parameters `token`, `user` can be omitted. See more in [Demo Gameplay](https://docs.hub88.io/developer-docs/operator-api-reference/operator-api-overview/demo-and-real-gameplay.md).
{% endhint %}

<div data-full-width="true"><figure><img src="https://1089485291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8iFPgdqAwxIxP5oQMvU%2Fuploads%2FtleE2R5sxIx8j35MnUYg%2F%5BHub88%5D%20Documentation%20working%20board%20(10).jpg?alt=media&amp;token=ba07288e-46f0-4a33-a660-55fc402618e0" alt=""><figcaption><p>Core API flow</p></figcaption></figure></div>

{% hint style="info" %}
&#x20;**Session timing for Supplier Integration**

The player session is created only after [`/game/url`](https://docs.hub88.io/developer-docs/supplier-api-reference/games-api.md#get-a-game-url) returns a successful response. The session token passed in the [`/game/url`](https://docs.hub88.io/developer-docs/supplier-api-reference/games-api.md#post-game-url) request is **not active** until Hub88 receives a valid game URL back from the Supplier.

This means:

* **Suppliers must not make any Wallet API calls** (`/user/balance`, `/transaction/bet`, `/transaction/win`, `/transaction/rollback`) **before returning a successful** [**`/game/url`**](https://docs.hub88.io/developer-docs/supplier-api-reference/games-api.md#post-game-url) **response to Hub88.** Doing so will result in `RS_ERROR_INVALID_TOKEN`.
* Wallet API calls should only be made **after** the game URL has been returned and loaded in the player's browser.

See the [Supplier API Overview — Real gameplay](https://docs.hub88.io/developer-docs/supplier-api-reference/supplier-api-overview#real-gameplay) section for the expected step-by-step flow.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hub88.io/developer-docs/hub88-apis/core-api-flow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
