Check how a wallet can register
const url = 'https://foxleague.ai/api/onboarding/check-eligibility';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://foxleague.ai/api/onboarding/check-eligibility \ --header 'Authorization: Bearer <token>'Answers what the app needs to choose a registration path for your wallet: how many player cards it holds, whether it may register now, whether the registration fee is already paid and whether it already has a team. When the chain cannot be read, the card count reads 0 and the fee reads as not paid, so read the fee state from the chain again before paying.
Who: a signed-in player.
Refusals: none.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
object
A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.
The answer. Present when success is true.
object
true when nft_count reaches nft_bypass_threshold: the wallet can register with the cards it holds instead of buying the starter squad.
true when the wallet already has a team.
true when the registration fee is paid on chain. Also false when the chain cannot be read.
true when the wallet may register now: either registration is open to every wallet or this wallet is on the access list.
Cards needed to register without buying the starter squad: 18.
Player cards the wallet holds on chain. Also 0 when the chain cannot be read.
Why the request was refused, in plain words. Present when success is false.
true when the request did what it asked. false is a refusal: read error.
Example
{ "data": { "can_skip_mint": false, "has_existing_team": false, "is_registration_paid": false, "is_whitelisted": true, "nft_bypass_threshold": 18, "nft_count": 0 }, "success": true}No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.
Example
Session expired or invalid