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
Your profile, wallet and lifetime totals. balance_ugx is what you can send right now; reserved_ugx is set aside for payouts that are still on their way. Mobile money collections cost a flat 3%.
curl -X GET https://api.broracks.online/v1/merchant/me \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"status": "success",
"data": {
"id": 1,
"email": "[email protected]",
"business_name": "Acme Retail Ltd",
"phone": "+256771234567",
"status": "ACTIVE",
"commission_rate": 3.0,
"wallet": {
"balance_ugx": 480000,
"reserved_ugx": 20000,
"available_ugx": 480000,
"total_ugx": 500000
},
"stats": {
"collected_ugx": 1250000,
"collections": 42,
"disbursed_ugx": 700000,
"disbursements": 9
}
}
}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 | Extra https URL that gets this payment's success event. Signed with your webhook secret, like webhooks |
| failure_callback | string | optional | Same, for the failure event |
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"
Card Payments
Accept Visa and Mastercard through a hosted checkout. Create the payment, then send the customer's browser to the returned checkout_url (or share it as a payment link). The customer enters their card details β and any 3-D Secure one-time password β on the provider's secure page, never on your site or ours.
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | integer | required | Amount in UGX (500β7,000,000) |
| customer_name | string | required | Cardholder name |
| customer_email | string | required | Cardholder email |
| description | string | optional | What the customer is paying for |
| redirect_url | string | optional | Where the customer's browser returns after a successful payment. Failed payments stay on the provider's result page β always rely on webhooks for the final status, not on the redirect. |
curl -X POST https://api.broracks.online/v1/collections/card \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-4521" \
-d '{
"amount": 10000,
"customer_name": "Jane Nakato",
"customer_email": "[email protected]",
"description": "Order #4521",
"redirect_url": "https://yourshop.com/orders/4521/paid"
}'{
"status": "success",
"data": {
"reference": "BRR-a1b2c3d4-...",
"broracks_ref": "br_tx_xxxxxxxx",
"channel": "CARD",
"amount": 10000,
"fee": 550,
"net_amount": 9450,
"status": "PENDING",
"checkout_url": "https://api.broracks.online/pay/BRR-a1b2c3d4-...",
"customer_name": "Jane Nakato",
"customer_email": "[email protected]",
"redirect_url": "https://yourshop.com/orders/4521/paid",
"environment": "live",
"created_at": "2026-10-18T10:00:00+00:00"
},
"message": "Card checkout created. Redirect the customer to checkout_url."
}The outcome is delivered with the same collection.success / collection.failed webhooks as mobile money, with "channel": "CARD" in the payload. If a checkout can't be created you get a 502/504 error with the broracks_ref; retry with a new Idempotency-Key.
Disbursements
Send money from your wallet to any Ugandan mobile money number or bank account. Payouts to anywhere other than your registered phone are confirmed with your 4-digit withdrawal PIN. Money is never held: your balance is available to send the moment it lands.
destination still go to your registered phone and need no PIN.| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | integer | required | Amount the recipient gets, in UGX. Mobile money 500β7,000,000; bank 2,500β50,000,000. The fee is added on top. |
| description | string | optional | Reason for the payment (default βWithdrawalβ) |
| destination | object | optional | {"type": "mobile_money", "phone_number"} or {"type": "bank", "bank_id", "account_number", "account_name"}. Leave out to send to your registered phone. |
| pin | string | with destination | Your 4-digit withdrawal PIN. Required for any destination other than your registered phone, and for every dashboard payout. |
curl -X POST https://api.broracks.online/v1/disbursements/initiate \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: payout-001" \
-d '{
"amount": 50000,
"description": "Supplier payment",
"destination": { "type": "mobile_money", "phone_number": "0772123456" },
"pin": "YOUR_PIN"
}'
# Bank account instead (get bank_id from GET /v1/disbursements/banks):
# "destination": { "type": "bank", "bank_id": "12",
# "account_number": "9030012345678", "account_name": "Nakato Jane" }
# No "destination" (and no PIN) = send to your registered phone number{
"status": "success",
"data": {
"reference": "BRR-d4e5f6g7-...",
"broracks_ref": "BRR-yyyyyyyy",
"channel": "MOBILE_MONEY",
"amount": 50000,
"fee": 1800,
"total_deducted": 51800,
"destination": {
"type": "mobile_money",
"phone_number": "256772123456",
"recipient_name": "NAKATO JANE"
},
"destination_phone": "256772123456",
"status": "PENDING",
"environment": "live",
"created_at": "2026-10-19T10:00:00+00:00"
},
"message": "Sending UGX 50,000 to NAKATO JANE (256772123456)."
}| Code | HTTP | Meaning | |
|---|---|---|---|
| PIN_REQUIRED | 403 | β | A destination was given (or the call came from the dashboard) without a PIN |
| INVALID_PIN | 403 | β | Wrong PIN. attempts_remaining says how many tries are left |
| PIN_LOCKED | 423 | β | 3 wrong PINs pause payouts for 5 hours, then 10, then 15 (only a correct PIN resets this). locked_until says when |
| PIN_LOCKED_SUPPORT | 423 | β | One more wrong PIN after the 15-hour lock: payouts stay locked until broRacks support resets the PIN |
| PIN_NOT_SET | 428 | β | Create a PIN in Dashboard β Settings first |
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | integer | required | Amount the recipient should get |
| type | string | optional | mobile_money (default) or bank |
{
"status": "success",
"data": {
"type": "mobile_money", "amount": 50000, "fee": 1800, "total": 51800,
"balance": 240000, "sufficient_balance": true,
"within_limits": true, "min_amount": 500, "max_amount": 7000000
}
}{
"status": "success",
"data": [
{ "id": "7", "name": "Centenary Bank" },
{ "id": "12", "name": "Stanbic Bank Uganda" }
]
}{
"status": "success",
"data": {
"own_phone": "256700000000",
"recipients": [
{ "type": "mobile_money", "phone_number": "256772123456", "recipient_name": "NAKATO JANE",
"last_amount": 50000, "last_sent_at": "2026-10-18T09:12:00+00:00" }
]
}
}Fetch a payout by your reference or its broracks_ref.
curl -X GET https://api.broracks.online/v1/disbursements/BRR-d5e6f7g8 \ -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Bank Transfers
A shortcut for /v1/disbursements/initiate with a bank destination. It runs through exactly the same checks, fees and PIN rules. Get bank_id from GET /v1/disbursements/banks.
| Parameter | Type | Required | Description |
|---|---|---|---|
| bank_id | string | required | Bank ID from /v1/disbursements/banks |
| account_name | string | required | Account holder name as registered with the bank |
| account_number | string | required | Bank account number |
| amount | integer | required | UGX 2,500β50,000,000. The fee is added on top |
| reason | string | optional | Transfer description or invoice reference |
| pin | string | required | Your 4-digit withdrawal PIN |
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": "12",
"account_name": "John Doe Trading",
"account_number": "1234567890",
"amount": 150000,
"reason": "Supplier invoice payment",
"pin": "YOUR_PIN"
}'Batch Payouts
Send up to 100 payouts in one call. Each item takes the same fields as /v1/disbursements/initiate (without its own pin); one pin covers the whole batch. The batch is all or nothing: if your balance can't cover every item plus fees, nothing is sent.
| Parameter | Type | Required | Description |
|---|---|---|---|
| items | array | required | 1β100 payouts, each with amount, description and an optional destination |
| pin | string | with destinations | Your 4-digit withdrawal PIN, once for the whole batch |
curl -X POST https://api.broracks.online/v1/disbursements/batch \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: salaries-2026-10" \
-d '{
"pin": "YOUR_PIN",
"items": [
{ "amount": 5000, "description": "Payout 1",
"destination": { "type": "mobile_money", "phone_number": "0772123456" } },
{ "amount": 15000, "description": "Payout 2",
"destination": { "type": "mobile_money", "phone_number": "0702123456" } }
]
}'Payment Links
A payment link is a fixed-price page at /pay/{slug} you can share anywhere. The customer enters their mobile money number, approves the prompt on their phone and gets a receipt. Links made with a test key collect test money. Payments show up in your transactions with "source": "Payment Link" and fire the usual webhooks.
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | required | Title of the product or service |
| amount | integer | required | UGX 500β7,000,000 |
| 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"
}| HTTP | Error Code | Meaning |
|---|---|---|
| 400 | INSUFFICIENT_BALANCE | Not enough funds in wallet |
| 401 | INVALID_CREDENTIALS | Wrong email/password or invalid API key |
| 401 | TOKEN_EXPIRED | JWT access token has expired |
| 403 | MERCHANT_SUSPENDED | Merchant account is suspended |
| 422 | INVALID_AMOUNT | Amount outside 500β7,000,000 UGX range |
| 422 | INVALID_PHONE | Phone number is not in E.164 format |
| 422 | IDEMPOTENCY_KEY_REUSED | This Idempotency-Key was already used with a different request body |
| 422 | INVALID_EMAIL / INVALID_REDIRECT_URL | Card payment fields are malformed |
| 400 | IDEMPOTENCY_KEY_EXPIRED | Idempotency keys are kept for 24 hours. Use a new key |
| 400 | INVALID_PAGINATION / INVALID_CURSOR | Use either starting_after or ending_before, with a reference from your own transactions |
| 422 | INVALID_CALLBACK_URL | success_callback / failure_callback must be public https URLs |
| 422 | NAME_MISMATCH / NAME_UNVERIFIED | With enforce_name_match, the registered name didn't match recipient_name, or couldn't be looked up |
| 403 / 423 / 428 | PIN_REQUIRED, INVALID_PIN, PIN_LOCKED, PIN_LOCKED_SUPPORT, PIN_NOT_SET | See Payouts β PIN errors |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests β slow down |
| 502 | GATEWAY_ERROR | The payment provider rejected the request. The transaction is recorded as FAILED |
| 504 | GATEWAY_TIMEOUT | Card checkout could not be created in time. (A mobile money collection whose provider response is delayed returns 202 PENDING instead β wait for the webhook.) |
Pricing & Fees
Flat rates for every merchant at any volume. Collection fees come out of each successful payment before it reaches your wallet; failed and expired payments cost nothing. Payout fees are fixed per payout and added on top of the amount sent, so the recipient always gets the full amount. Every collection response includes fee and net_amount, and GET /v1/disbursements/quotereturns the exact payout fee before you send.
| Method | Fee |
|---|---|
| Mobile money (MTN, Airtel) Β· UGX 500β7,000,000 | 3% of the amount |
| Card (Visa, Mastercard) | 5% of the amount |
| Amount (UGX) | Fee (UGX) |
|---|---|
| 500 β 45,000 | 1,200 |
| 45,001 β 200,000 | 1,800 |
| 200,001 β 400,000 | 2,500 |
| 400,001 β 1,000,000 | 4,000 |
| 1,000,001 β 2,000,000 | 10,000 |
| 2,000,001 β 5,000,000 | 15,000 |
| 5,000,001 β 7,000,000 | 18,000 |
| Amount (UGX) | Fee (UGX) |
|---|---|
| 2,500 β 250,000 | 5,000 |
| 250,001 β 500,000 | 6,000 |
| 500,001 β 1,000,000 | 9,000 |
| 1,000,001 β 2,000,000 | 13,500 |
| 2,000,001 β 50,000,000 | 16,500 |
Sandbox (sk_test_*) payments use the same fee rules against your test wallet, so you can check your accounting before going live. No setup, monthly or API fees.
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.
| Environment | Key Prefix | Description |
|---|---|---|
| Test (Sandbox) | sk_test_ | No real money moves. Test keys use a separate sandbox wallet (starts with UGX 1,000,000 of play money) that can never be withdrawn as real money. |
| Live | sk_live_ | Real mobile money transactions. Requires domain whitelisting. |
With a sk_test_ session token, drive any of your pending test transactions (mobile money or card) to a final state. The matching webhook is delivered just like in live.
curl -X POST https://api.broracks.online/v1/sandbox/transactions/BRR-a1b2c3d4-.../simulate \
-H "Authorization: Bearer YOUR_TEST_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "SUCCEEDED"}'Origin header) are always allowed.