Webhook Endpoints
Rollback
Reverse previous withdraw actions due to errors or cancellations
POST {api_base_url}/rollback
Used to reverse a previous /withdraw action due to error or game cancellation.
Request Fields
| Field | Type | Description |
|---|---|---|
player_id | string | Player ID |
game | string | Game ID |
instance_id | string | Instance ID |
action | enum | Action being rolled back (BET, RAIN) |
action_id | string | ID of the original action being rolled back |
tx_id | string | Original transaction ID to be rolled back |
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 | Player balance after rollback |
timestamp | integer | Timestamp in milliseconds |
Error Response
{
"type": "ERROR",
"balance": 1234.56,
"code": "BET_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
BET_NOT_FOUND- Original transaction doesn't existBET_ALREADY_CLOSED- Transaction cannot be rolled backINVALID_REQUEST- Request format or data is invalid
Implementation Notes
- Idempotency: Handle multiple rollback requests for the same transaction gracefully
- Validation: Verify the original transaction exists and is eligible for rollback
- Balance Restoration: Ensure the player's balance is correctly restored to the pre-transaction state
- Audit Trail: Log all rollback operations for compliance and debugging