Balance Update

This document describes the Out-Of-The-Box (OOTB) Balance Update event schema. This event should be sent whenever a user's monetary balance is updated due to actions such as deposits, withdrawals, bets, wins, or manual adjustments.

Event Key

Event KeyEvent NameType
ootb_balance_updateOOTB Balance UpdateSimple event

Event Structure

The mandatory properties (tenant, timestamp, event, and customer) are required for all events and documented in detail on the Mandatory Properties page.

Below is the JSON structure for the context-specific properties of the OOTB Balance Update event.

{
  "context": {
    "ootb_transaction_id": "11228836059",
    "ootb_action": "deposit",
    "ootb_update_amount": 10.00,
    "ootb_bonus_amount": 0.00,
    "ootb_balance_before": 100.00,
    "ootb_balance_after": 110.00,
    "ootb_change_rate": 0.20
  }
}

Parameters

Parameter KeyParameter NameTypeDescription
ootb_transaction_idTransaction IDString/NumberUnique identifier for the transaction that resulted in the balance update.
ootb_actionActionStringThe action that triggered the balance update (e.g., "deposit", "withdrawal", "bet", "win", "correction").
ootb_update_amountUpdate AmountNumberThe amount by which the main balance was updated (can be negative for debits or positive for credits).
ootb_bonus_amountBonus AmountNumberThe amount by which the bonus balance was updated (if applicable).
ootb_balance_beforeBalance BeforeNumberThe user's total balance before this specific transaction.
ootb_balance_afterBalance AfterNumberThe user's total balance after this transaction (should equal ootb_balance_before + ootb_update_amount + ootb_bonus_amount).
ootb_change_rateChange RateDecimalThe percentage change in balance (e.g., 0.2 for a 20% increase, -0.1 for a 10% decrease). Optional.

Explanation

  • event: Set to ootb_balance_update to signify a change in the user's balance.
  • context:
    • ootb_transaction_id: Provides a reference to the specific transaction that led to this balance change.
    • ootb_action: Describes the nature of the activity causing the balance update (e.g., "deposit", "bet_win", "withdrawal_fee").
    • ootb_update_amount: The delta change to the user's main cash balance.
    • ootb_bonus_amount: The delta change to the user's bonus balance, if separate.
    • ootb_balance_before: The user's total balance prior to the current update.
    • ootb_balance_after: The user's total balance immediately following the current update.
    • ootb_change_rate: An optional field to indicate the relative change in the balance.