Skip to content

Get Starting

The iGaming API lets integrators authenticate, manage operator profiles, configure games, create player sessions, and retrieve transactions and webhook logs. It is intended for platforms integrating scratch-card style games into their own ecosystems.

Use the base URL provided by the API provider, for example:

https://sandbox.api.xigsapi.com

All endpoints below are prefixed with /v1.

  1. Authenticate with API Key to get accessToken and signatureToken.
  2. Cache tokens securely.
  3. Create a profile (operator/integrator/demo).
  4. Create or update game configurations for a profile.
  5. Authenticate or create users and create game sessions.
  6. Fetch transactions, user lists, and webhook logs as needed.
graph TD
  A[API Key] --> B[POST /v1/auth/login]
  B --> C[Receive accessToken + signatureToken]
  C --> D[Cache tokens securely]
  D --> E[Create Profile]
  E --> F[Create or Update Games]
  F --> G[Authenticate or Create User]
  G --> H[Create Game Session]
  H --> I[Gameplay + Transactions]
  I --> J[Fetch Transactions / Webhook Logs]
  C --> K{Token expired?}
  K -- Yes --> B
  K -- No --> D

Below is a sequence flow of the main behavior expected between players, integrators and our API

sequenceDiagram
    actor Player
    participant Integrator
    participant API as xigsapi.com

    %% Authentication    
    
    Integrator->>API: Login (POST /v1/auth/login)
    activate Integrator
    activate API
    API-->>Integrator: accessToken
    deactivate API

    Note right of Integrator: Store accessToken (2h)

    %% Profile & Game setup
    Integrator->>API: Create profile (POST /v1/profile)
    activate API
    API-->>Integrator: profileId
    deactivate API

    Integrator->>API: Create game (POST /v1/game)
    activate API
    API-->>Integrator: gameInfo
    deactivate API

    %% Player flow
    Player->>Integrator: Start access/complete KYC

    Integrator->>API: Login or create new Player (POST /v1/user/auth)
    activate API
    API-->>Integrator: userToken
    deactivate API

    Note right of Integrator: Store userToken (2h)

    Integrator->>API: Create game session (POST /v1/game/session)
    activate API
    API-->>Integrator: sessionInfo + gameUrl
    deactivate API
	deactivate Integrator

    Integrator-->>Player: Send gameUrl    

    %% Gameplay
    Player->>API: Play game
    activate API
	critical Connect to the API offered by the integrator.
		API->>Integrator: Request a bet/wallet
		Integrator-->>API: Wallet result
	end

    API-->>Player: Update game UI
    API->>API: Persist rounds, sessions and transactions
    deactivate API
  • Authentication: see auth.md
  • Profiles: see profiles.md
  • Users: see users.md
  • Games: see games.md
  • Game Sessions: see sessions.md
  • Transactions: see transactions.md
  • Webhooks: see webhooks.md
  • Error Handling: see errors.md
  • Best Practices: see best-practices.md