This guide will help you make your first API call to Bila in just a few minutes.
Step 1: Get your API Keys
- Sign up or log in to the Bila Console
- Navigate to Settings → API Keys
- Generate a new API key
You’ll receive two types of keys:
- Test Key (
sk_test_...) - Use for sandbox testing
- Live Key (
sk_live_...) - Use for production
Keep your API keys secure. Never expose them in client-side code or public repositories.
Step 2: Make your first API call
Let’s verify your API key by fetching your accounts:
curl -X GET "https://api.usebila.com/api/v1/bila/accounts" \
-H "x-api-key: sk_test_your_api_key_here" \
-H "Content-Type: application/json"
Success Response
{
"status": true,
"message": "Accounts retrieved successfully",
"data": {
"data": [...],
"meta": {
"total": 1,
"page": 1,
"perPage": 50,
"totalPages": 1
}
}
}
Step 3: Collect a payment
Initiate a mobile money collection from a customer:
curl -X POST "https://api.usebila.com/api/v1/bila/collections/mobile-money" \
-H "x-api-key: sk_test_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"reference": "order-12345",
"phone": "0977123456",
"operator": "airtel",
"country": "zm",
"walletId": "your-wallet-id",
"customerName": "John Doe",
"narration": "Payment for Order #12345"
}'
Step 4: Send a transfer
Send money to a bank account:
curl -X POST "https://api.usebila.com/api/v1/bila/transfers/bank-account" \
-H "x-api-key: sk_test_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"accountId": "your-account-id",
"amount": 500,
"reference": "payout-12345",
"accountNumber": "1234567890",
"bankId": "bank-id",
"country": "zm",
"narration": "Salary payment"
}'
Next Steps