Balance
The Balance section allows you to manage user balances within our system. Here, you can explore the different endpoints available for querying, updating, and adjusting balances programmatically. You'll learn how to retrieve a user's current balance, add or deduct credits, and track balance-related transactions efficiently.
POST/v1/transactions/topUpBalance
Top Up account balance
This endpoint allows you to top up a user's account balance in our system. To add funds, you must provide the user's unique identifier and the amount to be credited.
Required attributes
- Name
amount- Type
- numeric
- Description
The top up amount.
- Name
payment_id- Type
- string
- Description
The ID of the payement.
- Name
payment_method- Type
- string
- Description
The payement method.
- Name
status- Type
- string
- Description
The status .
Request
POST
/v1/transactions/topUpBalancecurl https://api.getourvoice.com/v1/transactions/topUpBalance
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
--header "Content-Type: application/json"
--header "Accept: application/json"
--data "{
\"amount":5000,
"payment_method": "MTN MOMO",
"payment_method": "1222YYYY3",
"status": "status",
}"
Response (200)
{
"data": {
"success":true,
"message": "Operation successfully executed",
"data": "{
"transaction": {
'id' : "bd8ea025-06eb-4cf9-9e85-ed67f85d0f11",
'description' : "account top up",
'payment_method' : "MTN MOMO"
'payment_id' : "1222YYYY3",
'amount' : 5000,
'currency' : "XOF,
'status' : completed,
"created_at": "2022-12-07T08:18:02.000000Z",
"updated_at": "2022-12-07T08:18:02.000000Z"
}
}"
}
}
GET/v1/current/balance
Get current account balance
This endpoint allows you to retrieve the current balance of a user's account. You must provide the user's unique identifier to get their available balance.
Request
GET
/v1/current/balancecurl --request GET \
"https://api.getourvoice.com/v1/current/balance" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Response
{
"data": {
"message": "Operation successfully executed",
"data": "{
\"balance":50000
}"
}
}