Guide
Prime Mac Games operator integration
Introduction
Prime Mac Games gives operators two integration surfaces: wallet APIs that your backend owns, and provider read APIs that your tools can call to inspect configuration, launch settings, statistics, and Poker history.
Primary hosts
Portal UI:
https://portal.primemacgames.com
Provider APIs:
https://api.primemacgames.com/api/portal
Game server APIs:
https://game-api.primemacgames.com/api/game
Identifiers you will use most
operatorPublicId Public GUID for your account
providerCode Sent by the game server as X-Provider-Code
gameId Numeric provider game ID
matchId Poker match identifier
handId Poker hand identifier
- Save your operator wallet URLs in the setup card above.
- Generate and store your signing secret on your server.
- Issue a short-lived launchToken from your own system.
- Let the Prime Mac Games game server call your wallet APIs with signed headers.
- Use the provider read APIs to inspect configuration, stats, health, and Poker history.
Guide
Signed wallet requests
Authentication and request signing
All operator wallet endpoints are signed with HMAC-SHA256. Your API must validate the signature, timestamp freshness, nonce uniqueness, and provider code before handling the request body.
Required headers
Content-Type: application/json
X-Signature: {base64_hmac_sha256}
X-Timestamp: {unix_time_ms_utc}
X-Nonce: {unique_random_value}
X-Provider-Code: {providerCode}
Signing message
{timestamp}.{nonce}.{method}.{pathAndQuery}.{rawBody}
Validation checklist
1. Reject missing or malformed headers.
2. Reject timestamps outside your accepted window.
3. Reject reused X-Nonce values to prevent replay.
4. Rebuild the signing message exactly as sent.
5. Compute Base64(HMACSHA256(signingSecret, signingMessage)).
6. Compare against X-Signature using constant-time comparison.
7. Confirm X-Provider-Code matches the operator account mapped to the request.
POST
/api/player/authorize
Authorize player
Validate a launch token and return the player profile required to open the game client.
Request body
{
"launchToken": "GUID"
}
200 response
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"internalPlayerId": 2,
"operatorPublicId": "GUID",
"displayName": "player1",
"gameId": 1,
"currencyCode": "PHP",
"languageCode": "en-PH",
"countryCode": "PH",
"balance": 1000.00
}
Return the balance that should be shown to the player as soon as the game loads. Only launchToken is required in the request body.
POST
/api/balance/get
Get player balance
Read the latest player wallet balance and currency after authorization and between gameplay events.
Request body
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2"
}
200 response
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"internalPlayerId": 1,
"currencyCode": "PHP",
"balance": 1000.00
}
POST
/api/bet/place
Place bet
Debit a wager from the player wallet. Requests must be idempotent by transactionId.
Request body
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"gameId": 1,
"roundId": "R-001",
"transactionId": "T-001",
"amount": 10.00,
"currencyCode": "PHP"
}
200 response
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"internalPlayerId": 1,
"currencyCode": "PHP",
"balance": 990.00,
"transactionId": "T-001"
}
Implementation notes
- amount must be positive.
- return the post-deduction balance.
- reject insufficient funds.
- same transactionId + same payload should be safe to replay.
- same transactionId + different payload should be rejected.
POST
/api/bet/settle
Settle win
Credit the player's payout after the bet has already been deducted. Use playerActivity to include the round audit summary.
Request body
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"gameId": 1,
"roundId": "M-10021",
"transactionId": "SETTLE-M-10021-P1-0007",
"amount": 25.00,
"currencyCode": "PHP",
"playerActivity": {
"matchId": "M-10021",
"totalHands": 12,
"totalBetsAmount": 5400,
"totalTipsAmount": 30,
"totalWinsAmount": 6200,
"totalLoseAmount": 6000,
"totalRakeAmount": 145,
"netAmount": 25
}
}
200 response
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"internalPlayerId": 1,
"currencyCode": "PHP",
"balance": 1015.00,
"transactionId": "SETTLE-M-10021-P1-0007"
}
amount is the payout only and must stay positive. The original debit should already have been handled by POST /api/bet/place.
POST
/api/bet/rollback
Rollback transaction
Reverse the financial effect of a previous debit or credit using originalTransactionId.
Request body
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"gameId": 1,
"roundId": "R-001",
"transactionId": "T-003",
"originalTransactionId": "T-001",
"amount": 10.00
}
200 response
{
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"internalPlayerId": 1,
"currencyCode": "PHP",
"balance": 1000.00,
"transactionId": "T-003"
}
Rule of thumb
If the original transaction debited the wallet, rollback should add the amount back.
If the original transaction credited the wallet, rollback should deduct it back out.
GET
/api/portal/operators/{operatorPublicId}
Operator profile
Fetch the public operator identity, current status, and provider code that the game server uses for signed wallet calls.
Path params
operatorPublicId string required
200 response
{
"operatorPublicId": "GUID",
"operatorName": "WCC Games",
"status": 1,
"statusName": "Active",
"providerCode": "GP-LJQIC8B0YZ11"
}
GET
/api/portal/operators/{operatorPublicId}/games
Operator games
Return the game catalog plus the operator's enabled status, launch URL, and pricing settings per game.
200 response
{
"operatorPublicId": "GUID",
"games": [
{
"gameId": 1,
"gameCode": "POKER",
"name": "Poker",
"category": "Table game",
"launchBaseUrl": "https://livekit.poker.goscanqr.com/launch.html",
"isActive": true,
"isEnabled": true,
"currencyCode": "PHP",
"minBet": 1,
"maxBet": 1000
}
]
}
GET
/api/portal/operators/{operatorPublicId}/games/{gameId}/launch-config
Launch config
Resolve the operator-specific launch base URL and final query-string contract for a selected game.
200 response
{
"operatorPublicId": "GUID",
"gameId": 1,
"gameCode": "POKER",
"gameName": "Poker",
"launchBaseUrl": "https://livekit.poker.goscanqr.com/launch.html",
"launchUrlFormat": "https://gamelauncher.primemacgames.com/launch?gameCode=POKER&launchToken={launchToken}&operatorPublicId=GUID",
"requiredParameters": ["launchToken", "operatorPublicId", "gameCode"]
}
GET
/api/portal/operators/{operatorPublicId}/games/{gameId}/stats?days=30
Stats summary
Read dashboard-style performance totals for a single operator and game across the requested UTC date range.
200 response
{
"operatorPublicId": "GUID",
"stats": {
"operatorId": 5,
"gameId": 1,
"days": 30,
"summary": {
"totalRevenue": 83780.00,
"totalGgr": 83780.00,
"totalPotAmount": 1674918.00,
"totalPayoutAmount": 1591016.00,
"handCount": 2761,
"matchCount": 654,
"playerCount": 261
}
}
}
GET
/api/portal/operators/{operatorPublicId}/games/{gameId}/stats/daily?days=30
Daily stats
Return one summary row per UTC day for charting, trend analysis, and reconciliation exports.
200 response
{
"operatorPublicId": "GUID",
"gameId": 1,
"days": 30,
"daily": [
{
"statDateUtc": "2026-04-01T00:00:00",
"matchCount": 12,
"handCount": 86,
"totalPotAmount": 15000.00,
"totalPayoutAmount": 14250.00,
"totalRevenue": 750.00,
"totalGgr": 750.00
}
]
}
GET
/api/portal/operators/{operatorPublicId}/health
Health check
Check whether the operator setup is complete enough for live gameplay and identify missing configuration areas.
200 response
{
"operatorPublicId": "GUID",
"operatorName": "WCC Games",
"operatorStatus": 1,
"status": "ready",
"missing": [],
"checks": {
"hasAuthorizeUrl": true,
"hasWalletEndpoints": true,
"hasSigningSecret": true,
"enabledGameCount": 1,
"launchConfiguredGameCount": 1
},
"generatedUtc": "2026-04-22T10:00:00Z"
}
GET
/api/portal/integration/spec
Integration spec
Return the current provider contract, required read APIs, player ID type, and wallet expectations in one machine-readable document.
200 response
{
"provider": "Prime Mac Games",
"version": "1.0",
"playerIdType": "string",
"providerReadApis": [
"GET /api/portal/operators/{operatorPublicId}",
"GET /api/portal/operators/{operatorPublicId}/games",
"GET /api/portal/operators/{operatorPublicId}/games/{gameId}/launch-config",
"GET /api/portal/operators/{operatorPublicId}/games/{gameId}/stats",
"GET /api/portal/operators/{operatorPublicId}/games/{gameId}/stats/daily",
"GET /api/portal/operators/{operatorPublicId}/health",
"GET /api/portal/integration/spec"
]
}
GET
/api/portal/operators/{operatorPublicId}/games/1/history?limit=100
List Poker matches
Fetch paged match summaries for Poker audit, support, and reconciliation workflows. Use the next cursor returned by the API to continue paging backward in time.
Optional query params
playerId=b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2
sinceUtc=2026-02-14T00:00:00Z
beforeUtc=2026-02-14T05:00:00Z
beforeGameMatchId=12345
Paging shape
{
"items": [ ... ],
"next": {
"beforeUtc": "2026-02-14T05:00:00Z",
"beforeGameMatchId": 12345
}
}
GET
/api/portal/operators/{operatorPublicId}/games/1/history/{matchId}
Match detail
Fetch one Poker match with player summaries and hand rollups so support and audit teams can inspect a completed round in context.
Response highlights
{
"matchId": "M-10021",
"operatorPublicId": "GUID",
"players": [ ... ],
"hands": [ ... ],
"startedAtUtc": "2026-04-22T10:00:00Z",
"endedAtUtc": "2026-04-22T10:35:00Z"
}
GET
/api/portal/operators/{operatorPublicId}/games/1/history/{matchId}/hands/{handId}
Hand detail
Fetch a single hand plus its event stream to reconstruct betting, folds, showdown, and final payouts.
Response highlights
{
"handId": "H-10021-0012",
"matchId": "M-10021",
"summary": { ... },
"events": [
{
"eventType": "bet",
"playerId": "b7e7a739-04ff-4f47-8bb6-4a3f7800d7f2",
"amount": 50.00,
"createdAtUtc": "2026-04-22T10:18:07Z"
}
]
}