Skip to content

API Integration

B4bit Pay exposes a small, focused REST API (5 endpoints) that covers the entire lifecycle of a crypto payment.

  • Base URL: https://pos.b4bit.com/api/v1
  • Authentication: X-Device-Id header (the device API key)
  • Notifications: HMAC-SHA256 signed webhook on every state change
  • Official Redoc: https://pos.b4bit.com/redoc

See also the API Reference for endpoint-by-endpoint details.

B4bit Pay supports two different flows. Choose the one that best fits your use case.

You redirect the customer to the hosted B4bit Pay gateway. It is the simplest and fastest path to integrate.

Variant with input_currency:

  1. The merchant calls GET /currencies to learn the available options.
  2. The merchant calls POST /orders/ with expected_output_amount, input_currency, redirect URLs and description.
  3. B4bit Pay responds with web_url; your server redirects the customer there.

Variant without input_currency:

  1. The merchant only calls POST /orders/ with amount and URLs.
  2. The customer chooses the currency directly on the B4bit Pay gateway.
  3. B4bit Pay returns web_url; your server redirects.

You display the payment data directly in your UI (typical in physical POS terminals).

  1. The merchant calls POST /orders/ with expected_output_amount + input_currency.
  2. B4bit Pay responds with payment_uri, address, tag_memo, expected_input_amount, rate.
  3. The merchant builds the QR code or displays the information on their screen.
  4. The customer pays from their wallet.
  5. B4bit Pay notifies the state change via webhook.
Ventana de terminal
curl -H "X-Device-Id: $B4BIT_API_KEY" \
https://pos.b4bit.com/api/v1/currencies

The 11 B4bit Pay payment states can be summarized into 4 typical merchant states:

B4bit Pay stateMerchant state
NR / PE / AC with safe=falsePending
CO / AC with safe=true / CMProcessing (or Paid)
CA / EXCancelled
FA / OC / IAFailed
DEDeleted

The safe field indicates whether the payment already has one blockchain confirmation and it is safe to release the product/service.