Operator API Endpoints
Fetch Bet
Retrieve bet status and information from Phoenix Games
Retrieve the status and details of specific bets or rounds from Phoenix Games.
GET /api/v0.2/fetch-bet/{bet_id}
Retrieve details of a specific bet.
Authentication
All requests require the following headers:
| Header | Type | Required | Description |
|---|---|---|---|
X-Operator-Id | string | Yes | Unique identifier for the operator |
X-Signature | string | Yes | Base64 URL-safe encoded RSA signature of the request body |
Signature Verification
For GET requests:
- Sign the string
"{operator_id}:{bet_id}"format (e.g., "op123:abc123") - The value is signed using RSA-SHA256 with the operator's private key
- The signature is Base64 URL-safe encoded (no padding)
- The server verifies the signature using the operator's registered public key
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
bet_id | string | Yes | Unique identifier of the bet |
Request: No body required
Response
The response is a tagged union based on the bet status. The response structure varies by status:
Closed Bet:
{
"status": "CLOSED",
"reference_id": "string",
"player_id": "string",
"round_id": "string",
"instance_id": "string",
"game": "string",
"wager": 10050,
"won": 20000,
"timestamp": 1234567890000
}Open Bet:
{
"status": "OPEN",
"reference_id": "string",
"player_id": "string",
"round_id": "string",
"instance_id": "string",
"game": "string",
"wager": 10050,
"timestamp": 1234567890000
}Rolled Back Bet:
{
"status": "ROLLED_BACK",
"reference_id": "string",
"player_id": "string",
"round_id": "string",
"instance_id": "string",
"game": "string",
"wager": 10050,
"timestamp": 1234567890000
}Not Found:
{
"status": "NOT_FOUND"
}Error Response
{
"error": "string"
}Response Structure:
This is a discriminated union (tagged enum) where the status field determines which variant is returned:
CLOSED: Includes all bet details pluswonamountOPEN: Includes all bet details except payoutROLLED_BACK: Includes all bet details except payoutNOT_FOUND: Only contains the status field
Response Fields:
| Field | Type | Description |
|---|---|---|
status | string | One of: "CLOSED", "OPEN", "ROLLED_BACK", "NOT_FOUND" |
reference_id | string | Unique identifier of the bet (same as bet_id) |
player_id | string | ID of the player who placed the bet |
round_id | string | Game session/round identifier |
instance_id | string | ID of the game instance |
game | string | ID of the game |
wager | number | Bet amount in cents (divide by 100 for actual value) |
won | number | Payout amount in cents (divide by 100 for actual value, only present for CLOSED bets) |
timestamp | number | Unix timestamp in milliseconds |
Special Cases
The endpoint will return NOT_FOUND status in the following cases:
- Invalid or non-existent reference ID
- Old bets more than 90 days are removed from our system
Status Mapping
| Internal Status | Response Status | Notes |
|---|---|---|
| CLOSED | CLOSED | Includes won field |
| OPEN | OPEN | No payout information |
| CANCELLED | ROLLED_BACK | Bet was cancelled |
| FAILED | ROLLED_BACK | Bet processing failed |
| CREATED (< 2 hours old) | OPEN | Recently created bet |
| CREATED (> 2 hours old) | ROLLED_BACK | Stale created bet |
Status Codes
200 OK- Request processed successfully400 Bad Request- Invalid request body or missing headers401 Unauthorized- Invalid operator or signature403 Forbidden- Operator account is inactive
Common Error Scenarios
| Status Code | Error Message | Description |
|---|---|---|
400 | "Invalid request" | Malformed request or invalid data |
401 | "Authentication failed" | Authentication or authorization failure |
Use Cases
- Reconciliation of bet outcomes
- Player dispute resolution
- Audit trail verification
- Real-time bet status checking