Skip to Content
WalletSeamless WalletGet User Balance

get-user-balance

The Sportsbook BE calls this endpoint to check whether the player has enough money to place a bet, and to calculate the maximum possible bet amount. See Integration for the rules shared by all three wallet endpoints.

Request

GET /api/v2/wallet/{playerId}/balances

Request parameters:

NameInTypeRequiredDescription
playerIdPathstringrequiredId of player
currenciesQuerystringoptionalcurrencies that will be returned in response. Optional parameter, by default, all available currencies are returned.
X-BrandHeaderstringrequiredOne of tenant identifiers which represent site and operator. They will be configured during the tenant setup process and can’t be changed. Get this value from your GR8 Tech manager.
X-Operator-IdHeaderstringrequiredOne of tenant identifiers which represent site and operator. They will be configured during the tenant setup process and can’t be changed. Get this value from your GR8 Tech manager.
Signature-InputHeaderstringoptionalOnly sent when request signing is enabled for the brand. Signature parameters and covered components (RFC 9421).
SignatureHeaderstringoptionalOnly sent when request signing is enabled for the brand. Request signature to verify (RFC 9421).

Success response

Caution

Please, pay attention, that values for “locked” and “bonus” should be ALWAYS 0 (ZERO) if you have not integrated with our bonus services

Success response json schema

{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { // platform "sport": { "type": "object", "properties": { // product "main": { "$ref": "#/definitions/productBalancesType" }, "sportsbook": { "$ref": "#/definitions/productBalancesType" } }, "required": ["main", "sportsbook"] } }, "definitions": { "productBalancesType": { "type": "object", "patternProperties": { "^.*$": { // currency "$ref": "#/definitions/balancesType" } } }, "balancesType": { "type": "object", "properties": { "cash": { "type": "string" }, // required "bonus": { "type": "string" }, // required "locked": { "type": "string" }, // required "retract": { "type": "string" } }, "required": ["cash", "bonus", "locked"], "additionalProperties": true } } }
Single-currency response example
{ "sport": { "main": { "USD": { "cash": "500", // <-- it’s a real player’s money "bonus": "0", // <-- should be ALWAYS 0 (ZERO), because it is used only with our sportsbook bonus services "locked": "0" // <-- should be ALWAYS 0 (ZERO), because it is used only with our sportsbook bonus services } }, "sportsbook": { "USD": { "cash": "500", // <-- it’s a real player’s money "bonus": "0", // <-- should be ALWAYS 0 (ZERO), because it is used only with our sportsbook bonus services "locked": "0" // <-- should be ALWAYS 0 (ZERO), because it is used only with our sportsbook bonus services } } } }
Multi-currency Response example
{ "sport": { "main": { "USD": { "cash": "500", "bonus": "0", "locked": "0" }, "EUR": { "cash": "250", "bonus": "0", "locked": "0" }, "GBP": { "cash": "100", "bonus": "0", "locked": "0" } }, "sportsbook": { "USD": { "cash": "500", "bonus": "0", "locked": "0" }, "EUR": { "cash": "250", "bonus": "0", "locked": "0" }, "GBP": { "cash": "100", "bonus": "0", "locked": "0" } } } }
Caution

ATTENTION!
Get balance request will be always executed after EACH transaction request by default. If you want to disable it, please contact the AM/PM of GR8 TECH team

Error response

Error response schema

{ "type": "object", "properties": { "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "origin": { "type": "string" } }, "additionalProperties": true, "required": ["code", "message", "origin"] }, "additionalProperties": true, "required": ["error"] } }
Error response example
{ "error": { "code": "error.user.not-found", "message": "User with specified Id was not found", "origin": "Set your company name" }, "alreadyProcessed": false }
Note

The “Wallet error codes” section describes the list of possible errors.

Load expectations

The Sportsbook uses this endpoint when calculating the max possible bet amount after the player clicks the “Max“ button in the betslip. So NFRs to this endpoint depend on the users’ activity. Our experience shows us that the expected load of this endpoint is near 20 requests per second.

max-bet-amount

In case of an error response - the max bet amount will be calculated only based on the current limitations of the system and previous players’ bets.

OpenAPI schema

The OpenAPI 3 document for this endpoint: request, headers, responses and every schema they use.

Show the document

openapi.json
{ "openapi": "3.0.3", "info": { "title": "Get user balance", "description": "The endpoints the **operator implements** for the GR8 Tech seamless wallet; the Sportsbook backend calls them.\n\n- **Any URL works.** The paths here are only examples — host each endpoint wherever suits your platform and tell GR8 Tech the URLs.\n- **One endpoint per tenant**, or branch on the `X-Brand` and `X-Operator-Id` headers every request carries.\n- **Request signing** (RFC 9421) is optional and disabled by default; when enabled, every request carries `Signature-Input` and `Signature`.", "version": "2.0.0" }, "paths": { "/api/v2/wallet/{playerId}/balances": { "get": { "operationId": "getUserBalance", "tags": [ "Seamless wallet" ], "summary": "Get user balance", "description": "Called to check whether the player has enough money to place a bet and to calculate the maximum bet amount — and, by default, after each transaction. Expected load: around 20 requests per second.", "parameters": [ { "$ref": "#/components/parameters/PlayerId" }, { "$ref": "#/components/parameters/Currencies" }, { "$ref": "#/components/parameters/XBrand" }, { "$ref": "#/components/parameters/XOperatorId" }, { "$ref": "#/components/parameters/SignatureInput" }, { "$ref": "#/components/parameters/Signature" } ], "responses": { "200": { "description": "The player’s balances. `locked` and `bonus` must ALWAYS be \"0\" unless you integrate the GR8 Tech bonus services.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserBalanceResponse" }, "examples": { "single": { "summary": "Single currency", "value": { "sport": { "main": { "USD": { "cash": "500", "bonus": "0", "locked": "0" } }, "sportsbook": { "USD": { "cash": "500", "bonus": "0", "locked": "0" } } } } }, "multi": { "summary": "Several currencies", "value": { "sport": { "main": { "USD": { "cash": "500", "bonus": "0", "locked": "0" }, "EUR": { "cash": "250", "bonus": "0", "locked": "0" }, "GBP": { "cash": "100", "bonus": "0", "locked": "0" } }, "sportsbook": { "USD": { "cash": "500", "bonus": "0", "locked": "0" }, "EUR": { "cash": "250", "bonus": "0", "locked": "0" }, "GBP": { "cash": "100", "bonus": "0", "locked": "0" } } } } } } } } }, "400": { "description": "Any error. See the `ErrorCode` schema for the codes.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "error.user.not-found": { "summary": "error.user.not-found", "value": { "error": { "code": "error.user.not-found", "message": "User with specified Id was not found", "origin": "Set your company name" }, "alreadyProcessed": false } } } } } } } } } }, "components": { "parameters": { "PlayerId": { "name": "playerId", "in": "path", "required": true, "description": "Id of player.", "schema": { "type": "string" } }, "Currencies": { "name": "currencies", "in": "query", "required": false, "description": "Currencies to return. By default, all available currencies are returned.", "schema": { "type": "string" } }, "XBrand": { "name": "X-Brand", "in": "header", "required": true, "description": "One of tenant identifiers which represent site and operator. They will be configured during the tenant setup process and can’t be changed. Get this value from your GR8 Tech manager.", "schema": { "type": "string" } }, "XOperatorId": { "name": "X-Operator-Id", "in": "header", "required": true, "description": "One of tenant identifiers which represent site and operator. They will be configured during the tenant setup process and can’t be changed. Get this value from your GR8 Tech manager.", "schema": { "type": "string" } }, "SignatureInput": { "name": "Signature-Input", "in": "header", "required": false, "description": "Only sent when request signing is enabled for the brand. Signature parameters and covered components (RFC 9421).", "schema": { "type": "string" }, "example": "sig=(\"@method\" \"@target-uri\" \"content-digest\");created=1738110865;keyid=\"key-1\";nonce=\"nonce\";alg=\"ed25519\"" }, "Signature": { "name": "Signature", "in": "header", "required": false, "description": "Only sent when request signing is enabled for the brand. Request signature to verify (RFC 9421).", "schema": { "type": "string" } } }, "schemas": { "UserBalanceResponse": { "type": "object", "required": [ "sport" ], "properties": { "sport": { "type": "object", "required": [ "main", "sportsbook" ], "properties": { "main": { "$ref": "#/components/schemas/CurrencyBalances" }, "sportsbook": { "$ref": "#/components/schemas/CurrencyBalances" } } } } }, "ErrorResponse": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "object", "required": [ "code", "message", "origin" ], "additionalProperties": true, "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "message": { "type": "string", "description": "Human-readable message for logs and operations — never shown to the player." }, "origin": { "type": "string", "description": "Your company or system name." }, "details": { "type": "object", "additionalProperties": true, "description": "Optional structured payload.", "properties": { "localizedMessage": { "type": "string", "description": "With `decline.client.custom`: the text shown to the player as-is, in `context.language`." } } } } }, "alreadyProcessed": { "type": "boolean", "description": "true when this error was already returned for this transaction id." }, "balances": { "allOf": [ { "$ref": "#/components/schemas/Balances" } ], "description": "Optional current balances. On `decline.lowbalance` the Sportsbook uses them and skips the follow-up get-user-balance call." } } }, "CurrencyBalances": { "type": "object", "description": "Balances keyed by ISO 4217 currency code.", "additionalProperties": { "$ref": "#/components/schemas/BalanceDetails" } }, "ErrorCode": { "type": "string", "enum": [ "error.general", "error.request.invalid", "error.user.not-found", "error.retry.incorrect", "limit.exceeded", "decline.limit.conflict", "decline.parent.notfound", "decline.parent.failed", "decline.balance.conflict", "decline.currency.mismatch", "decline.player.blocked", "decline.lowbalance", "decline.restrictions", "decline.client.custom" ], "description": "- `error.general` — Unknown issue / internal server error.\n- `error.request.invalid` — The request parameters are invalid.\n- `error.user.not-found` — The player was not found.\n- `error.retry.incorrect` — A retried transaction differs from the original one with the same `id`.\n- `limit.exceeded` — Internal limits exceeded.\n- `decline.limit.conflict` — Regulator or tax limits exceeded.\n- `decline.parent.notfound` — Rollback only: the parent transaction (`context.parentId`) was not found.\n- `decline.parent.failed` — Rollback only: the parent transaction was found but had failed.\n- `decline.balance.conflict` — Unexpected error with balances.\n- `decline.currency.mismatch` — The transaction currency does not match the player's account currency.\n- `decline.player.blocked` — The player is blocked. Expected to be temporary for settle / resettle / cancelsettle.\n- `decline.lowbalance` — Insufficient funds. May carry `balances`, which saves the follow-up get-user-balance call.\n- `decline.restrictions` — Regulator restriction.\n- `decline.client.custom` — Operator-specific decline of a bet placement; put the player-facing text in `error.details.localizedMessage`." }, "Balances": { "type": "object", "description": "Balances keyed by platform (`sport`), then product, then currency. The currency must equal the request’s `currency`.", "additionalProperties": { "$ref": "#/components/schemas/ProductBalances" } }, "BalanceDetails": { "type": "object", "required": [ "cash", "bonus", "locked" ], "additionalProperties": true, "properties": { "cash": { "allOf": [ { "$ref": "#/components/schemas/Amount" } ], "description": "The player's real money." }, "bonus": { "allOf": [ { "$ref": "#/components/schemas/Amount" } ], "description": "Bonus funds. Always \"0\" unless you integrate the GR8 Tech bonus services." }, "locked": { "allOf": [ { "$ref": "#/components/schemas/Amount" } ], "description": "Locked funds (wagering). Always \"0\" unless you integrate the GR8 Tech bonus services." }, "retract": { "allOf": [ { "$ref": "#/components/schemas/Amount" } ], "description": "Retracted bonus funds." } } }, "ProductBalances": { "type": "object", "description": "Balances keyed by product — `main` and `sportsbook`.", "additionalProperties": { "$ref": "#/components/schemas/CurrencyBalances" } }, "Amount": { "type": "string", "description": "A decimal amount as a string, e.g. \"100.50\" — at most 18 digits after the decimal point. Balances can be negative.", "pattern": "^-?[0-9]+(\\.[0-9]{1,18})?$", "example": "100.50" } } } }