Developer Documentation

Everything you need to integrate BalancYZ into your application workflow.

Tokens API Reference

Welcome to the BalancYZ API documentation. Our platform provides a comprehensive suite of tools for balance management, multi-gateway webhooks, and secure client authentication.

Base API URL

https://api.balancyz.com/v1

Authentication

API Key Auth

Standard method for backend-to-backend communication. Use your platform secret key.

X-API-Key:
bz_live_••••••••••••

Bearer Token

Commonly used with our SDKs and mobile integrations via Authorization headers.

Authorization:
Bearer bz_live_••••••••

Health Check

No Auth Required
GET /health

Verifies the operational status of the BalancYZ core infrastructure.

Response Sample
{ "status": "ok", "version": "1.4.2" }

Webhook Verification

Security is paramount. Every webhook sent to your endpoint includes a cryptographic signature. We strongly recommend verifying these signatures to ensure the traffic originates from our servers.

// Node.js Example
const crypto = require('crypto');
const signature = req.headers['x-balancyz-signature'];
const hmac = crypto.createHmac('sha256', YOUR_SECRET);

Integrated Flow

1. Create Client

Initialize a new user in the BalancYZ ledger to start tracking their balance.

curl -X POST /v1/clients \
-d '{"id": "user_42"}'

2. Topup via Webhook

We'll automatically add balance when a successful payment is detected.

WEBHOOK: checkout.session.completed
AMOUNT: +500 CC