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

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%.

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": "[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.

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_callbackstringoptionalExtra https URL that gets this payment's success event. Signed with your webhook secret, like webhooks
failure_callbackstringoptionalSame, 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"
  }'
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"

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.

πŸ’³
Never collect card numbers, expiry dates or CVVs yourself. The API rejects any card fields. Card payments cost 5% of the amount, deducted from it like mobile money fees.
POST/v1/collections/cardCreate a card checkout
Request Body
ParameterTypeRequiredDescription
amountintegerrequiredAmount in UGX (500–7,000,000)
customer_namestringrequiredCardholder name
customer_emailstringrequiredCardholder email
descriptionstringoptionalWhat the customer is paying for
redirect_urlstringoptionalWhere 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"
  }'
Response (201 Created)
{
  "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.

πŸ”
Create your PIN in Dashboard β†’ Settings. Treat it like a password: keep it in a server-side secret, never in browser or mobile app code. Calls without a destination still go to your registered phone and need no PIN.
⚠️
For mobile money we look up the registered name before sending and show it in the response. Banks can't confirm names up front, and bank transfers can't be reversed, so double-check account numbers.
POST/v1/disbursements/initiateSend money
Request Body
ParameterTypeRequiredDescription
amountintegerrequiredAmount the recipient gets, in UGX. Mobile money 500–7,000,000; bank 2,500–50,000,000. The fee is added on top.
descriptionstringoptionalReason for the payment (default β€œWithdrawal”)
destinationobjectoptional{"type": "mobile_money", "phone_number"} or {"type": "bank", "bank_id", "account_number", "account_name"}. Leave out to send to your registered phone.
pinstringwith destinationYour 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
Response (202 Accepted)
{
  "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)."
}
PIN errors
CodeHTTPMeaning
PIN_REQUIRED403β€”A destination was given (or the call came from the dashboard) without a PIN
INVALID_PIN403β€”Wrong PIN. attempts_remaining says how many tries are left
PIN_LOCKED423β€”3 wrong PINs pause payouts for 5 hours, then 10, then 15 (only a correct PIN resets this). locked_until says when
PIN_LOCKED_SUPPORT423β€”One more wrong PIN after the 15-hour lock: payouts stay locked until broRacks support resets the PIN
PIN_NOT_SET428β€”Create a PIN in Dashboard β†’ Settings first
GET/v1/disbursements/quoteFee and total before sending
Query Parameters
ParameterTypeRequiredDescription
amountintegerrequiredAmount the recipient should get
typestringoptionalmobile_money (default) or bank
Response
{
  "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
  }
}
GET/v1/disbursements/banksBanks you can send to
Response
{
  "status": "success",
  "data": [
    { "id": "7",  "name": "Centenary Bank" },
    { "id": "12", "name": "Stanbic Bank Uganda" }
  ]
}
GET/v1/disbursements/recipientsPeople you sent to recently (one-tap repeat)
Response
{
  "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" }
    ]
  }
}
GET/v1/disbursements/{reference}Look up one payout

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.

POST/v1/disbursements/bankSend to a bank account
Request Body
ParameterTypeRequiredDescription
bank_idstringrequiredBank ID from /v1/disbursements/banks
account_namestringrequiredAccount holder name as registered with the bank
account_numberstringrequiredBank account number
amountintegerrequiredUGX 2,500–50,000,000. The fee is added on top
reasonstringoptionalTransfer description or invoice reference
pinstringrequiredYour 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.

POST/v1/disbursements/batchSubmit a batch payout
Request Body
ParameterTypeRequiredDescription
itemsarrayrequired1–100 payouts, each with amount, description and an optional destination
pinstringwith destinationsYour 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" } }
    ]
  }'


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"
}
HTTPError CodeMeaning
400INSUFFICIENT_BALANCENot enough funds in wallet
401INVALID_CREDENTIALSWrong email/password or invalid API key
401TOKEN_EXPIREDJWT access token has expired
403MERCHANT_SUSPENDEDMerchant account is suspended
422INVALID_AMOUNTAmount outside 500–7,000,000 UGX range
422INVALID_PHONEPhone number is not in E.164 format
422IDEMPOTENCY_KEY_REUSEDThis Idempotency-Key was already used with a different request body
422INVALID_EMAIL / INVALID_REDIRECT_URLCard payment fields are malformed
400IDEMPOTENCY_KEY_EXPIREDIdempotency keys are kept for 24 hours. Use a new key
400INVALID_PAGINATION / INVALID_CURSORUse either starting_after or ending_before, with a reference from your own transactions
422INVALID_CALLBACK_URLsuccess_callback / failure_callback must be public https URLs
422NAME_MISMATCH / NAME_UNVERIFIEDWith enforce_name_match, the registered name didn't match recipient_name, or couldn't be looked up
403 / 423 / 428PIN_REQUIRED, INVALID_PIN, PIN_LOCKED, PIN_LOCKED_SUPPORT, PIN_NOT_SETSee Payouts β†’ PIN errors
429RATE_LIMIT_EXCEEDEDToo many requests β€” slow down
502GATEWAY_ERRORThe payment provider rejected the request. The transaction is recorded as FAILED
504GATEWAY_TIMEOUTCard 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.

Collections
MethodFee
Mobile money (MTN, Airtel) Β· UGX 500–7,000,0003% of the amount
Card (Visa, Mastercard)5% of the amount
Payouts to mobile money
Amount (UGX)Fee (UGX)
500 – 45,0001,200
45,001 – 200,0001,800
200,001 – 400,0002,500
400,001 – 1,000,0004,000
1,000,001 – 2,000,00010,000
2,000,001 – 5,000,00015,000
5,000,001 – 7,000,00018,000
Payouts to bank accounts
Amount (UGX)Fee (UGX)
2,500 – 250,0005,000
250,001 – 500,0006,000
500,001 – 1,000,0009,000
1,000,001 – 2,000,00013,500
2,000,001 – 50,000,00016,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.

EnvironmentKey PrefixDescription
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.
Livesk_live_Real mobile money transactions. Requires domain whitelisting.
POST/v1/sandbox/transactions/{reference}/simulateComplete or fail a test transaction

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"}'
πŸ”’
Live keys require domain whitelisting. When creating a live API key, you must specify the allowed domains that can use it. Server-to-server calls (no Origin header) are always allowed.