Skip to content

POST /orders/

  • Method: POST
  • URL: https://pos.b4bit.com/api/v1/orders/
  • Content-Type: application/json (recommended) or multipart/form-data.
  • Authentication: X-Device-Id header.

This contract is available in production. See the 2026-11-04 changelog for the change and required integration updates.

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.

FieldTypeDescription
expected_output_amountnumberAmount to charge, in the fiat currency.
FieldTypeDefaultDescription
input_currencystring—Crypto symbol (from GET /currencies). If omitted, the customer picks on the gateway.
fiatenumMXNMXN (default), USD, EUR, GBP, ARS, BRL, COP, CLP and 22 more.
languagestringESGateway language.
notesstring (≤512)—Product/service description.
referencestring (1-256)—Your internal ID. Key for idempotency — see idempotency.
internal_datastring (1-1024)—Free-form merchant metadata.
FieldTypeDescription
merchant_urlokURIRedirect after payment completed.
merchant_urlkoURIRedirect after payment not completed / expired.
merchant_url_standbyURIRedirect while awaiting confirmation.

See kyc-fields for the full detail.

  • full_name, email_client, phone_number, nif.
  • home_address, address_number, address_additional, city, province, zip_code, country.
Ventana de terminal
curl -X POST \
-H "X-Device-Id: $B4BIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expected_output_amount": 2500.00,
"fiat": "MXN",
"input_currency": "USDC_POLYGON_NXTB",
"full_name": "María López",
"country": "MX",
"notes": "Pedido ORD-123",
"reference": "ORD-123",
"merchant_urlok": "https://tu-sitio.com/pago/ok",
"merchant_urlko": "https://tu-sitio.com/pago/error"
}' \
https://pos.b4bit.com/api/v1/orders/

Historic alternative. Useful if your stack has poor JSON support or if you prefer to send all fields as string uniformly.

Ventana de terminal
curl -X POST \
-H "X-Device-Id: $B4BIT_API_KEY" \
-F "expected_output_amount=2500.00" \
-F "fiat=MXN" \
-F "input_currency=USDC_POLYGON_NXTB" \
-F "full_name=María López" \
-F "country=MX" \
-F "notes=Pedido ORD-123" \
-F "reference=ORD-123" \
-F "merchant_urlok=https://tu-sitio.com/pago/ok" \
-F "merchant_urlko=https://tu-sitio.com/pago/error" \
https://pos.b4bit.com/api/v1/orders/

With cryptocurrency and complete payer details

Section titled “With cryptocurrency and complete payer details”
{
"identifier": "1040095a-737d-41a2-a2e1-d031d19ec8cd",
"reference": "ORD-123",
"payment_uri": "ethereum:0x...?amount=...",
"web_url": "https://pay.b4bit.com/...",
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0b1f6",
"tag_memo": null,
"input_currency": "USDC_POLYGON_NXTB",
"expected_input_amount": 100.00,
"rate": 1.0,
"notes": "Pedido ORD-123",
"fiat": "MXN",
"language": "ES"
}

When name or country of residence is missing

Section titled “When name or country of residence is missing”

The response retains the other payment fields. In this example input_currency was sent, but address, payment_uri, and tag_memo are absent:

{
"identifier": "1040095a-737d-41a2-a2e1-d031d19ec8cd",
"reference": "ORD-123",
"web_url": "https://pay.b4bit.com/...",
"input_currency": "USDC_POLYGON_NXTB",
"expected_input_amount": 100.0,
"rate": 1.0,
"notes": "Pedido ORD-123",
"fiat": "MXN",
"language": "ES"
}

This pseudocode uses the returned URI for a direct QR and the returned link for the gateway:

if (order.payment_uri) {
renderCryptoPayment({
qrValue: order.payment_uri,
address: order.address,
amount: order.expected_input_amount,
tagMemo: order.tag_memo,
});
} else {
renderGatewayLink(order.web_url);
}
  • 403 — Missing or invalid X-Device-Id.
  • 404 — Invalid currency, amount below the minimum, missing URLs, or missing DNI image. See errors.
  • 429 — Rate limit.
  • 500 — Internal error.