Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.usebila.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Bila Sandbox mirrors the production API exactly — same endpoints, same authentication, same response shapes — but all transactions are fully simulated. No real money moves, no SMS or emails are sent.
Sandbox and production are completely isolated. Sandbox keys, wallet IDs, and data do not carry over to production.

What the Sandbox Simulates

FeatureBehaviour
Collections and transfersFully simulated — no real money moves
Wallet balanceNot fixed — it changes accordingly (simulated)
SMS and email notificationsNot sent — use the status endpoint instead
Webhook deliveryWorks — events fire to your registered URL
OTP (if required)Default is 000000

Setup

1. Activate the Sandbox

  1. Log in to your Bila Merchant Dashboard
  2. Go to Settings → API Keys and Click Activate Sandbox
  3. Click Create API Key
  4. Copy and save your key — it will not be shown again in full
Your sandbox secret key is prefixed with sk_test_.
Store your API key in an environment variable. Never commit it to source control or log it.

2. Verify Your Connection

curl --request GET \
  --url https://sandbox.usebila.com/api/v1/bila/accounts \
  --header 'x-api-key: sk_test_your_api_key_here'
Expected response:
{
  "status": true,
  "message": "Operation completed successfully",
  "data": {
    "data": [
      {
        "id": "68f11209-451f-4a15-bfcd-d916eb8b09f4",
        "type": "main",
        "status": "active",
        "currency": "ZMW",
        "createdAt": "2024-01-15T10:30:00Z",
        "details": {
          "type": "bank-account",
          "accountName": "John Doe",
          "tillNumber": "123456"
        },
        "availableBalance": "1500.00",
        "ledgerBalance": "1500.00"
      }
    ],
    "meta": {
      "total": 1,
      "perPage": 50,
      "currentPage": 1,
      "pageCount": 1
    }
  }
}
Save your walletId — you will need it for collections and transfers.

Base URLs

EnvironmentURL
Sandboxhttps://sandbox.usebila.com/api/v1
Productionhttps://api.usebila.com/api/v1

Authentication

Include your secret key in every request:
x-api-key: sk_test_your_api_key_here
The header name must be exactly x-api-key in lowercase. No Bearer tokens are used on merchant-facing routes.
Key TypePrefixHeader
Secret Keysk_test_x-api-key
Publishable Keypk_test_x-publishable-key

Test Data

Supported Providers

Provideroperator valueExample Number
MTN Mobile Moneymtn096XXXXXXX
Airtel Moneyairtel097XXXXXXX
Zamtel Kwachazamtel095XXXXXXX

Simulating Success and Failure

By default all transactions succeed. To trigger a failure, include the substring fail anywhere in your reference:
INV-2026-fail-001       ✓ fails
test-payment-will-fail  ✓ fails
INV-2026-001            ✓ succeeds
The sandbox does not expose specific PSP error codes. Outcomes are binary — successful or failed — with a message string stating the reason.

Limitations

LimitationDetail
One wallet onlySandbox has a single Main Wallet — sub-wallets require production
No PSP error codesFailures are binary — successful or failed only
No SMS or emailNotifications suppressed — use status endpoint or webhooks
Wallet balanceNot fixed — it changes accordingly (simulated)

Support