Webhook Endpoints
Player Balance
Query current player balance
POST {api_base_url}/player-balance
Called to query a player's current balance.
Request Fields
| Field | Type | Description |
|---|---|---|
player_id | string | Unique player ID |
Response Format
All webhook endpoints must return a response with a type field indicating success or error.
Success Response
{
"type": "SUCCESS",
"balance": 1234.56,
"timestamp": 1712401234567
}| Field | Type | Description |
|---|---|---|
type | string | Always "SUCCESS" for successful operations |
balance | float | Current player balance |
timestamp | integer | Timestamp in milliseconds |
Error Response
{
"type": "ERROR",
"balance": 1234.56,
"code": "PLAYER_NOT_FOUND"
}| Field | Type | Description |
|---|---|---|
type | string | Always "ERROR" for failed operations |
balance | float (optional) | Current player balance (if available) |
code | string | Error code explaining failure reason |
Common Error Codes
PLAYER_NOT_FOUND- Player ID doesn't exist in your systemINVALID_REQUEST- Request format or data is invalid
Implementation Notes
- Performance: This endpoint should respond quickly (under 500ms when possible)
- Caching: Consider caching balance data with appropriate invalidation
- Consistency: Ensure balance reflects all recent transactions
- Real-time: Balance should be as current as possible