Fantasy Sports

Callback Introduction

In this system, callbacks are secure, server-to-server HTTPS POST requests sent from the fantasy sports platform to the client’s wallet API. These callbacks notify the wallet system of specific actions, such as placing a bet, refunding a bet, or settling payouts.

Each callback serves a unique purpose, but they all follow the same fundamental communication pattern:

These callbacks ensure that the wallet system accurately tracks user transactions and maintains consistency between the fantasy platform and the client’s wallet. Proper implementation of each callback helps prevent issues like double charges, incorrect payouts, or missed entries in tournaments.


Place Bet Callback

The Place Bet callback is triggered whenever a user attempts to enter one or more tournaments on the fantasy sports platform. This callback informs the wallet system to either deduct funds or register free entries based on ticket validation. The client must implement this endpoint to process and respond to place bet requests.

Endpoint Example

The callback is a server-to-server HTTP POST request to:


    
https://{your_server}/bets

Request Structure

Each request is in JSON format and can contain multiple bets in a single array. The payload includes user information, tournament details, and bet data. This structure supports both paid and free-to-play tournaments. For free-to-play tournaments, the buy-in (amount) and rake can be set to 0.0, while the overdraw field may contain a prize pool value for payouts.

Headers

Request Body Example


    
{ "headers": { "authorization": "Bearer customer {user_token}" }, "body": { "bets": [ { "user": { "client": "string", // Platform identifier "uid": "string", // Unique user ID "name": "string", // Username "ip": "string" // User's IP address }, "pool": { "client": "string", // Platform identifier "game": "string", // Game type (e.g., "fantasy" or "micro") "uid": "integer", // Unique tournament ID "currency": "string", // Tournament base currency "overdraw": "decimal number", // Guaranteed prize pool amount / Freeroll prize "category": "string", // Tournament type (e.g., admin_created, hidden) "amount": "decimal number" // Tournament buy-in, set to 0.0 if free-to-play }, "bet": { "uid": "integer", // Unique ID of the fantasy team (actual bet ID) "uuid": "string", // Unique identifier for the request (sanity check only) "base_amount": "decimal number", // Buy-in in tournament's base currency (0.0 for free-to-play) "amount": "decimal number", // Total buy-in amount (0.0 for free-to-play) "rake": "decimal number", // Entry fee (set to 0.0 for free-to-play) "currency": "string", // Currency of the bet (user’s currency) "ticket": "string (optional)" // Ticket token if applicable (see ticket section) } } ] } }

Field Descriptions

Idempotency and Request Validation


Refund Bet Callback

The Refund Bet callback is used to reverse the buy-ins for one or more fantasy teams within a specified tournament. This request is initiated from our platform to the client’s wallet API to ensure that users are refunded appropriately for their bets. This callback can include multiple refunds, covering all teams in a tournament or just a subset.

Endpoint and Authorization

Idempotency and Reliability

Request Structure

The request payload contains details about the tournaments and associated bets being refunded. Multiple tournaments and/or bets can be included in a single request.

Headers


    
{ "authorization": "Bearer customer {admin_token}" }

Request Body Example


    
{ "pools": [ { "pool": { "client": "string", // Name of white label, not necessarily the client's own "status": "string", // Status of the tournament (e.g., "waiting", "cancelled") "game": "string", // Game type, should be "fantasy" " uid": "integer", // Unique ID of the tournament "currency": "string", // Tournament's base currency "category": "string", // Tournament type (e.g., "admin_created") "overdraw": "number" // Guaranteed prize pool amount / Freeroll prize }, "bets": [ { "user": { "client": "string", // Name of white label, unique to client "uid": "string", // Unique user ID "name": "string" // Username }, "bet": { "uid": "integer", // Unique ID of the fantasy team (actual bet ID) "amount": "number", // Buy-in amount "rake": "number", // Entry fee "currency": "string", // Bet currency "base_amount": "number", // Buy-in in tournament’s base currency "uuid": "string" // Unique identifier for the request, referenced from place-bet request } } ] } ] }

Field Descriptions

Response Handling


Refund Tournament Callback (Optional)

The Refund Tournament callback is an optional endpoint specifically for cases where an entire tournament is cancelled, triggering refunds for all entries (bets) within that tournament. This callback closely mirrors the Refund Bet callback, with a few key differences:

Idempotency and Reliability

Response Handling

json { "error": "Descriptive error message" }

This optional callback offers flexibility for clients who want to manage full tournament refunds separately from single-bet refunds, providing future-proofing for handling individual and batch refunds in cancelled tournaments.


Settle Bet Callback

The Settle Bet callback sends all participants in a tournament, regardless of whether they received payouts. This callback processes results for the tournament and settles the appropriate winnings for each user.

Endpoint and Authorization

Idempotency and Reliability

Request Structure

Each request includes details about the tournament and the users involved, along with information about the user’s bet, rank, and payout.

Headers


    
{ "authorization": "Bearer customer {admin_token}" }

Request Body Example


    
{ "pools": [ { "pool": { "client": "string", // Platform identifier "game": "string", // Game type (e.g., "fantasy") "uid": "integer", // Unique tournament ID "currency": "string", // Tournament base currency "overdraw": "decimal string", // Total prize pool payout "category": "string", // Tournament type (e.g., "admin_created") "status": "string", // Status of the tournament (e.g., "waiting", "in_progress", "closed", "cancelled") "cost": "decimal number", // Entry cost for the pool "amount": "decimal number", // Amount associated with the pool "gameType": "string", // Type of game variation (e.g., "universal_six") "overlay": "boolean", // Indicates if there’s an overlay in prize distribution "guaranteed": "boolean", // True if the prize is guaranteed "distribution": "string", // Prize distribution type (e.g., "normal") "estimatedEndTime": "string" // Expected end time in ISO8601 format }, "bets": [ { "user": { "client": "string", // Platform identifier "uid": "string", // User ID "name": "string", // Username "ip": "string" // User’s IP address }, "bet": { "uid": "integer", // Bet ID, unique to this bet "currency": "string", // Currency of the payout "amount": "decimal number", // Bet amount "odds": "decimal number", // Betting odds "rake": "decimal number", // Entry fee "payout": "decimal string", // Amount won, 0 if no winnings "base_payout": "decimal string", // Payout in tournament’s base currency "rank": "integer", // User's rank in the tournament "score": "decimal number", // Score achieved "uuid": "string", // Unique identifier, used for sanity checks only. References create-bet request. "secrets": { // Optional secrets associated with the bet. } } } ] } ] }

Field Descriptions

Response Handling