API Keys & Callback URLs
Overview
Section titled “Overview”Each operator has one API key that is used for:
- Authentication — the key identifies the operator in API calls
- Request signing — the secret is used to compute HMAC-SHA256 signatures
The API key and callback URLs are configured in the operator detail page.
Managing the API Key
Section titled “Managing the API Key”Navigate to Operators → select an operator → API Keys tab.
Creating a Key
Section titled “Creating a Key”- Click Create API Key
- The system generates an API Secret — the HMAC signing secret (
AUTH_TOKEN), shown only once!. It is prefixed withbxr_(production) ordev_(sandbox/local), followed by a random URL-safe token. There is no separate public key; your operator is identified by itscasino_id(slug). - Copy the secret immediately — it will not be displayed again
Regenerating a Key
Section titled “Regenerating a Key”If you need a new secret (e.g. it was compromised):
- Click Regenerate
- A new secret is generated — the old one is immediately invalidated
- Copy the new secret and update your system
Deleting a Key
Section titled “Deleting a Key”Click Delete to remove the API key entirely. The operator will not be able to launch games until a new key is created.
Configuring Callback URLs
Section titled “Configuring Callback URLs”Navigate to Operators → select an operator → Callback URLs tab.
Enter the 4 wallet callback URLs that Beexar will call during gameplay:
| Field | Endpoint | Description |
|---|---|---|
| Balance URL | POST /balance | Fetch player balance |
| BetWin URL | POST /betwin | Debit/credit player account (atomic) |
| Rollback URL | POST /rollback | Reverse previous transactions |
| Finish URL | POST /finish | Signal round completion |
- Enter each URL in the corresponding field
- Click Save
- The URLs take effect immediately for new game sessions
Example Configuration
Section titled “Example Configuration”Balance URL: https://api.casino.com/beexar/balanceBetWin URL: https://api.casino.com/beexar/betwinRollback URL: https://api.casino.com/beexar/rollbackFinish URL: https://api.casino.com/beexar/finishRequirements
Section titled “Requirements”| Requirement | Details |
|---|---|
| Protocol | HTTPS required |
| Availability | Must be publicly accessible from Beexar servers |
| Response time | Should respond within 10 seconds |
Using the API Secret
Section titled “Using the API Secret”In Launch Requests
Section titled “In Launch Requests”The API secret signs the request body; the resulting HMAC goes in the X-REQUEST-SIGN header:
BODY='{"casino_id":"your-slug","game":"dice","account":{"id":"player_1","currency":"USD"}}'SECRET="your_api_secret"SIGNATURE=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')
curl -X POST https://gateway.beexar.com/api/v1/softswiss/launcher/real \ -H "Content-Type: application/json" \ -H "X-REQUEST-SIGN: $SIGNATURE" \ -d "$BODY"In Wallet Callbacks
Section titled “In Wallet Callbacks”Beexar signs every wallet request with the same secret. Your server must validate the X-REQUEST-SIGN header:
const crypto = require('crypto');
function validateSignature(body, signature, secret) { const expected = crypto.createHmac('sha256', secret) .update(body) .digest('hex'); return crypto.timingSafeEqual( Buffer.from(signature), Buffer.from(expected) );}See Authentication for code samples in Go, Python, PHP, and more.