API Documentation

Integration guide for Netspace ONE games. The entire integration process is managed through the Partners Portal.

🏢

Partners Portal

partners.netspace.one
🌐

API URL

https://api.netspace.one

Integration Process

1

Register

Get access to Partners Portal

2

Sandbox

Develop and test your integration

3

Certify

Pass certification tests

4

Production

Go live!

🏢 Partners Portal

The Partners Portal is your control center for integration. All credentials, webhooks, tests, and certification are managed there.

Portal Features

Dashboard - Overview and statistics
Integration - Credentials, webhooks, tests, certification
Players - Player management
Transactions - Transaction history
Reports - Analytics and reports
Settings - Account configuration

Integration Steps in Portal

1

API Endpoints

Test endpoints with your credentials

2

Webhooks

Configure your webhook URL

3

Tests

Run integration tests

4

Certification

Get certified for production

📦 SDKs

Use our official SDKs to quickly integrate Netspace ONE games into your platform. All SDKs handle authentication, game launching, and error handling automatically.

Available SDKs

JavaScript
PHP
Python
Java

Installation

<script src="https://cdn.netspace.one/sdk/netspace-sdk.js"></script>

Quick Start

const netspace = new NetspaceSDK.NetspaceSDK({
  apiKey: 'your-api-key',
  secretKey: 'your-secret-key'
});

const session = await netspace.launchGame({
  sessionId: 'session-123',
  playerId: 'player-456',
  gameId: 'lotterix',
  currency: 'USD',
  clientIp: '192.168.1.1'
});

netspace.openInIframe('game-container', session.game_url);

Installation

composer require netspace/sdk

Quick Start

use Netspace\NetspaceSDK;

$netspace = new NetspaceSDK([
    'apiKey' => 'your-api-key',
    'secretKey' => 'your-secret-key'
]);

$session = $netspace->launchGame([
    'sessionId' => 'session-123',
    'playerId' => 'player-456',
    'gameId' => 'lotterix',
    'currency' => 'USD',
    'clientIp' => $_SERVER['REMOTE_ADDR']
]);

header('Location: ' . $session['game_url']);

Installation

pip install netspace-sdk

Quick Start

from netspace import NetspaceSDK

netspace = NetspaceSDK(
    api_key='your-api-key',
    secret_key='your-secret-key'
)

session = netspace.launch_game(
    session_id='session-123',
    player_id='player-456',
    game_id='lotterix',
    currency='USD',
    client_ip=request.remote_addr
)

return redirect(session['game_url'])

Installation (Maven)

<dependency>
    <groupId>one.netspace</groupId>
    <artifactId>netspace-sdk</artifactId>
    <version>1.0.0</version>
</dependency>

Quick Start

NetspaceSDK netspace = new NetspaceSDK(
    "your-api-key",
    "your-secret-key"
);

LaunchResponse session = netspace.launchGame(
    new LaunchGameParams()
        .setSessionId("session-123")
        .setPlayerId("player-456")
        .setGameId("lotterix")
        .setCurrency("USD")
        .setClientIp(request.getRemoteAddr())
);

response.sendRedirect(session.getGameUrl());

SDK Features

launchGame() - Launch real money game sessions
launchDemo() - Launch demo game sessions
getCurrencies() - Get supported currencies
getGames() - Get available games catalog
getGameDetail() - Get game details by ID
assignFreeBet() - Assign Free Bet to a player
getFreeBetStatus() - Get Free Bet status
cancelFreeBet() - Cancel a Free Bet
updateJackpot() - Update jackpot amount
Automatic HMAC-SHA256 signing - Requests are signed automatically

Download SDKs

🔐 Authentication

All API communications are signed with HMAC-SHA256.

Required Headers

HeaderDescription
X-API-KeyYour API Key
X-TimestampUnix timestamp in seconds (not milliseconds)
X-SignatureHMAC-SHA256 signature

Signature Calculation

StringToSign = TIMESTAMP + METHOD + PATH + BODY
Signature = HMAC-SHA256(StringToSign, secretKey)

⚠️ Important: The PATH must include the /api prefix (e.g., /api/game/launch)

Example (JavaScript)

const crypto = require('crypto');

function generateSignature(timestamp, method, path, body, secretKey) {
  const stringToSign = `${timestamp}${method.toUpperCase()}${path}${JSON.stringify(body)}`;
  return crypto.createHmac('sha256', secretKey).update(stringToSign).digest('hex');
}

// Example:
const timestamp = Math.floor(Date.now() / 1000).toString(); // Seconds!
const signature = generateSignature(
  timestamp,
  'POST',
  '/api/game/launch',  // Must include /api prefix
  { game_id: 'lotterix', player_id: 'player123' },
  'your-secret-key'
);

📞 Webhook

Your platform must implement a single webhook endpoint to receive all Netspace calls.

Action Types

action_typeDescriptionBalance Effect
balanceBalance queryNone
betPlayer betSubtract
winPrize wonAdd
refundRefundAdd
rollbackRevert transactionRevert

Request Format

{
  "action_type": "bet",
  "session_id": "your_session_id",
  "player_id": "player123",
  "transaction_id": "txn_123",
  "amount": 10.00,
  "currency": "USD",
  "game_id": "lotterix",
  "round_id": "round_456",
  "timestamp": "2025-01-15T10:30:00.000Z"
}

Response Format

{
  "success": true,
  "balance": 1490.50,
  "transaction_id": "your_internal_txn_id"
}

🎁 Free Bets

Free Bets allow operators to offer promotional credits to players. Players can bet using promotional credits without risking their real balance, but winnings ARE credited to their real balance.

How It Works

1

Assign

Operator assigns Free Bet to player via API

2

Play

Player uses Free Bet credits in the game

3

Win

Winnings are credited to player's real balance

Free Bet Endpoints

POST/api/v1/freebets/assignAssign Free Bet to player
POST/api/v1/freebets/statusGet Free Bet status by ID
POST/api/v1/freebets/cancelCancel a Free Bet

Assign Free Bet Request

POST /api/v1/freebets/assign

{
  "operator_free_bet_id": "promo_2025_001",
  "player_id": "player123",
  "free_bets": {
    "amount": 50.00,
    "currency": "BRL",
    "expires_at": "2025-02-15T23:59:59Z"
  }
}

Get Free Bet Status

POST /api/v1/freebets/status

{
  "netspace_free_bet_id": "fb_ns_abc123"
}

Cancel Free Bet

POST /api/v1/freebets/cancel

{
  "netspace_free_bet_id": "fb_ns_abc123",
  "reason": "Player requested cancellation"
}

Webhook: Free Bet Transactions

When a player uses a Free Bet, your webhook receives transactions with additional fields:

BET with Free Bet

{
  "action_type": "bet",
  "amount": 10.00,
  "is_free_bet": true,
  "operator_free_bet_id": "promo_2025_001",
  "netspace_free_bet_id": "fb_ns_abc123"
}

⚠️ When is_free_bet: true, do NOT deduct from player's real balance.

WIN from Free Bet

{
  "action_type": "win",
  "amount": 50.00,
  "from_free_bet": true,
  "operator_free_bet_id": "promo_2025_001",
  "netspace_free_bet_id": "fb_ns_abc123"
}

✅ When from_free_bet: true, DO credit to player's real balance.

SDK Methods

assignFreeBet() - Assign Free Bet to a player
getFreeBetStatus() - Get Free Bet status and details
cancelFreeBet() - Cancel a Free Bet

✅ Certification

Tests are run from the Partners Portal in Integration > Tests.

Required Tests

AuthenticationRequired
BalanceRequired
BetRequired
WinRequired
Insufficient BalanceRequired
IdempotencyRequired
RollbackRequired
RefundOptional

Once all required tests pass, you can request production activation from the portal.

🔌 API Endpoints

Game Launch

POST /api/game/launch
FieldTypeRequiredDescription
session_idstringYour session ID
player_idstringPlayer ID
game_idstringGame ID
currencystringCurrency code
languagestringLanguage code
return_urlstringReturn URL
client_ipstringClient IP

Game Endpoints

POST/api/game/launch-demoLaunch demo session
GET/api/game/currenciesList supported currencies

Catalog Endpoints

GET/api/games/catalogGet games catalog with filters
GET/api/games/{gameId}Get game details
GET/api/games/categoriesList game categories
GET/api/games/featuredGet featured games

Free Bets Endpoints

POST/api/v1/freebets/assignAssign Free Bet to player
POST/api/v1/freebets/statusGet Free Bet status
POST/api/v1/freebets/cancelCancel a Free Bet

Jackpot Endpoints

POST/api/lotterix/jackpot/updateUpdate jackpot amount

Sandbox Endpoints

POST/api/sandbox/game/launchLaunch game in sandbox
GET/api/sandbox/game/balanceGet sandbox player balance
POST/api/sandbox/game/betSimulate a bet
GET/api/sandbox/statsGet sandbox statistics
POST/api/sandbox/resetReset sandbox data

Certification Endpoints

POST/api/certification/runRun certification tests
GET/api/certification/statusGet certification status
GET/api/certification/testsList available tests

💰 Supported Currencies

FIAT (18)

USDEURGBPBRLARSMXNCLPCOPPENCADAUDJPYCNYINRKRWTRYZARNGN

Crypto (15)

BTCETHUSDTUSDCBNBXRPSOLADADOGETRXTONMATICLTCAVAXDOT

🌍 Supported Languages

🇺🇸Englishen
🇪🇸Españoles
🇧🇷Portuguêspt
🇫🇷Françaisfr
🇩🇪Deutschde
🇮🇹Italianoit
🇷🇺Русскийru
🇹🇷Türkçetr
🇨🇳简体中文zh
🇯🇵日本語ja
🇰🇷한국어ko
🇸🇦العربيةar
🇮🇳हिन्दीhi
🇵🇱Polskipl
🇨🇿Češtinacs

⚠️ Error Codes

CodeDescription
INSUFFICIENT_BALANCEBalance insufficient
PLAYER_NOT_FOUNDPlayer does not exist
INVALID_SESSIONSession invalid or expired
DUPLICATE_TRANSACTIONTransaction already processed
INTERNAL_ERRORInternal error

Error Response Format

{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Player balance is insufficient"
  }
}

📥 Downloads

Download the complete integration documentation in PDF format.