> For the complete documentation index, see [llms.txt](https://the-bet-brothers.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://the-bet-brothers.gitbook.io/doc/wallet-api/win.md).

# Win

This endpoint is triggered when a user wins or loses (where the amount equals 0). The Operator is responsible for increasing the player's balance by the specified amount and returning the updated balance. Each win is assigned a unique identifier, `transaction_id`.

Before modifying the user's balance, the Operator must ensure that the win has not been previously processed.

## POST /operator/wallet

> Process a win result by crediting the specified amount to the player's balance.\
> \
> The \`amount\` is in subunits (e.g., cents for EUR) and follows ISO 4217 standards.<br>

```json
{"openapi":"3.0.0","info":{"title":"Casino API - Result (Win)","version":"1.0.0"},"paths":{"/operator/wallet":{"post":{"description":"Process a win result by crediting the specified amount to the player's balance.\n\nThe `amount` is in subunits (e.g., cents for EUR) and follows ISO 4217 standards.\n","tags":["Result"],"parameters":[{"name":"X-REQUEST-SIGN","in":"header","required":true,"schema":{"type":"string"},"description":"HMAC-SHA256 signature of the raw request body using the shared password.\n"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount","currency_code","is_mobile","player_id","action","payload"],"properties":{"amount":{"type":"integer","description":"Amount in subunits. Set to 0 for a lost result."},"currency_code":{"type":"string","description":"Identifier of currency (ISO 4217)."},"is_mobile":{"type":"boolean","description":"True if it's a mobile client."},"player_id":{"type":"string","description":"Unique identifier of player."},"action":{"type":"string","enum":["win"],"description":"Must be set to \"win\"."},"payload":{"type":"object","required":["reference","session_token","provider_transfer_data"],"properties":{"reference":{"type":"string","description":"Game reference (e.g., barbarabang::MadMonkey)."},"session_token":{"type":"string","description":"Session token generated on game launch."},"provider_transfer_data":{"type":"object","required":["transaction_id","round_id","round_close"],"properties":{"transaction_id":{"type":"string","description":"Game Provider transaction ID."},"round_id":{"type":"string","description":"Game Provider round ID."},"round_close":{"type":"boolean","description":"True if the round is being closed."},"table_reference":{"type":"string","description":"Current table reference (required for live casino)."},"promo":{"type":"object","description":"Promotion details related to the transaction.","properties":{"type":{"type":"string","description":"Type of Provider's promotion"},"id":{"type":"string","description":"ID of promotion in Provider's system"}}},"jackpot":{"type":"object","properties":{"is_jackpot":{"type":"boolean"},"jackpot_id":{"type":"string","nullable":true},"jackpot_contribution":{"type":"string","nullable":true},"jackpot_details":{"type":"string","nullable":true}}},"tournament":{"type":"object","properties":{"is_tournament":{"type":"boolean"},"tournament_id":{"type":"string","nullable":true},"score":{"type":"string","nullable":true},"place":{"type":"string","nullable":true}}},"free_spin":{"type":"object","properties":{"is_free_spin":{"type":"boolean"},"free_spin_id":{"type":"string","nullable":true},"free_spin_details":{"type":"string","nullable":true},"freespin_left":{"type":"string","nullable":true}}}}}}}}}}}},"responses":{"200":{"description":"Result processed successfully.","content":{"application/json":{"schema":{"type":"object","required":["transaction_id","balance","currency_code"],"properties":{"transaction_id":{"type":"string","description":"Unique identifier of the operator transaction."},"balance":{"type":"integer","description":"Updated balance in subunits (e.g., cents)."},"currency_code":{"type":"string","description":"Identifier of currency."}}}}}},"503":{"description":"Service is unavailable.","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://the-bet-brothers.gitbook.io/doc/wallet-api/win.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
