0Bit Documentation

What is 0Gate?

0Gate is the hosted 0Bit product surface for ramp, swap, embed, redirect, session, webhook, and settlement-aware hosted payment flows.

0Gate is the hosted 0Bit product surface for ramp, swap, embed, redirect, and session-based hosted payment flows. Use it when your application needs a public developer path where your server controls the order intent and the hosted 0Gate experience controls the user-facing ramp, verification, payment, and completion journey.

The core integration is server-led. Your backend creates a 0Gate session with a secret key, binds the amount, currency, return URL, optional flow, destination constraints, user reference, and metadata, then sends only the browser-safe client_secret to the client. The browser mounts the hosted widget, kit block, or redirect with a publishable key. Your backend treats signed webhooks as the durable signal for fulfillment and reconciliation.

Public integration boundary

0Gate pages describe partner-safe product behavior: sessions, browser embedding, redirect flows, capabilities, co-branding, status handling, and signed webhooks. They do not expose internal provider routing, treasury operations, reserve allocation, admin routes, raw identity records, or private liquidity controls.

What 0Gate is for

Need0Gate shapeWhy it fits
Hosted buy flowCreate a session with flow: "on_ramp" and mount or redirect to 0Gate.The hosted surface owns the user-facing ramp steps while your backend owns order state.
Hosted sell flowCreate a session with flow: "off_ramp" and constrain return/cancel handling.The user completes the payout journey inside the hosted surface and your server reconciles events.
Hosted swap flowCreate a session with flow: "swap" when the user intent is already known.The session keeps the flow inside 0Gate instead of exposing liquidity internals.
Full hosted widgetOmit flow and let the user choose from approved hosted tabs.Useful when your product page is an open funding or asset-movement entry point.
Redirect or WebViewSend the user to the hosted experience when an iframe is not suitable.Best for restrictive CSPs, mobile apps, and flows where top-level navigation is cleaner.
Operational reconciliationJoin session ids, user references, transaction references, webhook event ids, and request ids.Support and finance workflows need durable backend records, not browser-only callbacks.

Product model

0Gate separates responsibility deliberately:

ResponsibilityOwned byPublic-safe contract
Order intentYour backendStore your order id, user reference, amount, currency, and expected flow before creating the session.
Session authority0Gate APIThe session locks server-bound values and returns client_secret once on creation.
Browser UXHosted 0Gate widget or redirectThe browser receives only pk_* and session-scoped values.
Completion signalSigned webhooksVerify Gate-Signature, dedupe by event id, and update durable records server-side.
Support traceYour app and 0Bit supportKeep request ids, session ids, transaction refs, event ids, timestamps, and environment.

Endpoint groups

The product pages intentionally avoid becoming a full operation reference. Use them to understand the product shape, then use the API reference for exact request and response contracts.

GroupProduct purposeStart with
SessionsCreate, retrieve, list, and cancel hosted sessions.Create a 0Gate session
EmbedBootstrap the hosted iframe with browser-safe values.Bootstrap embed token
CapabilitiesDiscover configured countries, currencies, assets, payment methods, payout methods, and eligibility.Check eligibility
QuotesPreview indicative quotes before a hosted checkout path.Preview 0Gate quotes
TransactionsRead partner-scoped transaction records for support and reconciliation.List 0Gate transactions
WebhooksTest, inspect, and replay delivery records where supported.List webhook deliveries
BrandingRead or update approved co-branding tokens.Get 0Gate branding

Minimal server pattern

import { GateClient } from '@0bit/gate';

const gate = new GateClient({
  apiKey: process.env.GATE_KEY,
  baseUrl: 'https://gate-api-sandbox.0bit.app',
});

export async function createCheckoutSession(order: {
  id: string;
  amount: string;
  currency: string;
}) {
  const session = await gate.sessions.create(
    {
      amount: order.amount,
      currency: order.currency,
      return_url: `https://app.example/orders/${order.id}/return`,
      cancel_url: `https://app.example/orders/${order.id}/cancelled`,
      user_reference: order.id,
      metadata: { order_id: order.id },
    },
    { idempotencyKey: `order_${order.id}` },
  );

  return {
    sessionId: session.id,
    clientSecret: session.client_secret,
  };
}

Keep this pattern strict: secret-key work on the backend, browser-safe values in the client, signed webhooks for fulfillment, and support-safe logs for operations.

What not to expose

0Gate public docs should not describe:

  • Internal admin routes, deploy runbooks, environment variables, provider credentials, or service-to-service secrets.
  • Provider selection, liquidity routing, reserve allocation, treasury refill logic, or internal settlement automation.
  • Raw identity documents, KYC vendor payloads, screening thresholds, or jurisdiction-specific legal reasoning.
  • Contractual fee, spread, rebate, revenue-share, SLA, or support-tier values unless they are approved for the specific partner.
  • 0Pools, 0Base, or 0Link endpoint details inside 0Gate pages unless the page is only explaining a boundary.

On this page