0Bit Documentation

Retrieve a 0Gate session

GET /gate_sessions/{id} - Read partner-scoped session state without returning the raw client secret.

0Gate is the primary public integration path for hosted payment, ramp, and swap experiences. Keep secret-key operations on your server and hand only browser-safe values to the widget.

Read the current state of a single session your partner owns. Use it for server-side reconciliation and support — never to recover the client_secret, which is returned only when the session is created.

Endpoint

FieldValue
MethodGET
Path/v1/gate_sessions/{id}
AreaSessions
Operation idretrieveSession
Auth boundarySecret key from your server.

The full request URL is https://gate-api.0bit.app/v1/gate_sessions/{id}. The {id} path parameter is a session id returned by create or list.

Use it for

Read partner-scoped session state without returning the raw client secret.

Use this endpoint only for the partner-scoped resource it describes. Store your own reference id, the returned 0Bit object id, the request id, timestamps, and the current status so support and reconciliation do not depend on browser callbacks alone.

Production rules

  • Keep secret keys on your server. This endpoint requires a sk_* key.
  • A session that belongs to a different partner returns 404, never 403 — cross-tenant ids are never confirmed to exist.
  • Reconcile on the returned status; do not depend on browser callbacks alone.
  • Branch on machine-readable status, error code, object id, and request id.
  • Treat examples and placeholder ids as fake data only.

Request

ParameterInRequiredTypeUse it for
idpathYesstringThe session id to read. Scoped to your partner.
HeaderRequiredUse it for
AuthorizationYesBearer sk_test_… or Bearer sk_live_….

Response

Returns HTTP 200 with the GateSession object. The raw client_secret is never included — it is shown only once, on create.

Retrieve does not expire a session

Reading a session does not change its status. An open session past its expires_at is still reported open here; the transition to expired happens on the embed-bootstrap path, not on this read.

Response fields

FieldWhen presentUse it for
idAlwaysThe session id.
objectAlwaysgate_session discriminator.
partner_idAlwaysThe partner that owns the session.
modeAlwaystest or live.
amountAlwaysThe bound amount, as a decimal string.
currencyAlwaysThe bound, uppercased ISO 4217 code.
return_urlAlwaysThe success redirect.
cancel_urlAlwaysThe cancel redirect, or null.
statusAlwaysopen, completed, expired, or cancelled.
expires_atAlwaysISO-8601 expiry.
created_atAlwaysISO-8601 creation time, or null.
flowAlwaysThe locked flow, or null.
target_tokenAlwaysThe token constraint, or null.
target_networkAlwaysThe network constraint, or null.
wallet_addressAlwaysThe pre-filled wallet, or null.
user_referenceAlwaysYour opaque correlation id, or null.
kyc_pre_verifiedAlwaystrue only when an accepted kyc_package was supplied at create.
metadataAlwaysYour opaque notes, returned verbatim.

Status values

statusTerminal?Meaning
openNoAccepting actions.
completedYesAt least one intent against the session succeeded.
expiredYesPast expires_at without completing.
cancelledYesThe partner cancelled the session.

Examples

curl https://gate-api.0bit.app/v1/gate_sessions/67a1f3b9e4b0c10001234567 \
  -H "Authorization: Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
{
  "id": "67a1f3b9e4b0c10001234567",
  "object": "gate_session",
  "partner_id": "507f1f77bcf86cd799439011",
  "mode": "test",
  "amount": "100.00",
  "currency": "EUR",
  "return_url": "https://partner.example/checkout/done",
  "cancel_url": null,
  "status": "open",
  "expires_at": "2026-05-27T12:00:00.000Z",
  "created_at": "2026-05-26T12:00:00.000Z",
  "flow": null,
  "target_token": null,
  "target_network": null,
  "wallet_address": null,
  "user_reference": "order_abc123",
  "kyc_pre_verified": false,
  "metadata": {}
}

No client_secret — it is returned only on create.

Errors

All errors use the unified envelope and carry an X-Request-Id response header. Branch on code/type/statusCode, not on the free-form message.

{
  "type": "not_found",
  "code": "not_found",
  "message": "Example not-found error using fake data.",
  "request_id": "req_test_000000000123",
  "doc_url": null,
  "statusCode": 404
}
StatustypeWhen it happens
401unauthorizedMissing or invalid secret key.
404not_foundThe session does not exist or is owned by another partner. Cross-tenant ids are 404, never 403.
429rate_limitedRequest throttled. Back off and retry.
5xxserver_errorTransient server or upstream failure. Retry with bounded backoff.

Public boundary

This reference covers partner-scoped endpoint behavior, authentication, idempotency, webhook verification, and support-safe records. Internal operations, settlement venues, fiat-rail providers, KYC vendors, administrative routes, and unsupported availability claims are outside the public API contract.

On this page