Phoenix Games
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:

HeaderTypeRequiredDescription
X-Operator-IdstringYesUnique identifier for the operator
X-SignaturestringYesBase64 URL-safe encoded RSA signature of the request body

Signature Verification

For GET requests:

  1. Sign the string "{operator_id}:{bet_id}" format (e.g., "op123:abc123")
  2. The value is signed using RSA-SHA256 with the operator's private key
  3. The signature is Base64 URL-safe encoded (no padding)
  4. The server verifies the signature using the operator's registered public key

Path Parameters

ParameterTypeRequiredDescription
bet_idstringYesUnique 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 plus won amount
  • OPEN: Includes all bet details except payout
  • ROLLED_BACK: Includes all bet details except payout
  • NOT_FOUND: Only contains the status field

Response Fields:

FieldTypeDescription
statusstringOne of: "CLOSED", "OPEN", "ROLLED_BACK", "NOT_FOUND"
reference_idstringUnique identifier of the bet (same as bet_id)
player_idstringID of the player who placed the bet
round_idstringGame session/round identifier
instance_idstringID of the game instance
gamestringID of the game
wagernumberBet amount in cents (divide by 100 for actual value)
wonnumberPayout amount in cents (divide by 100 for actual value, only present for CLOSED bets)
timestampnumberUnix 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 StatusResponse StatusNotes
CLOSEDCLOSEDIncludes won field
OPENOPENNo payout information
CANCELLEDROLLED_BACKBet was cancelled
FAILEDROLLED_BACKBet processing failed
CREATED (< 2 hours old)OPENRecently created bet
CREATED (> 2 hours old)ROLLED_BACKStale created bet

Status Codes

  • 200 OK - Request processed successfully
  • 400 Bad Request - Invalid request body or missing headers
  • 401 Unauthorized - Invalid operator or signature
  • 403 Forbidden - Operator account is inactive

Common Error Scenarios

Status CodeError MessageDescription
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