Phoenix Games
Webhook Endpoints

Deposit

Credit player balance for wins and free bet claims

POST {api_base_url}/deposit

Called to credit a player's balance — either due to a win or a free bet claim.

Request Fields

FieldTypeDescription
player_idstringUnique player ID
amountintegerTotal amount being deposited
gamestringGame ID
instance_idstringGame instance ID
actionobjectType of deposit action
action_idstringID to uniquely track this action
tx_idstringUnique transaction ID

DepositAction Types

BET Action

Used when crediting winnings from a bet.

FieldTypeDescription
typestring"BET" - Action type identifier
round_idstringID of the round
wagerAmount objectAmount wagered
wonAmount objectAmount won

FREE_BET_CLAIM Action

Used when crediting free bet winnings.

FieldTypeDescription
typestring"FREE_BET_CLAIM" - Action type identifier
betsarray of FreeBetItemList of free bet results

FreeBetItem Structure

FieldTypeDescription
idstringFree bet ID
round_idstringRound ID
wagerAmount objectWager placed
wonAmount objectAmount won

Important Notes

  • amount is always expressed in cents (i.e., the true value multiplied by 100)
  • Be sure to factor this into all calculations and comparisons when crediting amounts
  • Check for idempotency by tx_id - Always verify if the transaction has already been processed to avoid double crediting

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
}
FieldTypeDescription
typestringAlways "SUCCESS" for successful operations
balancefloatUpdated player balance after deposit
timestampintegerTimestamp in milliseconds

Error Response

{
  "type": "ERROR",
  "balance": 1234.56,
  "code": "BET_NOT_FOUND"
}
FieldTypeDescription
typestringAlways "ERROR" for failed operations
balancefloat (optional)Current player balance (if available)
codestringError code explaining failure reason

Common Error Codes

  • BET_NOT_FOUND - Referenced bet doesn't exist
  • BET_ALREADY_CLOSED - Bet is no longer accepting payouts
  • INVALID_REQUEST - Request format or data is invalid