Skip to content

Quickstart

Get the Velo prediction game running in your casino in under an hour.

Prerequisites

  • A running casino platform with a wallet system
  • HTTPS endpoint for Wallet API callbacks
  • API credentials (contact hi@velo.games)

Step 1: Get Your Credentials

After signing up as a B2B partner, you'll receive:

CredentialPurpose
API_KEYYour operator identifier, sent via X-Api-Key header
API_SECRETHMAC-SHA256 signing secret (never sent over the wire)
RGS_ENDPOINTYour assigned RGS server URL

Step 2: Implement the Wallet API

Velo needs to debit and credit your players' balances. Implement these 6 endpoints on your server:

POST /wallet/authenticate  → Validate player session
POST /wallet/debit         → Debit stake from player balance
POST /wallet/credit        → Credit winnings to player balance
POST /wallet/rollback      → Reverse a failed debit
POST /wallet/balance       → Return player balance
POST /wallet/end_round     → Acknowledge round closure

All requests include X-Api-Key, X-Sign (HMAC-SHA256 of request body), and X-Game-Id headers.

See the full Wallet API Reference for request/response schemas.

Example: Debit Endpoint

json
// POST /wallet/debit
// Headers: X-Api-Key, X-Sign: HMAC-SHA256(body, API_SECRET), X-Game-Id

// Request:
{
  "player_id": "abc123",
  "transaction_id": "550e8400-e29b-41d4-a716-446655440001",
  "round_id": "184721",
  "game_id": "velo_btc_5min",
  "amount": 100.00,
  "currency": "USD",
  "session_token": "session_xyz789"
}

// Response:
{
  "transaction_id": "550e8400-e29b-41d4-a716-446655440001",
  "balance": 1400.00
}

Step 3: Launch Game Sessions

When a player wants to play, your backend calls the Game Launch API:

bash
# Sign: HMAC-SHA256(API_SECRET, "api_key|player_id|timestamp")
curl -X POST https://your-rgs-host/v1/game/launch \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "player_id": "player_123",
    "currency": "USD",
    "language": "en",
    "return_url": "https://your-casino.com/lobby",
    "signature": "hmac_hex_string",
    "timestamp": "1710437400",
    "game_id": "btc_5min"
  }'

Response:

json
{
  "launch_url": "https://velo.games/game?gsid=a1b2c3d4-...",
  "gsid": "a1b2c3d4-...",
  "session_token": "abc123def456...",
  "expires_in": 3600
}

Step 4: Embed the Game

Load the launch_url in an iframe:

html
<iframe
  id="velo-game"
  src="https://velo.games/game?gsid=YOUR_GSID"
  width="100%"
  height="100%"
  style="border: none; min-height: 100vh;"
  allow="fullscreen"
></iframe>

The game is fully responsive and works on both desktop and mobile.

Step 5: Listen for Events

The game communicates with your page via window.postMessage:

html
<script>
window.addEventListener("message", (e) => {
  if (!e.data.type?.startsWith("VELO_")) return;

  switch (e.data.type) {
    case 'VELO_READY':
      console.log('Game loaded', e.data.gsid);
      break;
    case 'VELO_BET_PLACED':
      console.log('Bet placed', e.data.betId, e.data.stake);
      break;
    case 'VELO_BET_SETTLED':
      console.log('Bet settled', e.data.betId, e.data.result, e.data.payout);
      break;
  }
});
</script>

Step 6: Go Live

  1. ✅ Wallet API endpoints responding correctly (all 6, including end_round)
  2. ✅ HMAC signature verification working on your side
  3. ✅ Timestamp freshness validation (reject requests >5 min old)
  4. ✅ Idempotency handling on transaction_id
  5. ✅ Rollback handling for debit timeouts
  6. ✅ Game Launch API returning valid sessions
  7. ✅ Game embedded and displaying in iframe
  8. 🚀 You're live!

Need Help?

B2B Integration Documentation