0Bit Documentation

Run eligibility checks

Use documented eligibility and capability checks as read-only preflight before creating a hosted session or approved product object.

Eligibility checks answer whether a user context can continue into a supported product flow. The audited eligibility endpoint is 0Gate-specific, so the concrete example below is for hosted 0Gate. Other products should use their documented capability, entitlement, or review gates rather than copying the 0Gate endpoint shape.

Explicit country wins

The 0Gate capability surface supports an explicit country code and can fall back to edge geo context for user-specific checks. Prefer explicit country context when your product already has it.

Preflight loop

Inputs to include

InputWhy
Country codePrimary regional availability input.
CurrencyAvoids showing a fiat path that cannot be used for the user context.
AssetNarrows crypto support before session creation.
FlowKeeps buy, sell, payment, and swap decisions separate.
Partner policyLets your product apply stricter account or tier rules.

Server pattern

async function prepareHostedFlow(input: {
  accountId: string;
  countryCode: string;
  currency: string;
  asset?: string;
  flow: 'on_ramp' | 'off_ramp' | 'swap';
}) {
  const eligibility = await gateCapabilities.eligibility({
    countryCode: input.countryCode,
    currency: input.currency,
    asset: input.asset,
  });

  await eligibilityChecks.record({
    accountId: input.accountId,
    flow: input.flow,
    eligible: eligibility.eligible,
    reason: eligibility.unavailableReason ?? null,
  });

  if (!eligibility.eligible) {
    return { view: 'unavailable', reason: 'unsupported_context' };
  }

  return startConstrainedGateSession(input);
}

Result handling

ResultPartner action
eligible: trueContinue to server-side session creation.
eligible: false with reasonShow a generic unavailable state and preserve a support-safe reason category.
Missing countryAsk for explicit country context or keep the flow disabled.
Stale checkRe-run before creating a session if user inputs change.

Guardrails

  • Do not expose internal reason strings as customer-facing copy without review.
  • Do not treat eligibility as settlement, quote lock, or compliance approval.
  • Do not send secret credentials to the browser to run eligibility checks.
  • Do not continue with an old eligibility result after country, currency, asset, or flow changes.

On this page