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.
FieldTypeDescription
expected_output_amountnumberAmount to charge, in the fiat currency.
FieldTypeDefaultDescription
input_currencystringCrypto 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",
"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 "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/
{
"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"
}

Only returns the fields identifier, reference, web_url, notes, fiat, language. Crypto-dependent fields (payment_uri, address, tag_memo, expected_input_amount, rate) are generated when the customer picks the currency on the gateway.

  • 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.