broRacks API Reference

Integrate Mobile Money collections, payouts, commercial bank transfers, and automated webhooks into your application using our developer-friendly REST API.

Base URL
https://api.broracks.online

Getting Started

Welcome to the broRacks API! All request and response bodies use formatted JSON. All monetary amounts are represented in integer Ugandan Shillings (UGX).

Step 1: Obtain API Keys

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_*).

Step 2: Exchange Keys for a Session Token

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.

POST/v1/auth/tokenExchange API keys for a session token
Request Body
ParameterTypeRequiredDescription
public_keystringrequiredYour public key (pk_test_* or pk_live_*)
secret_keystringrequiredYour 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..."
POST/v1/auth/token/refreshRefresh an active or recently-expired session token

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"
POST/v1/auth/token/revokeRevoke an active API 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.

GET/v1/merchant/meFetch profile and wallet balances
curl -X GET https://api.broracks.online/v1/merchant/me \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
Response (200 OK)
{
  "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.

POST/v1/collections/initiateInitiate a mobile money collection
Request Body
ParameterTypeRequiredDescription
phone_numberstringrequiredE.164 format (e.g. +256771234567)
amountintegerrequiredAmount in UGX (500–7,000,000)
payer_namestringoptionalName of payer (Auto-looked up if omitted)
descriptionstringoptionalPayment description / order reference
success_callbackstringoptionalPer-transaction custom success webhook URL
failure_callbackstringoptionalPer-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"
  }'
GET/v1/collections/{reference}Fetch collection details by reference

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.

POST/v1/disbursements/initiateRequest a Mobile Money withdrawal
Request Body
ParameterTypeRequiredDescription
amountintegerrequiredAmount in UGX (500–7,000,000)
descriptionstringrequiredReason for withdrawal
recipient_namestringoptionalAccount holder name for optional validation
enforce_name_matchbooleanoptionalIf 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"
  }'
GET/v1/disbursements/{reference}Fetch single disbursement details
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.

GET/v1/disbursements/banksList supported commercial banks

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"
POST/v1/disbursements/bankInitiate a commercial bank transfer
Request Body
ParameterTypeRequiredDescription
bank_idintegerrequiredBank ID from /v1/disbursements/banks
account_namestringrequiredAccount title as registered with the bank
account_numberstringrequiredBank account number
amountintegerrequiredMinimum UGX 50,000
reasonstringrequiredTransfer 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.

POST/v1/disbursements/batchSubmit a batch payout
Request Body
ParameterTypeRequiredDescription
itemsarrayrequiredArray 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" }
    ]
  }'


Transactions & Status Sync

Query complete transaction history, retrieve single transaction details, or sync status in real time with the payment gateway.

GET/v1/transactionsList transactions with filters
Query Parameters
ParameterTypeDescription
typestringFilter by type: COLLECTION or DISBURSEMENT
statusstringFilter by status: PENDING, SUCCEEDED, FAILED, EXPIRED
limitintegerNumber of items to return (Default: 20, Max: 100)
starting_afterstringCursor pagination object reference
curl -X GET "https://api.broracks.online/v1/transactions?type=COLLECTION&status=SUCCEEDED&limit=10" \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
GET/v1/transactions/{reference}Fetch single transaction details
curl -X GET https://api.broracks.online/v1/transactions/BRR-tx123456 \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
POST/v1/transactions/{broracks_ref}/check-statusForce real-time status sync with gateway

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.

GET/v1/verify/phone/{msisdn}Lookup account holder name
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.

POST/v1/webhooks/configureConfigure webhook endpoint URL and event subscriptions
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"]
  }'
GET/v1/webhooksList active webhook endpoints
curl -X GET https://api.broracks.online/v1/webhooks \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
POST/v1/webhooks/rotate-secretRotate HMAC webhook signing secret
curl -X POST https://api.broracks.online/v1/webhooks/rotate-secret \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
GET/v1/webhooks/deliveriesInspect webhook delivery attempts & retry status
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.

Signature Headers

X-BroRacks-Signature: Contains sha256=HEX_SIGNATURE
X-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.