Free-to-Play REST API

Overview

The Free-to-Play (FTP) REST API is primarily event-driven through webhooks, with minimal direct REST endpoints. Game lifecycle events are delivered via webhooks (see Free-to-Play Webhooks), while the REST API handles reward fulfillment tracking.

Prerequisites

  • API key configured per API Setup

  • Webhook subscriptions configured per Webhook Setup

  • Understanding of FTP game types and reward structures

Base URL

Sandbox: https://api.sandbox.lucrasports.com
Production: https://api.lucrasports.com

Authentication

All requests require authentication via the X-Lucra-Api-Key header. See API Setup for details.

Game Types

Free-to-Play games support three matchup types:

Type
Description

PROFESSIONAL_SPORTS_TEAM_STAT

Team-based sports statistics

PROFESSIONAL_SPORTS_PLAYER_STAT

Individual player statistics

RECREATIONAL_GAME

Free-to-play recreational games

Endpoints

Mark User Reward as Redeemed

Record when a user has successfully claimed their Free-to-Play reward.

Request Body:

Field Descriptions:

Field
Type
Required
Description

event

string

Yes

Always "UserRewardRedeemed"

matchupId

string

Yes

UUID of the completed matchup

userId

string

Yes

UUID of the user redeeming reward

redeemedAt

string

No

ISO 8601 timestamp (defaults to current time if omitted)

Response:

Use Cases:

  • Track reward fulfillment completion

  • Prevent duplicate reward claims

  • Audit reward distribution

  • Trigger follow-up actions after redemption

Example Implementation:

Free-to-Play Game Flow

Free-to-Play games are primarily managed through webhooks rather than direct API calls:

Webhook-Driven Operations

Unlike standard Games You Play games, FTP games rely on webhooks for state changes:

Operation
Method

Game Creation

Webhook: FtpMatchupCreated

User Acceptance

Webhook: FtpMatchupAccepted

Game Completion

Webhook: ContestUserOutcome

Reward Redemption

REST: POST /user_redeemed_tenant_reward

Reward Types

Free-to-Play games use tenant-specific rewards rather than cash payouts:

Reward Fields:

  • tenantRewardId - Your reward identifier

  • intentId - Custom tracking identifier

  • metadata - Arbitrary reward details (structure defined by you)

Integration Pattern

1. Webhook Reception

Receive ContestUserOutcome webhook when game completes:

2. Reward Fulfillment

Grant the reward in your system:

3. Redemption Tracking

After successfully granting the reward, notify Lucra:

Error Handling

Status
Meaning

200

Success - Reward redemption recorded

400

Bad Request - Invalid parameters or missing required fields

401

Unauthorized - Invalid or missing API key

404

Not Found - Matchup or user not found

500

Internal Server Error

Best Practices

Idempotent Redemption

Track redemptions to prevent duplicate reward grants:

Reward Metadata Structure

Define a consistent metadata schema for your rewards:

Error Recovery

Handle failures gracefully with retry logic:

Webhook Correlation

Correlate redemption with original webhook delivery:

Last updated