customer_id for transactions.
This guide provides a technical walkthrough on retrieving the customers associated with your Busha business account via the Busha API
Prerequisites
Before you begin, ensure you have:- A Busha Business Account and Secret API Key (from the Quick Start Tutorial).
- An understanding of API Environments (Sandbox vs. Production) and their base URLs (from the Make Your First Request Guide).
How to Retrieve Customer Information
1
Retrieve a Specific Customer
You can fetch the details of a single customer from their ID.To retrieve a specific customer:Expected Response:A successful response will return a single customer object, identical in structure to the one received during creation, containing all its details:
- Open your terminal or command prompt.
- Construct a
GETrequest to the/v1/customers/{customer_id}endpoint, replacing{customer_id}with the actual customer ID. - Ensure your
AuthorizationandYOUR_SECRET_TOKENheaders are included. - Replace placeholders like
YOUR_BASE_URLandYOUR_SECRET_TOKEN.
2
Retrieve All Customers
To get an overview of all the customers you have created, you can make a Expected ResponseA successful response will return a list (an array) of all recipient objects associated with your account.
GET request to the /v1/customers endpoint without specifying an ID.To list all customers:- Open your terminal or command prompt.
- Construct a
GETrequest to the/v1/customersendpoint. - Ensure your
Authorizationheader is included. - Replace placeholders like
YOUR_BASE_URLandYOUR_SECRET_TOKEN.
Troubleshooting
- 404 Not Found: Verify that the customer ID is correct.
- 401 Unauthorized: Verify that your Secret API Key is correct and included in the header.
What’s Next?
Now that you can retrieve customers, you can proceed to manage them and perform transactions on their behalf:- How to Verify Customer’s Identity (KYC/KYB): Learn how to conduct and verify the identity of your customer to allow them full access to Busha’s operations.
- How to Initiate Transactions on Behalf of a Customer: Understand how to use the
customer_idto perform operations for your customers.