Skip to content

Fizz Terminal API

This API is for kiosks and cashier terminals. It covers player creation, login, balances, deposits and withdrawals, promo codes and Fizz Crew invite codes.

Base URL

All endpoints live under /api on the Fizz backend:

https://<fizz-api-host>/api

Request format

Every POST endpoint accepts either JSON or form data:

curl -X POST https://<fizz-api-host>/api/deposite \
  -H "Content-Type: application/json" \
  -d '{"player_id": 12345, "terminal_ID": "70790473203088", "amount": 20}'
curl -X POST https://<fizz-api-host>/api/deposite \
  -d player_id=12345 \
  -d terminal_ID=70790473203088 \
  -d amount=20

In JSON, numbers can be sent either as numbers or as strings.

Responses

Always check status

Business errors come back as HTTP 200 with "status": "failure". Do not rely on the HTTP code alone.

{ "status": "success", "data": { "...": "..." } }
{ "status": "failure", "error": "insufficient_funds" }
{ "code": "validation_error", "message": "player_id, terminal_ID and amount required" }

Terminal and shop

The terminal is identified by terminal_ID. Each terminal belongs to a shop, and so does each player. Cashier operations work only when the player belongs to the same shop as the terminal. Otherwise the response is Player not register from this terminal.

Amounts are in the shop currency (Entries). Money for deposits comes from the shop balance, and money from withdrawals goes back to it.

Authentication

Most terminal endpoints need no token: the terminal is identified by terminal_ID. Only /api/logout needs the player's JWT from /api/login:

Authorization: Bearer <token>

Typical flow

sequenceDiagram
    participant K as Kiosk
    participant B as Fizz backend
    opt Player has an invite code
        K->>B: POST /api/referrals/check
        B-->>K: normalized code
    end
    opt Player has a promo code
        K->>B: POST /api/promo/check
        B-->>K: promo terms
    end
    K->>B: POST /api/signup (deposit_amount, promo_code, invite_code)
    B-->>K: player id + PIN
    K->>B: POST /api/deposite (later deposits)
    K->>B: POST /api/withdraw (cash out)

Endpoints

Method Path Page
POST /api/signup Players
POST /api/login Players
POST /api/logout Players
GET /api/getbalance Balances
GET /api/terminal_balance Balances
POST /api/deposite Cashier operations
POST /api/withdraw Cashier operations
POST /api/refund Cashier operations
POST /api/promo/check Promo codes
POST /api/referrals/check Invite codes