For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom Integration

POST your payment destinations to Branta from your own code — SDK or raw HTTP.

If none of BTCPay, Take My Sats, or Zaprite fit, post destinations yourself. Use an SDK, or POST the HTTP API.

Prerequisites

  • You've completed Receive setup — account, approved platform, and an API key.

  • You know which environment you're hitting (staging while testing, production for live traffic).

  • Hold the API key server-side. Never put it in a browser bundle or mobile binary.

Use the SDK

Install from the SDK page.

Every destination is encrypted before it is posted. Store secret with the invoice. Put branta_id and branta_secret on the invoice QR. Link the sender to verifyUrl.

ttl is seconds until Branta forgets the destination (30 second minimum, 1 year maximum; server default 7 days). metadata is stored as a string — Branta does not parse it.

Raw HTTP

If you are not using an SDK, POST /v2/payments. Encrypt each destination before you send it — a send lookup of a bare address is unknown. The algorithm is on Receive. Full schema is on that page too.

curl -X POST https://guardrail.branta.pro/v2/payments \
  -H "Authorization: Bearer $BRANTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "destinations": [
      {
        "value": "<ciphertext>",
        "type": "bitcoin_address",
        "primary": true,
        "zk": true
      }
    ],
    "ttl": 3600,
    "metadata": "order-12345"
  }'

Invoice QR

On-chain Bitcoin needs branta_id and branta_secret on the URI the sender scans:

Param
Source
Description

branta_id

encrypted destination value returned by the POST

URL-encoded ciphertext

branta_secret

secret returned by addPayment

decryption key — only in the QR

The address stays in the URI so the sender knows where to pay. Wallets that do not recognise these params ignore them (BIP-21).

bolt11, Ark, and silent payments use their normal URI. No extra params.

verifyUrl

verifyUrl is the public Branta verify page for this payment. Link it from the invoice.

Last updated