broRacks API Reference
Integrate Mobile Money collections, payouts, commercial bank transfers, and automated webhooks into your application using our developer-friendly REST API.
https://api.broracks.onlineGetting Started
Welcome to the broRacks API! All request and response bodies use formatted JSON. All monetary amounts are represented in integer Ugandan Shillings (UGX).
Log into your broRacks Merchant Dashboard, navigate to Developers > API Keys, and copy your public_key (pk_test_* or pk_live_*) and secret_key (sk_test_* or sk_live_*).
Call POST /v1/auth/token with your public and secret keys to obtain a Bearer session token (5-minute TTL). Use this Bearer token in the Authorization header for all subsequent API requests.
Authentication
broRacks uses short-lived Bearer session tokens for all API endpoints. Exchange your API keys for a session token, and include it in the Authorization header as Bearer YOUR_SESSION_TOKEN.
| Parameter | Type | Required | Description |
|---|---|---|---|
| public_key | string | required | Your public key (pk_test_* or pk_live_*) |
| secret_key | string | required | Your secret key (sk_test_* or sk_live_*) |
# Step 1: Exchange your API keys for a session token
curl -X POST https://api.broracks.online/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"public_key": "pk_test_your_public_key",
"secret_key": "sk_test_your_secret_key"
}'
# Response: { "data": { "token": "eyJhbG..." } }
# Step 2: Use the session token for API requests
curl -X GET https://api.broracks.online/v1/merchant/me \
-H "Authorization: Bearer eyJhbG..."Call this endpoint before your session token expires (or within the 30-minute grace window) to obtain a fresh token without re-sending your secret key.
curl -X POST https://api.broracks.online/v1/auth/token/refresh \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Immediately revokes the Bearer session token so it can no longer be used.
curl -X POST https://api.broracks.online/v1/auth/token/revoke \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Merchant Profile
Retrieve profile details, account status, and real-time wallet balances for the authenticated merchant.
curl -X GET https://api.broracks.online/v1/merchant/me \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"status": "success",
"data": {
"id": 1,
"email": "merchant@example.com",
"business_name": "Acme Retail Ltd",
"phone": "+256771234567",
"status": "ACTIVE",
"commission_rate": 8.0,
"wallet": {
"balance_ugx": 500000,
"reserved_ugx": 20000,
"available_ugx": 480000
}
}
}Collections
Collect money from a customer's mobile money account. The customer receives a prompt on their phone to confirm the payment with their PIN. Include the Idempotency-Key header to prevent duplicate charges.
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone_number | string | required | E.164 format (e.g. +256771234567) |
| amount | integer | required | Amount in UGX (500–7,000,000) |
| payer_name | string | optional | Name of payer (Auto-looked up if omitted) |
| description | string | optional | Payment description / order reference |
| success_callback | string | optional | Per-transaction custom success webhook URL |
| failure_callback | string | optional | Per-transaction custom failure webhook URL |
curl -X POST https://api.broracks.online/v1/collections/initiate \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-request-id-001" \
-d '{
"payer_name": "John Doe",
"phone_number": "+256771234567",
"amount": 5000,
"description": "Payment for Order #1234"
}'Lookup collection details by merchant reference or broracks_ref (BRR-*).
curl -X GET https://api.broracks.online/v1/collections/BRR-a1b2c3d4 \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Mobile Money Payouts
Withdraw money from your available balance directly to your registered Mobile Money phone number.
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | integer | required | Amount in UGX (500–7,000,000) |
| description | string | required | Reason for withdrawal |
| recipient_name | string | optional | Account holder name for optional validation |
| enforce_name_match | boolean | optional | If true, verifies recipient_name against phone owner |
curl -X POST https://api.broracks.online/v1/disbursements/initiate \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-payout-001" \
-d '{
"amount": 10000,
"description": "Weekly earnings withdrawal"
}'curl -X GET https://api.broracks.online/v1/disbursements/BRR-d5e6f7g8 \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Bank Transfers
Transfer funds directly from your broRacks wallet balance to a commercial bank account in Uganda.
Returns supported bank IDs and names (e.g. Equity Bank, Centenary Bank, Stanbic, ABSA).
curl -X GET https://api.broracks.online/v1/disbursements/banks \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
| Parameter | Type | Required | Description |
|---|---|---|---|
| bank_id | integer | required | Bank ID from /v1/disbursements/banks |
| account_name | string | required | Account title as registered with the bank |
| account_number | string | required | Bank account number |
| amount | integer | required | Minimum UGX 50,000 |
| reason | string | required | Transfer description / invoice reference |
curl -X POST https://api.broracks.online/v1/disbursements/bank \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: bank-payout-001" \
-d '{
"bank_id": 1,
"account_name": "John Doe Trading",
"account_number": "1234567890",
"amount": 150000,
"reason": "Supplier invoice payment"
}'Batch Payouts
Process up to 100 Mobile Money disbursements in a single API call.
| Parameter | Type | Required | Description |
|---|---|---|---|
| items | array | required | Array of up to 100 payout item objects (amount, description) |
curl -X POST https://api.broracks.online/v1/disbursements/batch \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "amount": 5000, "description": "Payout 1" },
{ "amount": 15000, "description": "Payout 2" }
]
}'Payment Links
Create shareable payment links to collect money from customers via a hosted checkout page.
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | required | Title of the product or service |
| amount | integer | required | Amount in UGX |
| description | string | optional | Product description |
| redirect_url | string | optional | URL to redirect customer after successful payment |
curl -X POST https://api.broracks.online/v1/payment-links \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "VIP Event Ticket",
"amount": 25000,
"description": "Entry ticket for annual summit",
"redirect_url": "https://yourwebsite.com/success"
}'curl -X GET https://api.broracks.online/v1/payment-links \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
curl -X DELETE https://api.broracks.online/v1/payment-links/12 \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Transactions & Status Sync
Query complete transaction history, retrieve single transaction details, or sync status in real time with the payment gateway.
| Parameter | Type | Description |
|---|---|---|
| type | string | Filter by type: COLLECTION or DISBURSEMENT |
| status | string | Filter by status: PENDING, SUCCEEDED, FAILED, EXPIRED |
| limit | integer | Number of items to return (Default: 20, Max: 100) |
| starting_after | string | Cursor pagination object reference |
curl -X GET "https://api.broracks.online/v1/transactions?type=COLLECTION&status=SUCCEEDED&limit=10" \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
curl -X GET https://api.broracks.online/v1/transactions/BRR-tx123456 \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Query the upstream gateway directly to check if a pending transaction has settled, updating the ledger automatically.
curl -X POST https://api.broracks.online/v1/transactions/br_tx_12345/check-status \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Phone Verification
Verify the registered account holder name for an MTN or Airtel Mobile Money phone number before initiating payouts.
curl -X GET https://api.broracks.online/v1/verify/phone/+256771234567 \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Webhooks & Delivery Logs
Receive real-time HTTP POST notifications when transactions succeed, fail, or expire. Webhooks are HMAC-signed to ensure authentic delivery.
curl -X POST https://api.broracks.online/v1/webhooks/configure \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourwebsite.com/api/webhooks/broracks",
"events": ["collection.success", "disbursement.success"]
}'curl -X GET https://api.broracks.online/v1/webhooks \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
curl -X POST https://api.broracks.online/v1/webhooks/rotate-secret \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
curl -X GET https://api.broracks.online/v1/webhooks/deliveries \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Signature Verification
Verify the HMAC-SHA256 signature in the X-BroRacks-Signature header to ensure webhooks originate from broRacks.
X-BroRacks-Signature: Contains sha256=HEX_SIGNATUREX-BroRacks-Timestamp: Contains Unix timestamp (seconds)X-BroRacks-Event: Event name (e.g. collection.success)
Error Handling
Errors use RFC 7807 problem details format with standard HTTP status codes.
{
"type": "https://docs.broracks.online/errors/insufficient_balance",
"title": "Insufficient Balance",
"status": 400,
"detail": "Insufficient available wallet balance for this operation.",
"instance": "/v1/disbursements/initiate"
}Rate Limits
Standard rate limit is 30 requests per minute per IP address. Exceeding limits returns HTTP 429 Too Many Requests with a Retry-After header.
Environments
Use pk_test_* / sk_test_* for Sandbox mode and pk_live_* / sk_live_* for Live payments.