Skip to content

Quickstart ​

One pass through the whole challenge lifecycle on your staging tenant: buy a challenge, validate a bet, record it, settle it, pass, and continue into a funded account. Every block can be pasted into a terminal as is. It takes about 15 minutes.

Prerequisites ​

  • A staging tenant and its server API key (key-…). Access is not self-serve: see Getting Access.
  • curl and jq
  • A bash or zsh shell. The steps share shell variables, so run them all in the same terminal.

Prefer TypeScript?

This walkthrough uses curl so every request is visible. In a Node.js backend the same calls are one line each with the SDK: npm install @fundedfast/sdk, see Node.js SDK.

1. Set your environment ​

bash
export FAST_API=https://api.fundedfast.eu/v1
export FAST_API_KEY=key-your-staging-key
export USER_ID="qs-$(date +%s)"   # a fresh test player for this run

USER_ID is your own identifier for the player. FAST does not create users: any string you send becomes a user the first time it appears.

2. Check the connection and list tiers ​

bash
curl -s -H "X-API-Key: $FAST_API_KEY" $FAST_API/challenge-tiers \
  | jq '.challengeTiers[] | {id, name, ownStake, bonusAmount, targetBalance, minBetsRequired, minActiveDays}'

You get the tiers your tenant sells. A new staging tenant has one, Standard (see The Standard program). A 401 means the key is wrong or missing.

A player passes when their balance reaches targetBalance and they have placed minBetsRequired accepted bets on minActiveDays different days. The Standard tier needs 10 active days, which you cannot do in 15 minutes. So the next step creates a tier you can pass with one bet.

3. Create a quick-pass tier (staging only) ​

A tier is built on a ruleset. Create a permissive one, then a tier using it: 10 own stake + 90 bonus = 100 starting balance, target 110, one bet on one day.

bash
RULESET_ID=$(curl -s -X POST $FAST_API/admin/rulesets \
  -H "X-API-Key: $FAST_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Quickstart","maxStakePercent":10,"minOdds":1.2,"maxOdds":10,"maxPayoutMultiplier":5,
       "luckyBetMaxProfitPercent":50,"luckyBetMaxOdds":20,"minBetsRequired":1,"minActiveDays":1,
       "dailyDrawdownPercent":50,"totalDrawdownPercent":50}' \
  | jq -r '.ruleset.id')

TIER_ID=$(curl -s -X POST $FAST_API/admin/challenge-tiers \
  -H "X-API-Key: $FAST_API_KEY" -H "Content-Type: application/json" \
  -d "{\"name\":\"Quickstart\",\"ownStake\":10,\"bonusAmount\":90,\"targetBalance\":110,\"durationDays\":7,
       \"challengeRulesetId\":\"$RULESET_ID\",\"fundedRulesetId\":\"$RULESET_ID\",\"fundedAccountBalance\":1000,
       \"profitSplitPercent\":80,\"payoutCapPercent\":null}" \
  | jq -r '.challengeTier.id')

echo "ruleset=$RULESET_ID tier=$TIER_ID"

If either ID prints as null, run the curl without | jq to see the error. 403 tier_limit_reached means your plan's tier limit is used up: delete or reuse a tier, or set TIER_ID to an existing one. On a rerun, keep the TIER_ID from the first run rather than creating another tier.

4. Buy a challenge ​

bash
curl -s -X POST $FAST_API/challenges/purchase \
  -H "X-API-Key: $FAST_API_KEY" -H "Content-Type: application/json" \
  -d "{\"userId\":\"$USER_ID\",\"challengeTierId\":\"$TIER_ID\"}" \
  | jq '.challenge | {id, status, startingBalance, currentBalance, targetBalance}'
json
{ "id": "…", "status": "active", "startingBalance": 100, "currentBalance": 100, "targetBalance": 110 }

FAST records the challenge and nothing else. Taking the 10 own stake from the player's wallet is your job, before this call or in an approval handler.

5. Validate a bet ​

Before your sportsbook accepts a bet from a challenge player, ask FAST whether the rules allow it. This changes nothing:

bash
curl -s -X POST $FAST_API/bets/validate \
  -H "X-API-Key: $FAST_API_KEY" -H "Content-Type: application/json" \
  -d "{\"userId\":\"$USER_ID\",\"externalBetId\":\"$USER_ID-bet-1\",\"stakeAmount\":10,\"odds\":2.0,\"status\":\"placed\"}"
json
{ "validationResult": { "status": "accepted", "reasonCodes": [] }, "correlationId": "…" }

A "rejected" status comes with rejection codes such as max_stake_exceeded. Show the player the reason and do not take the bet.

6. Record the bet as placed ​

bash
curl -s -X POST $FAST_API/bets \
  -H "X-API-Key: $FAST_API_KEY" -H "Content-Type: application/json" \
  -d "{\"userId\":\"$USER_ID\",\"externalBetId\":\"$USER_ID-bet-1\",\"stakeAmount\":10,\"odds\":2.0,\"status\":\"placed\"}"
json
{ "status": "processed", "mode": "sync", "validationResult": { "status": "accepted", "reasonCodes": [] }, "correlationId": "…" }

The placed event is what counts toward minBetsRequired and active days. A settlement on its own does not.

7. Settle the bet ​

The bet wins: 10 at odds 2.0 returns 20 (stake + profit), so the balance goes from 100 to 110.

bash
curl -s -X POST $FAST_API/bets \
  -H "X-API-Key: $FAST_API_KEY" -H "Content-Type: application/json" \
  -d "{\"userId\":\"$USER_ID\",\"externalBetId\":\"$USER_ID-bet-1\",\"stakeAmount\":10,\"odds\":2.0,\"status\":\"settled-won\",\"settlementAmount\":20}"

Use the same externalBetId for every event of one bet. A loss is "status":"settled-lost", and a cancelled bet is "voided".

8. Read progress ​

bash
sleep 1   # progress is refreshed a moment after the bet commits
curl -s -H "X-API-Key: $FAST_API_KEY" $FAST_API/users/$USER_ID/progress | jq
json
{
  "type": "challenge_passed",
  "status": "passed_pending_choice",
  "challengeId": "…",
  "programBalance": 110,
  "targetBalance": 110,
  "ownStake": 10,
  "bonusAmount": 90,
  "refundableOwnStake": 10,
  "choices": ["continue", "refund"],
  "currency": "EUR",
  "selfExcluded": false,
  "correlationId": "…"
}

The response's shape depends on type: challenge while the challenge runs (with currentBalance, targetBalance, counters), challenge_passed now, funded_account after continuing, and none when there is nothing active (with lastOutcome saying how the last one ended). The example above is trimmed: the passed response also carries fundedAccountBalance, profitSplitPercent and the bet and day counters. Always branch on type first. See User Progress.

9. Handle the pass ​

A passed challenge does not complete by itself. It waits in passed_pending_choice until the player chooses. Until then, new purchases for this player return 409 challenge_awaiting_choice, and bets no longer count toward the challenge. Your webhook endpoint also received challenge.passed, which is the usual trigger to show the player the choice.

The player can:

  • continue into a funded account, or
  • refund: take back the 10 own stake and give up the bonus (POST …/challenge/refund-stake with confirm: true and an X-Idempotency-Key header).

Both are covered in Challenge Outcome. Here, continue:

bash
curl -s -X POST $FAST_API/users/$USER_ID/challenge/continue -H "X-API-Key: $FAST_API_KEY"
# -> { "fundedAccountId": "…", "message": "Funded account created", "correlationId": "…" }

curl -s -H "X-API-Key: $FAST_API_KEY" $FAST_API/users/$USER_ID/progress \
  | jq '{type, currentBalance, fundedAmount, withdrawableProfit}'
# -> { "type": "funded_account", "currentBalance": 1000, "fundedAmount": 1000, "withdrawableProfit": 0 }

The player now has a funded account of 1000. Profit above that can be taken as payouts, in part or in full: the player is paid their 80% share of what they take, and exactly that amount leaves the balance. The tier you created has the defaults for new tiers: at most 5 payouts; once gross profit reaches 1,000 (a balance of 2,000 here), a payout of 1,000 gross is created on its own; the account lives 180 days and closes after 30 days with no activity, with a final payout of the profit left. See Withdrawals.

10. Clean up ​

bash
curl -s -X POST $FAST_API/sandbox/reset/$USER_ID -H "X-API-Key: $FAST_API_KEY"

This deletes the player's challenges, funded accounts and bets. It works on staging tenants only. Keep the Quickstart tier for your next run, or disable it in the backoffice.

The same flow with the SDK ​

For a TypeScript/Node backend, @fundedfast/sdk wraps these calls with types, retries and error classes:

typescript
import { FastClient } from '@fundedfast/sdk';

const fast = new FastClient({ apiKey: process.env.FAST_API_KEY! });
const userId = `qs-${Date.now()}`;

// Staging only: a ruleset and tier you can pass with one winning bet
const ruleset = await fast.admin.rulesets.create({
  name: 'Quickstart', maxStakePercent: 10, minOdds: 1.2, maxOdds: 10,
  maxPayoutMultiplier: 5, luckyBetMaxProfitPercent: 50, luckyBetMaxOdds: 20,
  minBetsRequired: 1, minActiveDays: 1, dailyDrawdownPercent: 50, totalDrawdownPercent: 50,
});
const tier = await fast.admin.challengeTiers.create({
  name: 'Quickstart', ownStake: 10, bonusAmount: 90, targetBalance: 110, durationDays: 7,
  challengeRulesetId: ruleset.id, fundedRulesetId: ruleset.id, fundedAccountBalance: 1000,
  profitSplitPercent: 80, payoutCapPercent: null,
});

await fast.challenges.purchase({ userId, challengeTierId: tier.id });

const bet = { userId, externalBetId: `${userId}-bet-1`, stakeAmount: 10, odds: 2.0 };
const check = await fast.bets.validate({ ...bet, status: 'placed' });
if (check.status === 'rejected') throw new Error(check.reasonCodes.join(', '));

await fast.bets.ingest({ ...bet, status: 'placed' });
await fast.bets.ingest({ ...bet, status: 'settled-won', settlementAmount: 20 });

// Progress is refreshed just after the bet commits; give it a moment
await new Promise((r) => setTimeout(r, 1000));

// UserProgress is a discriminated union: narrow on `type` before reading fields
const progress = await fast.users.getProgress(userId);
switch (progress.type) {
  case 'challenge':
    console.log(`${progress.currentBalance} / ${progress.targetBalance}`);
    break;
  case 'challenge_passed': {
    console.log(`Passed at ${progress.programBalance}; choices: ${progress.choices.join(', ')}`);
    const { fundedAccountId } = await fast.users.continueChallenge(userId);
    console.log('Funded account', fundedAccountId);
    break;
  }
  case 'funded_account':
    console.log(`Funded: ${progress.currentBalance}, withdrawable ${progress.withdrawableProfit}`);
    break;
  case 'none':
    console.log(progress.message);
    break;
}

progress.currentBalance without the type check does not compile: a passed challenge reports programBalance, and type: "none" has no balance at all.

Next steps ​

BLACKLINE CONSULTING d.o.o.