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
| Input | Why |
|---|---|
| Country code | Primary regional availability input. |
| Currency | Avoids showing a fiat path that cannot be used for the user context. |
| Asset | Narrows crypto support before session creation. |
| Flow | Keeps buy, sell, payment, and swap decisions separate. |
| Partner policy | Lets 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
| Result | Partner action |
|---|---|
eligible: true | Continue to server-side session creation. |
eligible: false with reason | Show a generic unavailable state and preserve a support-safe reason category. |
| Missing country | Ask for explicit country context or keep the flow disabled. |
| Stale check | Re-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.
Related pages
Check supported countries
Start with the regional support catalog.
Check currencies and assets
Validate the selected currency and asset before preflight.
Check payment and payout methods
Add method support before creating a hosted flow.
Build a 0Gate payment flow
Continue from preflight into the durable hosted-session architecture.