API Docs
POST/v1/games/play

Play Game

Play a round in the current game session.

Headers

  • Content-Typeapplication/json

Request body

{
  "merchantCode": "string",
  "playerId": "string",
  "gameType": "high-low | coin-flip",
  "choice": "higher | lower | same | head | tail",
  "payload": {
    "customData": "any"
  }
}
HTTP 200application/json
{
  "status": "SUCCESS",
  "success": true,
  "message": "You won!",
  "data": {
    "betAmount": 10,
    "currentBalance": 17520,
    "winStreak": 1,
    "loseStreak": 0,
    "totalGames": 1,
    "betHistory": [
      {
        "round": 1,
        "bet": 10,
        "choice": "lower",
        "result": "win",
        "payout": 2,
        "credit": 2,
        "displayCard": "9♥",
        "drawnCard": "3♥"
      }
    ],
    "currentCard": "3♥",
    "currentCardValue": 3,
    "currentCardSuit": 3,
    "currentCardSuitText": "Hearts",
    "cardsRemaining": 50,
    "nextTierCredit": 5,
    "probabilities": {
      "higherProb": 0.92,
      "lowerProb": 0.14,
      "sameProb": 0.06
    },
    "isSameChoiceDisabled": true,
    "sameCardBehavior": "win",
    "result": "win",
    "reward": 2,
    "drawnCard": "3♥"
  }
}
HTTP 400HTTP 400
{
  "status": "ERROR",
  "success": false,
  "message": "Invalid choice 'invalid'. Valid choices for high-low: higher, lower, same",
  "data": {
    "validChoices": [
      "higher",
      "lower",
      "same"
    ]
  }
}

cURL example

curl -X POST \
  "{API_BASE_URL}/v1/games/play" \ 
  -H "Content-Type: application/json" \
  -d '{
  "merchantCode": "string",
  "playerId": "string",
  "gameType": "high-low | coin-flip",
  "choice": "higher | lower | same | head | tail",
  "payload": {
    "customData": "any"
  }
}'
← Back to API list