0Bit Documentation

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

  1. Create a withdrawal or sell intent in your own system.
  2. Check capability data for the user's market, currency, asset, and payout path where available.
  3. Create a session with flow: "off_ramp" and an opaque user_reference.
  4. Mount the hosted surface or use hosted redirect.
  5. Treat browser callbacks as UX state only.
  6. 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

DoAvoid
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 signalSuggested partner state
Session createdwithdrawal_pending_user_action
Processing eventwithdrawal_processing
Completed eventwithdrawal_completed after verification and dedupe
Failed eventwithdrawal_failed with retry or support path
Expired or cancelled eventwithdrawal_closed or withdrawal_cancelled

On this page