0Bit Documentation

How 0Gate works

How 0Gate separates trusted server work, browser-safe embedding, hosted UX, signed webhooks, and reconciliation.

0Gate uses a hosted-checkout architecture. Your backend creates the trusted session, the browser renders only the hosted 0Gate surface, and your backend listens for signed events before updating durable records.

Runtime architecture

This architecture keeps privileged decisions out of the browser. If the browser refreshes, closes, or receives a success callback before the webhook arrives, your backend still waits for the signed event or a server-side read before final fulfillment.

Responsibility map

LayerOwnsDoes not own
Partner product UIUser intent, button placement, checkout route, UX loading and completion screens.Secret keys, final settlement, or compliance bypass.
Partner backendSession creation, idempotency keys, order records, webhook verification, reconciliation, support logs.Hosted payment screens or private 0Bit internals.
0Gate APISession lifecycle, capability data, embed bootstrap, webhook delivery records, branding tokens, transaction reads.Your internal order model.
Hosted 0Gate surfaceUser-facing payment, ramp, swap, verification, and completion UX.Partner ledger writes or final fulfillment.
Webhook workerDurable delivery of signed events to your backend.Browser navigation state.

Data flow

DataDirectionRule
sk_* secret keyPartner backend -> 0Gate APINever send to browser, mobile app, URL, logs, analytics, or support screenshots.
pk_* publishable keyBrowser/mobile -> 0Gate embedBrowser-safe, but still scoped by origin and product configuration.
client_secretPartner backend -> browser/mobileSession-scoped; use it to mount one hosted flow.
Gate-Signature0Gate webhook -> partner backendVerify against the raw body before processing event data.
event.id0Gate webhook -> partner backendDedupe and store permanently.
user_referencePartner backend -> 0Gate -> webhookUse opaque ids, not emails, documents, or raw PII.

Failure handling

SituationProduct behaviorPartner response
Browser callback says success but webhook is missingUser may have finished the hosted UX before backend delivery completes.Show pending UI, poll your backend, and inspect webhook deliveries.
User closes the widgetSession may remain open until cancelled or expired.Keep the order pending or cancelled according to your own UX policy.
Webhook is delivered more than onceAt-least-once delivery can repeat the same event id.Dedupe by event id and make fulfillment idempotent.
Session is expired or cancelledHosted flow is no longer usable for that journey.Create a new session if the user restarts.
Capability becomes unavailableRegion, asset, method, or partner settings no longer support the requested path.Hide the path or show an unavailable state; do not force a hosted flow.

Operational trace

For every production journey, keep enough data to answer support questions without exposing secrets:

  • Your order id and user_reference.
  • 0Gate session id.
  • Transaction reference when present.
  • Webhook event id and event type.
  • Request id from API responses.
  • Environment: sandbox/test or live.
  • Return URL and cancel URL origins.
  • Final state recorded in your own ledger.

On this page