π° Credits Action Endpoint
The Credits Action API allows a cashier to add or remove credits from a player account.
Depending on whether the amount is positive or negative, the system performs a
cash in or cash out operation respectively.
β οΈ Handling bonus_error, wager issues, and Reset Behavior
Most errors in this endpoint are related to wager mode (wager = 1).
These checks exist to protect game integrity when a player has unfinished rounds,
active bonuses, or temporary restrictions.
If you do not use wager = 1, most of these errors
will never appear.
π Common Error Cases
π Credits IN
1οΈβ£ 409 Conflict β Player already has active credits
{
"success": false,
"message": "Player has credits, first play all credits"
}
π‘ This means the player still has active game credits.
You must first perform a CASH OUT before doing another CASH IN.
Resetting will not help β simply finish or withdraw existing credits.
2οΈβ£ 423 Locked β Player in cooldown (Wager protection)
π Credits IN
{
"success": false,
"message": "You cannot use Wager Bonus yet. Try again in 0:22:41. player: p100"
}
π‘ The player is still under a wager timer and cannot use bonus mode yet.
Wait until the countdown ends or perform a CASH IN with wager = false.
Reset will not fix this issue.
3οΈβ£ 423 Locked β Unfinished session (Bonus error)
π Credits IN | OUT
{
"success": false,
"desc": "bonus_error",
"message": "Player: p100. Error: Total win not collected, please collect. Game: Black Jack"
}
π‘ This appears when the player has unfinished bonuses, free spins, or total wins.
In this case, you may safely retry the request with reset: true to
automatically clear all active bonus or session data.
π Use reset: true only when you receive a bonus_error.
For all other errors (like active credits or wager timer), reset will not help.
- πΉ
wager = 1 β enables stricter validation (may trigger 409 or 423).- πΉ
wager = false β simpler cash in/out, fewer restrictions.- πΉ
reset = true β use only for bonus_error cases.
βΉοΈ Description
- Positive amount β Credits IN (Deposit / Wager).
- Negative amount β Credits OUT (Withdraw / Cash Out).
- The action automatically updates player, cashier, and shop balances.
- Bonuses, wager limits, and happy hour logic are handled automatically by the backend.
- Wager mode (
wager = 1): Performs strict checks to prevent overlapping sessions or unfinished games. - Reset flag (
reset = true): Automatically clears unfinished player sessions before applying IN/OUT. Only needed when the API returns abonus_error.
POST https://proapi.gapi.lol/api/cashier/user/{id}/credits-action
This endpoint requires a valid cashier Bearer token:
Authorization: Bearer <your_token>
Accept: application/json
Send the following fields as JSON in the request body:
{
"amount": 100,
"wager": 1,
"reset": false
}
100 = 1.00 USDWagerplayer gets double credits with cashout restrictionsamountβ credits to add (positive) or remove (negative).wagerβ optional flag (1= enable wager bonus mode).resetβ optional flag (true= reset unfinished bonuses/sessions).
When credits are added successfully:
{
"success": true,
"in": true,
"message": "demo in: Normal deposit: 100.00 USD"
}
When credits are withdrawn successfully:
{
"success": true,
"out": true,
"message": "demo out: 50.00 USD"
}
400 Bad Request β Invalid or missing amount:
{
"success": false,
"message": "Invalid amount"
}
401 Unauthorized β Invalid or missing token:
{
"success": false,
"message": "Unauthorized"
}
404 Not Found β Player not found:
{
"success": false,
"message": "User not found"
}
403 Forbidden β Insufficient shop credits:
{
"success": false,
"message": "You dont have enough credits, please contact your operator!"
}
409 Conflict β Player already has active credits:
{
"success": false,
"message": "Player has credits, first play all credits"
}
π‘ When you see this message, you must first perform a CASH OUT
before doing another CASH IN.
423 Locked β Player in cooldown (Wager protection):
{
"success": false,
"message": "You cannot use Wager Bonus yet. Try again in 0:22:41. player: p100"
}
π‘ Wait until the timer expires, or perform a CASH IN with wager = false.
423 Locked β Unfinished session (Bonus error):
{
"success": false,
"desc": "bonus_error",
"message": "Player: p100. Error: Total win not collected, please collect. Game: Black Jack"
}
π‘ Only in this case you may safely retry with reset = true.
500 Internal Server Error β Unexpected issue:
{
"success": false,
"message": "Server error: Database transaction failed"
}
curl -X POST "https://proapi.gapi.lol/api/cashier/user/3154/credits-action" \
-H "Authorization: Bearer <your_token>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"wager": 1,
"reset": true
}'