We keep each player’s token balance.
A record of each player’s tokens. You credit and debit players with one API call each; bets and settlements move the balance for you.
- Credit, debit and read any balance through the API.
- Idempotency keys make every retry safe: an operation applies at most once.
- Load a balance before the player’s first session.
- The quickest integration: if your server can call an API, you’re set.
API=https://api.thesportsbook.app/b2b/v1curl -X POST "$API/users/viewer-42/credit" \ -H "Authorization: Bearer $SPORTSBOOK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amount": 50, "idempotency_key": "refill-8f1c2"}'# {"balance": 150, "operation_id": "5b0c…",# "replayed": false}Best when your tokens only need to exist inside the sportsbook.