Change User Balance
The OMG platform calls this API to modify the player's balance.
ChangeBalance
This API is provided by the integrator and is called by the OMG platform.
POST {AGENT_URL}/api/luck/balance/change_balance?trace_id=omg_trace_id
Headers
Content-Type
"application/json; charset=utf-8"
sign
"omg_sign_string"
Body
app_id
string
The unique identifier for the user, available in the merchant backend.
uname
string
User ID provided by the integrator
money
string (decimal)
Balance Change (Positive/Negative)
game_id
integer
Game ID
session_id
string
Main game round id
round_id
string
Sub-game round id. If there is only one game, the value is the same as session_id
order_id
string
A unique identifier generated each time there is a change in the amount (maximum length of 64 characters)
timestamp
integer
timestamp (in seconds)
bet
string (decimal)
Bet Amount: This value is always positive and is only present when the player places a bet.
type
integer
1:Place Bet; 2:Cancel Bet; 3:Game Payout; 4:Verify Game Completion;5:LuckWin Treasure Chest Reward Distribution;Game Position Fee Deduction
end_round
bool
Is the current game session over
cancel_order_id
string
仅This field is only populated when type is 2, indicating which order was canceled.
award_order_ids
array
This field is only populated when type is 3, representing the total payout amount for all bets in the current round. See details below.
player_login_token
string optional
User Token provided by the integrator
OMG Platform Request Parameter Example
Integrator Response Parameter Example
Integrator Response Parameter Example Description
data
Yes
object
Response Data
balance
Yes
string (decimal)
User balance, supports up to 4 decimal places.
code
Yes
integer
Status Code
msg
Yes
string
Message
Error Code
*award_order_ids Parameter Description
order_id
Yes
string
Bet Order ID
money
Yes
string(decimal)
Payout Amount
*type Parameter Description
Process Example:
Game Bet → Game Payout → Game Round End
Corresponding
type: 1 → 3 → 4Description: The player places a bet in the game, wins, and the payout is processed, followed by validation of the game round ending. This flow applies to most game processes.
Game Bet → Cancel Bet
Corresponding
type: 1 → 2Description: The player places a bet in the game, but cancels it before the round starts. This scenario is typical in multi-player (e.g., hundreds of players) games or mini-games. The
session_idfor the cancellation matches thesession_idof the bet.
Game Bet → No Win → Game Round End
Corresponding
type: 1 → 4Description: The player places a bet, but does not win in that round, which ends with validation of the game round’s completion.
Game Bet → Game Payout → Game Payout → Game Payout … → Game Round End
Corresponding
type: 1 → 3 → 3 → … → 4Description: The player places a bet and wins multiple times within the same round until the game round ends. This scenario is common in cascading slot games, slots with special features, or lottery-type games.
LUCKYWIN Treasure Chest Reward Distribution
Description: In LUCKYWIN, players can claim treasure chest rewards upon meeting turnover requirements at any time. This action is independent of the game process.
Example Parameters for OMG ChangeBalance API Request
ChangeBalance API Request API Request (Type = 1: User Bet)
API Request (Type = 2: Cancel Bet)
API Request (Type = 3: Game Payout)
API Request (Type = 4: Game Round Ended)
API Request (Type = 5: LuckWin Treasure Chest Reward)
Last updated