Appearance
Get Current Balance
sh
> GET ${BASE_URL}/info/get-current-balanceThis endpoint returns the current wallet balances in your Telesend account. Telesend maintains three types of balances, each serving a different purpose:
- airtime balance:
- This balance is only used for airtime topups. If you are using an airtime product the appropriate amount will be deducted from this balance. It is represented as walletBalance in the api response
- Gift Balance -
- It is used for gift topups. When generating a new gift a cost is deducted from this balance. It is represented as eMoneyWalletBalance in the api response
- Reserved Balance -
- Reserved Balance refers to a gift amount that has been generated but hasnt been used by end user. This balance indicates how many people actually used their gifts. It is represented as 'reservedBalance' in the api response.
You can get the information about these balances using the endpoint - ${BASE_URL}/info/get-current-balance
Endpoint
Sample Request
sh
$ curl -H 'Content-Type: application/json' \
-H 'x-api-token: ACCESS_TOKEN' \
"BASE_URL/info/get-current-balance"Typescript
import * as axios from "axios";
axios
.get("BASE_URL/info/get-current-balance", {
headers: {
"Content-Type": "application/json",
"x-api-token": "ACCESS_TOKEN"
},
})
.then((response) => {
console.log("Success:", response.data);
})
.catch((error) => {
console.error(
"Error:",
error.response ? error.response.data : error.message,
);
});Response Schema
Success Schema
ts
{
success: boolean;
message: string;
statusCode: number;
data: {
walletBalance: number;
eMoneyWalletBalance: number;
reservedBalance: number;
}
meta: {
itemsPerPage: number;
totalItems: number;
currentPage: number;
totalPages: number;
sortBy: Array<Array<string>>;
}
links: {
current: string;
}
}Error Schema
ts
{
statusCode: number;
success: boolean;
message: string;
data: any;
}Sample Response
json
{
"success": true,
"message": "Successful",
"statusCode": 200,
"data": {
"walletBalance": 1000.0,
"eMoneyWalletBalance": 2000.0,
"reservedBalance": 3000.0
},
"meta": {
"itemsPerPage": 10,
"totalItems": 1,
"currentPage": 1,
"totalPages": 1
}
}