Integration modes
Customer details and payment access
Section titled “Customer details and payment access”full_name (full name, up to 48 characters) and country (country of residence, a two-letter ISO 3166-1 code such as MX) are optional when creating an order, even when you send input_currency.
If either detail is missing, the API responds successfully with web_url and the remaining payment information, but omits address, payment_uri, and tag_memo. Missing payer details do not cause HTTP 400. The integrator must display the gateway link, or a QR encoding that link, so the customer can complete their details and continue payment.
With both valid payer details and a cryptocurrency, the API can provide blockchain data for direct payment. Choose the UI based on payment_uri, not on the presence of currency, amount, status, or expiry. Do not construct a blockchain address or crypto QR from other fields.
Redirect Gateway (online only)
Section titled “Redirect Gateway (online only)”The merchant redirects the customer to B4bit Pay’s hosted gateway. This is the simplest flow to integrate: just a single backend call and a redirect.
Variant A — with input_currency
Section titled “Variant A — with input_currency”The merchant preselects the currency before redirecting. If the name or residence is missing, the customer completes those details at the gateway before accessing blockchain payment.
1. GET /currencies → fetch available symbols2. POST /orders/ → send expected_output_amount + input_currency + full_name + country + URLs3. returned web_url → redirect the customer4. webhook arrives on status changecurl -X POST \-H "X-Device-Id: $B4BIT_API_KEY" \-H "Content-Type: application/json" \-d '{ "expected_output_amount": 2500.0, "fiat": "MXN", "input_currency": "USDC_POLYGON_NXTB", "full_name": "María López", "country": "MX", "merchant_urlok": "https://tu-sitio.com/pago/ok", "merchant_urlko": "https://tu-sitio.com/pago/error", "notes": "Pedido ORD-123", "reference": "ORD-123"}' \https://pos.b4bit.com/api/v1/orders/Variant B — without input_currency
Section titled “Variant B — without input_currency”The customer picks the currency on the gateway. Useful when you don’t know your customer’s preferences.
1. POST /orders/ → only expected_output_amount + URLs2. returned web_url → redirect3. customer picks currency on the B4bit Pay gatewayAPI Gateway (online and offline)
Section titled “API Gateway (online and offline)”With complete payer details, the merchant receives blockchain payment data and renders it in its own UI. Useful for physical POS, native mobile apps, or deep integrations.
1. POST /orders/ → input_currency + full_name + country for direct payment2. full response → payment_uri, address, tag_memo, expected_input_amount, rate3. merchant renders QR / displays address on its screen4. customer pays from their wallet5. webhook delivers status changesKey response fields
Section titled “Key response fields”payment_uri— URI likebitcoin:<address>?amount=X, ready to encode in a QR.address— destination address on the blockchain.tag_memo— required for XRP / XLM / ALGO. Display it alongside the address.expected_input_amount— exact amount of crypto to pay.rate— price of the crypto in USDC at that moment (locked for the order’s validity window).
Bitcoin Lightning (BTCL)
Section titled “Bitcoin Lightning (BTCL)”Lightning Network does not use addresses. The POST /orders/ response with input_currency=BTCL and complete payer details returns a BOLT11 invoice in the payment_uri field.
The customer pays it from their Lightning wallet (Wallet of Satoshi, Phoenix, Zeus, etc.). Confirmation is practically instant.
Which to choose
Section titled “Which to choose”| Use case | Recommended mode |
|---|---|
| Standard web e-commerce | Redirect Gateway (Variant A or B) |
| In-site checkout with fully custom UX | API Gateway |
| Physical point of sale (POS, register) | API Gateway |
| Native mobile app | API Gateway |
| Shareable payment link | Redirect Gateway (Variant B) |
See also the payment modes available from the dashboard without API.