Prediction Markets — Casino Integration API (0.1.0)

Download OpenAPI specification:

License: LicenseRef-Proprietary

Contract between the prediction-markets platform and a casino's backend.

This spec is split by direction:

  • Platform-hosted (served by us): the JWKS endpoint casinos use to verify our outbound tokens. Documented here under paths.

  • Casino-hosted (implemented by you): the seamless-wallet API we call to move money — /wallet/debit, /wallet/credit, /wallet/rollback, /wallet/balance. These live under your configured base URL and are protected by platformJwt.

Authentication is described in docs/casino-integration/outbound-auth.md; the wallet contract in docs/casino-integration/wallet.md.

Discovery

Platform-hosted endpoints casinos consume.

Platform public signing keys (JWKS)

Public JSON Web Key Set used to verify the ES256 JWTs the platform sends on outbound server-to-server calls. Public and unauthenticated. Cache by kid and re-fetch on an unknown kid (key rotation).

Responses

Response samples

Content type
application/json
{
  • "keys": [
    ]
}

Wallet

Casino-hosted seamless-wallet endpoints the platform calls. All are authenticated with platformJwt and idempotent on txRef.

Debit a player's wallet (bet stake)

Reserve amountCents from the player's balance for a bet. Idempotent on txRef: a repeat with the same txRef MUST return the original result without charging again. If the player can't cover it, reject with INSUFFICIENT_FUNDS (HTTP 400) or HTTP 402 — the platform treats both as a clean bet rejection.

Authorizations:
platformJwt
Request Body schema: application/json
required
txRef
required
string

The platform's idempotency reference for this operation, unique per tenant. The same txRef must never be applied twice.

playerId
required
string

The casino's player id (the externalId from the player's token).

amountCents
required
integer >= 1

Amount in minor units (cents).

currency
required
string
Value: "EUR"
object

Optional bet context for the casino's records.

Responses

Request samples

Content type
application/json
{
  • "txRef": "string",
  • "playerId": "string",
  • "amountCents": 1,
  • "currency": "EUR",
  • "context": {
    }
}

Response samples

Content type
application/json
{
  • "transactionId": "string",
  • "balanceCents": 0
}

Credit a player's wallet (payout or refund)

Add amountCents to the player's balance — a winning payout at resolution or a stake refund on cancellation. Idempotent on txRef.

Authorizations:
platformJwt
Request Body schema: application/json
required
txRef
required
string

The platform's idempotency reference for this operation, unique per tenant. The same txRef must never be applied twice.

playerId
required
string

The casino's player id (the externalId from the player's token).

amountCents
required
integer >= 1

Amount in minor units (cents).

currency
required
string
Value: "EUR"
object

Optional bet context for the casino's records.

Responses

Request samples

Content type
application/json
{
  • "txRef": "string",
  • "playerId": "string",
  • "amountCents": 1,
  • "currency": "EUR",
  • "context": {
    }
}

Response samples

Content type
application/json
{
  • "transactionId": "string",
  • "balanceCents": 0
}

Reverse a previous debit

Reverse the debit identified by originalTxRef — used when a bet fails after its stake was debited. Idempotent on txRef; reversing an unknown or already-reversed debit MUST be a safe no-op returning success.

Authorizations:
platformJwt
Request Body schema: application/json
required
txRef
required
string

This rollback's own idempotency reference.

originalTxRef
required
string

The txRef of the debit being reversed.

playerId
required
string
amountCents
required
integer >= 1
currency
required
string
Value: "EUR"

Responses

Request samples

Content type
application/json
{
  • "txRef": "string",
  • "originalTxRef": "string",
  • "playerId": "string",
  • "amountCents": 1,
  • "currency": "EUR"
}

Response samples

Content type
application/json
{
  • "transactionId": "string",
  • "balanceCents": 0
}

Read a player's balance

Optional convenience endpoint for preflight checks.

Authorizations:
platformJwt
query Parameters
player
required
string

The casino's player id.

Responses

Response samples

Content type
application/json
{
  • "balanceCents": 0
}