Skip to main content

Overview

The Bila Java SDK provides convenient access to the Bila REST API from applications written in Java.

Builder Pattern

Fluent builders for every request param and client configuration option.

Sync & Async

Synchronous client by default, with an async variant for non-blocking calls.

Comprehensive

Access to all Bila API features: Accounts, Transfers, Collections, and more.

Stainless Generated

Consistently structured and always up-to-date with the latest API changes.

Installation

Quick Start

API Classes

The SDK is organized into resources, each handling a specific domain:

Accounts

Manage your Bila wallets and check balances.

Methods

client.accounts().retrieve(id) Retrieve details for a specific account.
Returns: AccountRetrieveResponse client.accounts().list(params) List all accounts associated with your profile.
Returns: AccountListPage client.accounts().getBalance(id) Check the real-time balance of an account.
Returns: AccountGetBalanceResponse

TransferRecipients

Manage payout recipients for bank and mobile money transfers.

Methods

client.transferRecipients().retrieve(id) Retrieve details for a specific transfer recipient.
Returns: TransferRecipientRetrieveResponse client.transferRecipients().list(params) List all transfer recipients.
Returns: TransferRecipientListPage client.transferRecipients().createBankAccount(params) Create a new bank account transfer recipient.
Returns: TransferRecipientCreateBankAccountResponse client.transferRecipients().createMobileMoney(params) Create a new mobile money transfer recipient.
Returns: TransferRecipientCreateMobileMoneyResponse

Transfers

Send funds to bank accounts or mobile money wallets.

Methods

client.transfers().retrieve(id) Retrieve details for a specific transfer.
Returns: TransferRetrieveResponse client.transfers().list(params) List all transfers.
Returns: TransferListPage client.transfers().getStatusByReference(reference) Get the status of a transfer by its reference.
Returns: TransferGetStatusByReferenceResponse client.transfers().initiateBankTransfer(params) Initiate a bank transfer.
Returns: TransferInitiateBankTransferResponse client.transfers().initiateMobileMoneyTransfer(params) Initiate a mobile money transfer.
Returns: TransferInitiateMobileMoneyTransferResponse

Collections

Accept mobile money payments from customers.

Methods

client.collections().retrieve(id) Retrieve details for a specific collection.
Returns: CollectionRetrieveResponse client.collections().list(params) List all collections.
Returns: CollectionListPage client.collections().getStatusByReference(reference) Get the status of a collection by its reference.
Returns: CollectionGetStatusByReferenceResponse client.collections().initiateMobileMoneyCollection(params) Initiate a mobile money collection.
Returns: CollectionInitiateMobileMoneyCollectionResponse

Transactions

View and manage transaction history.

Methods

client.transactions().retrieve(id) Retrieve details for a specific transaction.
Returns: TransactionRetrieveResponse client.transactions().list(params) List all transactions.
Returns: TransactionListPage

Webhooks

Configure endpoints to receive real-time event notifications.

Methods

client.webhooks().create(params) Register a new webhook endpoint.
Returns: WebhookCreateResponse client.webhooks().update(id, params) Update an existing webhook.
Returns: WebhookUpdateResponse client.webhooks().list() List all registered webhooks.
Returns: WebhookListResponse client.webhooks().deactivate(id) Deactivate a webhook.
Returns: BilaResponse client.webhooks().getDeliveries(id, params) Get delivery history for a specific webhook.
Returns: WebhookGetDeliveriesResponse client.webhooks().listEvents() List all supported webhook events.
Returns: WebhookListEventsResponse client.webhooks().rotateSecret(id) Rotate the signing secret for a webhook.
Returns: WebhookRotateSecretResponse

Banks

Utilities for listing supported financial institutions.

Methods

client.banks().list(params) List supported banks for a specific country.
Returns: BankListResponse

Resolve

Utilities for verifying account details.

Methods

client.resolve().bankAccount(params) Verify the owner of a bank account.
Returns: ResolveBankAccountResponse client.resolve().mobileMoney(params) Verify mobile money details.
Returns: ResolveMobileMoneyResponse

Error Handling

The SDK throws a BilaServiceException for non-success API responses and BilaIoException for network-level failures. Both extend BilaException.

Best Practices

1

Use Environment Variables

Configure your API key via the BILA_API_KEY environment variable rather than hardcoding it in your builder calls.
2

Reuse the Client

Create a single BilaClient instance per application and reuse it across requests; the underlying HTTP client manages connection pooling.
3

Handle Errors Gracefully

Catch BilaServiceException separately from generic exceptions to distinguish API errors from network or serialization failures.

Next Steps

SDK Quickstart

Complete integration guide with examples

Transfers

Learn about initiating transfers

Webhooks

Set up webhook notifications

API Reference

Complete REST API documentation