Capability-first routing
Use 0Gate capabilities, eligibility, and session constraints before showing a ramp, payment, payout, or swap path.
Capability-first routing means your product checks what is supported before it presents a 0Gate path to the user. The supported path can depend on country, currency, asset, network, payment method, payout method, flow, partner account configuration, environment, and contract status.
Routing model
The public product rule is simple: do not make your UI promise a country, currency, asset, network, payment method, payout method, or quote unless the current environment and partner configuration support it.
What to check
| Check | Why it matters | Example decision |
|---|---|---|
| Country eligibility | A user's region can decide whether a ramp path is available. | Hide the buy button or show an unavailable state. |
| Fiat currency | Country and partner configuration can affect supported fiat choices. | Offer only returned currencies. |
| Asset and network | Token support can differ by side and market. | Show only supported assets for on-ramp or off-ramp. |
| Payment method | Buy-side methods can be configured per country/currency. | Present only methods returned by capability data or hosted 0Gate. |
| Payout method | Sell-side payout methods can differ from payment methods. | Do not reuse buy-side method labels for sell flows. |
| Flow lock | on_ramp, off_ramp, and swap are distinct hosted paths. | Bind the session to the selected task when the UI already knows it. |
Implementation pattern
- Capture the user's intent: buy, sell, swap, fund, withdraw, or top up.
- Use server-side capability checks or approved product configuration to determine whether the path can be shown.
- If unsupported, stop before session creation and explain that the path is unavailable.
- If supported, create the 0Gate session with only allowed constraints.
- Mount the hosted surface or redirect.
- Verify the signed webhook before updating durable state.
type GateFlow = 'on_ramp' | 'off_ramp' | 'swap';
function shouldCreateGateSession(input: {
flow: GateFlow;
countrySupported: boolean;
fiatSupported: boolean;
assetSupported: boolean;
}) {
return (
input.countrySupported &&
input.fiatSupported &&
input.assetSupported &&
['on_ramp', 'off_ramp', 'swap'].includes(input.flow)
);
}This is deliberately a product guard, not a substitute for the API. The hosted 0Gate surface can still reject or route a flow according to current configuration.
Boundary
Capability-first routing is not internal liquidity routing. Public docs and partner UI should not describe provider selection, inventory levels, venue behavior, reserve allocation, treasury operations, or fallback algorithms. Say that availability depends on account configuration, region, asset, method, and current capability data.
Related pages
Check eligibility
Probe whether a region can use a ramp path before creating a session.
Constrain assets, chains, and countries
Lock only supported values into the hosted session.
Preview quotes before checkout
Show indicative pricing before the hosted checkout path.
Sandbox vs production
Keep test-mode assumptions separate from live availability.