POST /finish
Beexar → Operator
Terminal window
When Is
Section titled “When Is /finish Sent?”
Beexar sends this request to signal that a game round is complete. This is only sent when the last /betwin request did not set finished: true.
Request
Section titled “Request”POST {finish_url}
Headers
Section titled “Headers”| Header | Value |
|---|---|
Content-Type | application/json |
X-REQUEST-SIGN | HMAC-SHA256 signature of request body |
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | Player account identifier |
currency | string | Yes | Currency code — standard ("USD", "EUR") or custom ("CUSTOM_GOLD") |
round_id | string | Yes | Game round identifier (Beexar’s round_id) |
session_id | string | No | Session identifier (UUID) |
Example
Section titled “Example”{ "account_id": "player_123", "currency": "USD", "round_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "session_id": "7b115688-3849-490a-95bd-7c281d81c64c"}Response
Section titled “Response”Success (200 OK)
Section titled “Success (200 OK)”| Field | Type | Required | Description |
|---|---|---|---|
balance | string | Yes | Current player balance |
{ "balance": "509.80"}Error Responses
Section titled “Error Responses”| HTTP Status | Twirp Code | api_code | Description |
|---|---|---|---|
| 400 | invalid_argument | 400 | Invalid request |
| 400 | invalid_argument | 403 | Invalid or missing signature |
| 500 | internal | 500 | Internal server error |
curl Example
Section titled “curl Example”curl -X POST https://casino.example.com/wallet/finish \ -H "Content-Type: application/json" \ -H "X-REQUEST-SIGN: abc123def456..." \ -d '{ "account_id": "player_123", "currency": "USD", "round_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }'Behavioral Rules
Section titled “Behavioral Rules”- Informational only: The
/finishrequest does NOT modify the player’s balance. All financial operations have already been processed via/betwinand/rollback - Only sent when needed: If the last
/betwinrequest includedfinished: true, Beexar does not send/finish. This means simple games (dice, plinko) typically do not trigger/finishat all - Idempotency: Handle duplicate
/finishrequests for the sameround_idgracefully — return success both times - Guaranteed delivery: If your server returns an error or is unreachable, Beexar retries
/finishasynchronously with exponential backoff - Use for reconciliation: Operators should use
/finishas a signal to close the round in their bookkeeping system
When Is /finish Sent?
Section titled “When Is /finish Sent?”| Scenario | /finish sent? |
|---|---|
Dice/Plinko: single BetWin with finished: true | No |
Crash: final BetWin with finished: true | No |
Slots: multi-step round, last BetWin has finished: true | No |
Slots: multi-step round, no finished flag on last BetWin | Yes |
| Session expired with open round | Yes |
| Error recovery after rollback | Yes |