Launch an off-ramp
Build a 0Gate sell flow that moves a user from a supported crypto or stablecoin asset toward a supported fiat payout path.
Use a 0Gate off-ramp when the user wants to sell or withdraw crypto into fiat through the hosted 0Gate surface. Your backend creates a session with flow: "off_ramp", binds the amount and currency context, and lets 0Gate handle the hosted user journey. Your app records its own withdrawal intent and closes it only after verified backend events.
Flow
Implementation shape
- Create a withdrawal or sell intent in your own system.
- Check capability data for the user's market, currency, asset, and payout path where available.
- Create a session with
flow: "off_ramp"and an opaqueuser_reference. - Mount the hosted surface or use hosted redirect.
- Treat browser callbacks as UX state only.
- Verify signed webhook events before updating the withdrawal record.
const session = await gate.sessions.create(
{
amount: '250.00',
currency: 'EUR',
flow: 'off_ramp',
target_token: 'USDC',
target_network: 'ETHEREUM',
return_url: 'https://app.example/withdrawals/wd_123/return',
cancel_url: 'https://app.example/withdrawals/wd_123/cancelled',
user_reference: 'wd_123',
metadata: { withdrawal_id: 'wd_123' },
},
{ idempotencyKey: 'wd_123_off_ramp_attempt_1' },
);Guardrails
| Do | Avoid |
|---|---|
| Let the hosted surface collect and validate user-facing payout steps where required. | Publishing bank, provider, or payout-rail internals. |
| Keep off-ramp attempts pending until a verified event or server read confirms terminal state. | Treating a redirect return as payout completion. |
| Use a new session when a user restarts an expired or cancelled attempt. | Reusing stale client_secret values across attempts. |
| Store support-safe ids and timestamps for reconciliation. | Storing raw identity, bank, card, or provider payloads in docs examples. |
Status mapping
| 0Gate signal | Suggested partner state |
|---|---|
| Session created | withdrawal_pending_user_action |
| Processing event | withdrawal_processing |
| Completed event | withdrawal_completed after verification and dedupe |
| Failed event | withdrawal_failed with retry or support path |
| Expired or cancelled event | withdrawal_closed or withdrawal_cancelled |
Related pages
Check payout methods
Confirm sell-side method support before presenting the path.
Hosted redirect flow
Use top-level hosted checkout where iframe embedding is not suitable.
Failed and pending ramps
Handle delayed, abandoned, failed, expired, and cancelled attempts.
Settlement tracking
Reconcile off-ramp state without exposing provider internals.