Two-factor authentication

Bit2Me Legal and Compliance must review 2FA copy before partner go-live. This page is operational, not legal advice.

StatusMeaning
420Invalid TOTP code
428Step-up required: classic TOTP headers, or the two-step verification ticket flow

The REST reference shows a 2FA badge on operations that declare either classic TOTP headers (x-totp) or two-step verification headers (x-two-step-verification-*). Both link here.

Classic TOTP headers

On withdrawals and other protected REST calls, send headers x-totp (6 digits) and x-totp-type. For subaccounts, type is always gauth (not SMS or email). A Withdraw-scoped API key is documented as bypassing two-factor authentication — do not use that scope if you need TOTP on every send.

Partners who operate subaccounts enroll Google Authenticator in the backend and generate TOTP from the returned secret. Store that seed with the same controls as an API secret. End-user UX for showing a challenge is your product decision; the gateway only validates x-totp.

Two-step verification (ticket + proof token)

Some operations (for example Social Pay v3) do not take x-totp on the business call. They use a bound verification:

  1. Call the operation without verification headers. Expect 428 with data.ticket and data.operationId.
  2. Complete verification with that ticket: POST /v1/auth/two-step-verification/initiate, then POST /v1/auth/two-step-verification/verify. To resend the code or change channel, call POST /v1/auth/two-step-verification/reissue.
  3. Retry the same business request (same body / same identifying inputs), sending:
    • x-two-step-verification-proof-token — proofToken from verify (opaque; do not parse or log)
    • x-two-step-verification-operation-id — the data.operationId from step 1

A proof token is typically single-use and bound to that operation’s inputs. Those /v1/auth/two-step-verification/* routes are part of the gateway auth surface; follow the operation description when the published reference does not list them as separate pages.

Enroll a subaccount

Subaccount enrollment uses a JSON body, not those headers.

POST /v1/account/subaccount/sfa

Required: { "subaccountUserId": "<uuid>" }.

200 includes secret (required) and may include algorithm (example SHA1), digits (6), period (30), qrCode (data-URL PNG).

PUT /v1/account/subaccount/sfa

Required: { "subaccountUserId": "<uuid>", "totp": "<6-digit code from that secret>" }.

200 is a success payload (SuccessResponse).

Enroll the parent account

The parent account proves its current 2FA method before it switches to Google Authenticator.

GET /v3/signin/sfa returns sfaType and sends a valid code through that method.

POST /v1/account/settings/sfa with headers x-totp (the code you received) and x-totp-type (the sfaType from the previous step). The response returns the secret (and a QR image) to configure Google Authenticator.

PUT /v1/account/settings/sfa with a code generated from that secret as totp in the JSON body.

Fresh codes only. Clock skew on the authenticator causes 420.

On this page