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
| Need | 0Gate shape | Why it fits |
|---|---|---|
| Hosted buy flow | Create 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 flow | Create 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 flow | Create 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 widget | Omit 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 WebView | Send 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 reconciliation | Join 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:
| Responsibility | Owned by | Public-safe contract |
|---|---|---|
| Order intent | Your backend | Store your order id, user reference, amount, currency, and expected flow before creating the session. |
| Session authority | 0Gate API | The session locks server-bound values and returns client_secret once on creation. |
| Browser UX | Hosted 0Gate widget or redirect | The browser receives only pk_* and session-scoped values. |
| Completion signal | Signed webhooks | Verify Gate-Signature, dedupe by event id, and update durable records server-side. |
| Support trace | Your app and 0Bit support | Keep 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.
| Group | Product purpose | Start with |
|---|---|---|
| Sessions | Create, retrieve, list, and cancel hosted sessions. | Create a 0Gate session |
| Embed | Bootstrap the hosted iframe with browser-safe values. | Bootstrap embed token |
| Capabilities | Discover configured countries, currencies, assets, payment methods, payout methods, and eligibility. | Check eligibility |
| Quotes | Preview indicative quotes before a hosted checkout path. | Preview 0Gate quotes |
| Transactions | Read partner-scoped transaction records for support and reconciliation. | List 0Gate transactions |
| Webhooks | Test, inspect, and replay delivery records where supported. | List webhook deliveries |
| Branding | Read 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.
Related pages
0Gate quickstart
Create the first session, mount the hosted experience, and verify signed webhooks.
0Gate core concepts
Learn the vocabulary behind sessions, flow locks, client secrets, callbacks, and webhooks.
How 0Gate works
See the runtime architecture and the boundary between server, browser, hosted UX, and backend events.
Capability-first routing
Check support before presenting countries, assets, methods, and flows to users.
Quickstart
Your first 0Gate integration path: get sandbox keys, create a session server-side, embed the widget, verify signed webhooks, and prepare a reviewed production cutover.
Core concepts
The product vocabulary behind 0Gate sessions, flow locks, embeds, callbacks, webhooks, capabilities, and reconciliation.