Appearance
Mini-games
Use the loyalty service’s mini-game player, session, score, and points operations. Most operations require a customer token.
Access labels such as Origin + Brand key + Customer are defined in Headers and access. Each endpoint ends in a Try it console; set the host and keys once in its Settings tab or on the overview.
Get the current mini-game player (v2)
| Method | URL path | Required access |
|---|---|---|
GET | /api/v2/brand/mini-game/user | Origin + Brand key + Customer |
Request fields: no body, query, or path fields are read by this controller. Context comes from the headers/middleware above.
Example:
bash
curl -X GET "$BASE_URL/api/v2/brand/mini-game/user" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: Upstream/service JSON is returned directly, without an extra envelope. The response schema belongs to the separate loyalty service; local service failures return {"success":false,"error":"..."}.
Source: app/v2/controller/miniGames_controller.ts:17 → getMiniGameUser; routes: routes/v2/miniGames_routes.ts:59; service: _getMiniGameUser (app/v2/service/miniGames_services.ts:54).
List mini-game player records (v2)
| Method | URL path | Required access |
|---|---|---|
GET | /api/v2/brand/mini-game/user/all | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
query | object | optional | — |
query.limit | number | optional | — |
query.offset | number | optional | — |
Example:
bash
curl -X GET "$BASE_URL/api/v2/brand/mini-game/user/all?limit=10&offset=0" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: Upstream/service JSON is returned directly, without an extra envelope. The response schema belongs to the separate loyalty service; local service failures return {"success":false,"error":"..."}.
Source: app/v2/controller/miniGames_controller.ts:33 → getAllMiniGameUser; routes: routes/v2/miniGames_routes.ts:66; service: _getAllMiniGameUser (app/v2/service/miniGames_services.ts:78).
Get mini game leaderboard (v2)
| Method | URL path | Required access |
|---|---|---|
GET | /api/v2/brand/mini-game/leaderboard | Origin + Brand key + Customer |
Request fields: no body, query, or path fields are read by this controller. Context comes from the headers/middleware above.
Example:
bash
curl -X GET "$BASE_URL/api/v2/brand/mini-game/leaderboard" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: Upstream/service JSON is returned directly, without an extra envelope. The response schema belongs to the separate loyalty service; local service failures return {"success":false,"error":"..."}.
Source: app/v2/controller/miniGames_controller.ts:61 → getMiniGameLeaderboard; routes: routes/v2/miniGames_routes.ts:73; service: _getMiniGameLeaderboard (app/v2/service/miniGames_services.ts:108).
Start a mini-game session (v2)
| Method | URL path | Required access |
|---|---|---|
POST | /api/v2/brand/mini-game/session | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.mini_game_id | number | yes | — |
Example:
bash
curl -X POST "$BASE_URL/api/v2/brand/mini-game/session" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"mini_game_id":1}}'Response: Upstream/service JSON is returned directly, without an extra envelope. The response schema belongs to the separate loyalty service; local service failures return {"success":false,"error":"..."}.
Source: app/v2/controller/miniGames_controller.ts:77 → postMiniGameSession; routes: routes/v2/miniGames_routes.ts:80; service: _postMiniGameSession (app/v2/service/miniGames_services.ts:135).
Submit a mini-game score (v2)
| Method | URL path | Required access |
|---|---|---|
POST | /api/v2/brand/mini-game/score | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.session_id | string | yes | — |
body.payload.score | number | yes | Minimum (0) |
Example:
bash
curl -X POST "$BASE_URL/api/v2/brand/mini-game/score" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"session_id":"<SESSION_ID>","score":100}}'Response: Upstream/service JSON is returned directly, without an extra envelope. The response schema belongs to the separate loyalty service; local service failures return {"success":false,"error":"..."}.
Source: app/v2/controller/miniGames_controller.ts:104 → postMiniGameScore; routes: routes/v2/miniGames_routes.ts:87; service: _postMiniGameScore (app/v2/service/miniGames_services.ts:164).
Convert a session score to loyalty points (v2)
| Method | URL path | Required access |
|---|---|---|
POST | /api/v2/brand/mini-game/score-conversion | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.session_id | string | yes | — |
Example:
bash
curl -X POST "$BASE_URL/api/v2/brand/mini-game/score-conversion" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"session_id":"<SESSION_ID>"}}'Response: Upstream/service JSON is returned directly, without an extra envelope. The response schema belongs to the separate loyalty service; local service failures return {"success":false,"error":"..."}.
Source: app/v2/controller/miniGames_controller.ts:132 → postMiniGameScoreConversion; routes: routes/v2/miniGames_routes.ts:94; service: _postMiniGameScoreConversion (app/v2/service/miniGames_services.ts:196).
Spend points on mini-game lives (v2)
| Method | URL path | Required access |
|---|---|---|
POST | /api/v2/brand/mini-game/consume-points | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.item | string | yes | Allowed values ("lives") |
body.payload.mini_game_id | number | optional | Integer; Positive |
Example:
bash
curl -X POST "$BASE_URL/api/v2/brand/mini-game/consume-points" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"item":"lives"}}'Response: Upstream/service JSON is returned directly, without an extra envelope. The response schema belongs to the separate loyalty service; local service failures return {"success":false,"error":"..."}.
Source: app/v2/controller/miniGames_controller.ts:162 → postMiniGameConsumePoints; routes: routes/v2/miniGames_routes.ts:101; service: _postMiniGameConsumePoints (app/v2/service/miniGames_services.ts:227).
Lifecycle
These endpoints forward to the separate loyalty service, which owns the session and its rules; this API validates the request shape and nothing more. The order the calls must come in, from the fields each one requires:
Buying lives with points — Spend points on mini-game lives — sits outside the session. What the loyalty service does with a second score or a second conversion for the same session is not visible from this backend.