Wallet API

Wallet API Reference - Operator API

Wallet API is an API to integrate Seamless wallet logic to Bingão. The API works in a manner where Bingão is the consumer and the Operator needs to provide corresponding endpoints based on the following API structures.

Retrieves the current wallet balance for a player.

post

Returns real-time balance information by validating game access and retrieving data from the Inventory service.

Process Flow:

  1. Validate player session and game code format

  2. Extract room ID from game code (format: "BINGAO_{roomId}")

  3. Verify game availability via Room Manager

  4. Retrieve current balance from Inventory service

Requirements:

  • Valid X-Player-Token header

  • Game code in format "BINGAO_{roomId}"

  • Supported currency (ISO 4217)

Sample request:

{
    "gameCode": "BINGAO_550e8400-e29b-41d4-a716-446655440000",
    "currency": "BRL"
}

Sample response:

{
    "player": "550e8400-e29b-41d4-a716-446655440000",
    "status": "RS_OK",
    "currency": "BRL",
    "balance": "1250.50"
}
Authorizations
AuthorizationstringRequired

REQUIRED - JWT Authorization header using the Bearer scheme. All API endpoints require authentication, except for authentication endpoints (Connect/authentication). Example: "Authorization: Bearer {token}"

Query parameters
api-versionstringOptional
Header parameters
X-Player-TokenstringOptional

Player access token for session validation

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Body
gameCodestring | nullableOptional
currencystring | nullableOptional
Responses
200

Successfully retrieved player balance with current amount and currency information.

post
/wallet/player/balance

Processes a BET transaction (debit) on the player's wallet.

post

Debits the player's account with bet amount after validating game access and player session.

Process Flow:

  1. Validate player session and authentication token

  2. Extract and validate transaction ID from headers

  3. Verify game code format (format: "BINGAO_{roomId}")

  4. Check game availability via Room Manager

  5. Process debit transaction via Inventory service

  6. Apply idempotency checks to prevent duplicate debits

Requirements:

  • Valid X-Player-Token header for authentication

  • Valid X-Transaction-Id header (GUID format) for idempotency

  • Game code in format "BINGAO_{roomId}"

  • Supported currency (ISO 4217)

  • Positive amount value

  • Sufficient balance in player account

Idempotency:

  • Re-sending the same X-Transaction-Id with identical body returns the same result (200 OK)

  • Re-sending the same X-Transaction-Id with a different body returns 409 Conflict

Sample request:

Important:

  • This endpoint does not return the updated balance

  • Use /wallet/player/balance to retrieve the current balance after processing

  • Amount is debited as provided (decimal precision maintained)

  • Transaction will fail if player has insufficient balance

Authorizations
AuthorizationstringRequired

REQUIRED - JWT Authorization header using the Bearer scheme. All API endpoints require authentication, except for authentication endpoints (Connect/authentication). Example: "Authorization: Bearer {token}"

Query parameters
api-versionstringOptional
Header parameters
X-Transaction-Idstring · uuidOptional

Unique transaction identifier for request tracking

Example: fd694e40-753f-4cdf-9c46-32f80e1b1fb8
X-Player-TokenstringOptional

Player access token for session validation

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Body
gameCodestring | nullableOptional
currencystring | nullableOptional
amountnumber · doubleOptional
Responses
200

Bet transaction successfully processed and debited from player account.

No content

post
/wallet/transaction/bet

No content

Processes a WIN transaction (credit) for the player's wallet.

post

Credits the player's account with winning amount after validating game access and player session.

Process Flow:

  1. Validate player session and authentication token

  2. Extract and validate transaction ID from headers

  3. Verify game code format (format: "BINGAO_{roomId}")

  4. Check game availability via Room Manager

  5. Process credit transaction via Inventory service

  6. Apply idempotency checks to prevent duplicate credits

Requirements:

  • Valid X-Player-Token header for authentication

  • Valid X-Transaction-Id header (GUID format) for idempotency

  • Game code in format "BINGAO_{roomId}"

  • Supported currency (ISO 4217)

  • Positive amount value

Idempotency:

  • Re-sending the same X-Transaction-Id with identical body returns the same result (200 OK)

  • Re-sending the same X-Transaction-Id with a different body returns 409 Conflict

Sample request:

Important:

  • This endpoint does not return the updated balance

  • Use /wallet/player/balance to retrieve the current balance after processing

  • Amount is credited as provided (decimal precision maintained)

Authorizations
AuthorizationstringRequired

REQUIRED - JWT Authorization header using the Bearer scheme. All API endpoints require authentication, except for authentication endpoints (Connect/authentication). Example: "Authorization: Bearer {token}"

Query parameters
api-versionstringOptional
Header parameters
X-Transaction-Idstring · uuidOptional

Unique transaction identifier for request tracking

Example: 7881704e-f897-45f8-820b-9929e687a17f
X-Player-TokenstringOptional

Player access token for session validation

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Body
gameCodestring | nullableOptional
currencystring | nullableOptional
amountnumber · doubleOptional
Responses
200

Win transaction successfully processed and credited to player account.

No content

post
/wallet/transaction/win

No content

Retrieves a paginated list of betting transactions grouped by rounds.

get

Returns betting transaction history with round-based grouping and optional filtering by session or round.

Features:

  • Transactions grouped by round ID for better organization

  • Optional filters: sessionId and roundId

  • Pagination support (default: page 1, size 10)

  • Only returns BET type transactions

  • Player-scoped results (authenticated player only)

Response Format:

  • JSON with camelCase naming

  • Indented formatting for readability

  • Null values excluded

Sample request:

GET /api/v1/wallet/transaction/bet?pageNumber=1&pageSize=20&sessionId=550e8400-e29b-41d4-a716-446655440000

Sample response:

{
    "roundId": "round_550e8400-e29b-41d4-a716-446655440000",
    "transactions": [
        {
            "transactionId": "txn_123456789",
            "amount": "25.50",
            "currency": "BRL",
            "timestamp": "2024-01-15T14:30:00Z",
            "type": "bet"
        }
    ]
}
Authorizations
AuthorizationstringRequired

REQUIRED - JWT Authorization header using the Bearer scheme. All API endpoints require authentication, except for authentication endpoints (Connect/authentication). Example: "Authorization: Bearer {token}"

Query parameters
pageNumberinteger · int32Optional

The page number for pagination (1-based indexing). Controls which page of results to return. Default value is 1.

Default: 1
pageSizeinteger · int32Optional

The number of transaction groups per page. Controls response size and performance. Default value is 10, recommended range 1-100.

Default: 10
sessionIdstring · uuidOptional

Optional game session identifier (GUID format) to filter transactions by specific gaming session. When provided, only transactions from the specified session are returned.

roundIdstring · uuidOptional

Optional round identifier (GUID format) to filter transactions by specific game round. When provided, only transactions from the specified round are returned.

api-versionstringOptional
Header parameters
X-Player-TokenstringOptional

Player access token for session validation

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

Successfully retrieved paginated betting transactions with round-based grouping and applied filters.

get
/wallet/transaction/bet

Retrieves a paginated list of winning transactions grouped by rounds.

get

Returns winning transaction history with round-based grouping and optional filtering by session or round.

Features:

  • Win transactions grouped by round ID

  • Optional filters: sessionId and roundId

  • Pagination support (default: page 1, size 10)

  • Only returns WIN type transactions

  • Player-scoped results (authenticated player only)

  • Includes regular wins, bonuses, and jackpots

Response Format:

  • JSON with camelCase naming

  • Indented formatting for readability

  • Null values excluded

Sample request:

GET /api/v1/wallet/transaction/win?pageNumber=1&pageSize=25&sessionId=550e8400-e29b-41d4-a716-446655440000

Sample response:

{
    "roundId": "round_550e8400-e29b-41d4-a716-446655440000",
    "winTransactions": [
        {
            "transactionId": "win_txn_987654321",
            "amount": "125.75",
            "currency": "BRL",
            "timestamp": "2024-01-15T14:32:15Z",
            "type": "win"
        }
    ]
}
Authorizations
AuthorizationstringRequired

REQUIRED - JWT Authorization header using the Bearer scheme. All API endpoints require authentication, except for authentication endpoints (Connect/authentication). Example: "Authorization: Bearer {token}"

Query parameters
pageNumberinteger · int32Optional

The page number for pagination (1-based indexing). Controls which page of win results to return. Default value is 1.

Default: 1
pageSizeinteger · int32Optional

The number of win transaction groups per page. Controls response size and performance. Default value is 10, recommended range 1-100.

Default: 10
sessionIdstring · uuidOptional

Optional game session identifier (GUID format) to filter win transactions by specific gaming session. When provided, only win transactions from the specified session are returned.

roundIdstring · uuidOptional

Optional round identifier (GUID format) to filter win transactions by specific game round. When provided, only win transactions from the specified round are returned.

api-versionstringOptional
Header parameters
X-Player-TokenstringOptional

Player access token for session validation

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

Successfully retrieved paginated winning transactions with round-based grouping and applied filters.

get
/wallet/transaction/win

Processes a ROLLBACK transaction to reverse a previously processed BET transaction.

post

Reverts a BET transaction by crediting back the original bet amount to the player's account after validating transaction integrity.

Process Flow:

  1. Extract and validate rollback transaction ID from headers

  2. Retrieve original BET transaction by transaction ID from request body

  3. Verify transaction exists and is of type BET

  4. Verify rollback amount matches original BET amount

  5. Check if transaction was already rolled back

  6. Process rollback credit via Inventory service

  7. Apply idempotency checks to prevent duplicate rollbacks

Requirements:

  • Valid X-Transaction-Id header (GUID format) for idempotency

  • Request body must contain the original BET transaction ID to be rolled back

  • Referenced transaction must exist and be of type BET

  • Rollback amount must exactly match original BET amount

  • Transaction cannot have been previously rolled back

  • Supported currency (ISO 4217)

Idempotency:

  • Re-sending the same X-Transaction-Id with identical body returns the same result (200 OK)

  • Re-sending the same X-Transaction-Id with a different body returns 409 Conflict

Sample request:

Important:

  • This endpoint does not return the updated balance

  • Use /wallet/player/balance to retrieve the current balance after processing

  • Amount must exactly match the original BET amount

  • Once rolled back, the same transaction cannot be rolled back again

Authorizations
AuthorizationstringRequired

REQUIRED - JWT Authorization header using the Bearer scheme. All API endpoints require authentication, except for authentication endpoints (Connect/authentication). Example: "Authorization: Bearer {token}"

Query parameters
api-versionstringOptional
Header parameters
X-Transaction-Idstring · uuidOptional

Unique transaction identifier for request tracking

Example: 1417156b-f533-4ac1-bb37-99d5d9a35197
Body
transactionIdstring · uuidOptional
amountnumber · doubleOptional
currencystring | nullableOptional
Responses
200

Rollback transaction successfully processed and amount credited back to player account.

No content

post
/wallet/transaction/rollback

No content

Last updated