Custom Integration
POST your payment destinations to Branta from your own code — SDK or raw HTTP.
Prerequisites
What "integrating" means
Option 1: Use the SDK (recommended)
import { BrantaServerBaseUrl } from "@branta-ops/branta";
import { BrantaService } from "@branta-ops/branta/v2";
import { DestinationType } from "@branta-ops/branta";
import { PrivacyMode } from "@branta-ops/branta";
const service = new BrantaService({
baseUrl: BrantaServerBaseUrl.Production,
defaultApiKey: process.env.BRANTA_API_KEY!,
privacy: PrivacyMode.Loose,
});
// Called whenever your platform issues a destination to a sender.
async function publishDestination(address: string) {
const { payment, secret, verifyUrl } = await service.addPayment({
description: "Invoice #12345",
destinations: [
{
value: address,
type: DestinationType.BitcoinAddress,
isPrimary: true,
isZk: true, // set false to publish in plain
},
],
ttl: 3600, // optional — seconds until Branta forgets this destination
metadata: "order-12345", // optional — your own correlation id
});
// For ZK: persist `secret` alongside your order — you need it to build
// the `branta_secret` query param when rendering the payment QR / link.
// `verifyUrl` is the public Branta verify page for this payment.
return { payment, secret, verifyUrl };
}Option 2: Raw HTTP
Surfacing Branta in your UI
QR code / payment URI (ZK on-chain)
Param
Source
Description
Testing
Last updated