Headless Tournaments Backend Integration

circle-info

This requires the Server to Server API Integration, you can check how to implement it here.

Basic Concepts (Property Descriptions)

Buy In Amount: Is the amount of money a customer needs to pay to join the tournament.

Total Collected: Is the total amount of money collected. ( Number of Users * Buy In Amount )

Total Balance: Is the end result of all the money collected minus all the money rewarded to users.

Type: Currently there are 2 types of tournament rewards available:

  • CASH_FIXED: Fixed cash rewards that don’t change regardless of how many users join the tournament

  • CASH_PERCENTAGE: Percentage based rewards distribute a percentage of the new pool available to each tier, thus it relies on how many users join the tournament to get reward value

Title: Title or Name of the Tournament

Description: Description text to store a longer detailed description of the tournament.

Max Participants: Is the max number of participants allowed to join the tournament. If not provided, the system will infer the max number of participants based on the compliance limit set for the max reward allowed (this only applies to Percentage Based Rewards)

Max Attempts: Set this value to the number of attempts a player can have per tournament, the value is 1 by default

Min Payout Amount: Is an optional number used in Percentage Based Rewards to ensure a min Pool Net Amount before rewards.

Fee: Is a percentage used in Percentage Based Rewards to deduct a fee from the Total Collected before distributing the rewards.

Pool Net Amount: In Percentage Based Rewards, this is the amount to be distributed amongst the different reward tiers. It’s the greatest number between the MinPayoutAmount and the Total Collected minus the applied fee. ( PoolNetAmount = GREATEST( ( TC - ( TC * Fee % ) ) , MinPayout ) )

Pool Net Amount, Fee and MinPayoutAmount are ignored in CASH_FIXED type of tournaments since by the nature of the reward they have no impact, that's why they are optional.

Scoring Type: If type selected is HIGHEST_SCORE then users will be ranked first if they have the highest score and if type selected is LOWEST_SCORE then users will be ranked first if they have the lowest score (for example Golf scoring)

Game ID: Id of the type of game the tournament represents

Location Ids: IDs of physical location (used to filter tournaments by location). If no locations are set, that means the tournament is available in ALL locations

Created At: Timestamp of when the tournament was created.

Expires At: Timestamp of when the tournament will expire (not allow more joins).

Starts At: Timestamp of when the tournament starts (it won't accept scores until after this time)

Is Public: This boolean represents if the tournament is public or private one.

Private Code: This is the private code users need to provide to gain visibility on a private tournament

Metadata String: JSON string to store extra data at both the header level and at the user score level

Position: Position of the user in the ranking / leaderboard

Position Override: Value used to display a different value on the ranking. Used for example to display tied positions, you can override a 3 rd place as 2 to show a tie between position 2 and 3

Can Submit New Score: Boolean value to determine if the user can submit a new score

Create a Tournament

POST /api/rest/pool-tournament/create

Retrieve Existing Tournament Info

Returns the data related a specific tournament ID.

GET /api/rest/pool-tournament/:matchupId?apiKey=your-Lucra-assigned-api-key

Update an Existing Tournament

Completes a tournament setting the final reward structure and type

PUT | PATCH /api/rest/pool-tournament/${matchupId}

Update Users Scores

Update the scores of the users inside a tournament. Can be called with the full list of users or with only the users that need to be updated. Scores can be updated more than once per user during the lifespan of the tournament If the attemptFinished property is passed as true, then the user round will be marked as finished and it will no longer accept new updates (it will fail the request). This is also a requirement to the Replay functionality to allow players to join a tournament more than once, it enables the Join action once again. If it's passed as false it will just update the first available/open score attempt and it will not prevent further updates If, no round complete logic can be implemented, a way to disable this attempt complete check is to pass the omitAttemptCompletedCheck when creating the tournament, thus ignoring the closure of the attempt when a Player tries to join again (this is useful when the scoring attempt logic is fully controlled on the tenant side)

See user.canSubmitNewScore to determine if a user can have a new score submited

PUT | PATCH /api/rest/pool-tournament/${matchupId}/users-scores

Complete an Existing Tournament

Completes a tournament setting the final reward structure and type

POST /api/rest/pool-tournament/${matchupId}/complete

Cancel an Existing Tournament

Cancels an existing tournament.

POST /api/rest/pool-tournament/:matchupId/cancel?apiKey=your-Lucra-assigned-api-key

Query Active Tournaments

Queries open tournaments with pagination and filters. Accepted params:

  • limit: max number of returned records (optional)

  • offset: skip N number of records (optional)

  • locationId: location ID to get records for tournaments that match that ID or that belong to all locations (optional)

  • userId: if provided, it will return only the tournaments the user is participating, It will not include Closed ones (optional)

GET /api/rest/pool-tournament/query/active?apiKey=your-Lucra-assigned-api-key

Last updated