Skip to main content

Global Balance

To get the merchant balance of all country codes by currency in the NoWallet system, use the following endpoint:

GET{baseUrl}/check/transactions/global/balances/{currency}
note

The currency parameter in the URL is the currency code for which you want to check the balance. For example, XAF for Central African Franc.

Request Parameters

When checking the balance, the request must include the following parameters in the URL:

NameInTypeRequiredDescription
currencypathstringtruebalances currency will be checked

Code Samples in Multiple Languages

To help you integrate the NoWallet API seamlessly, we provide code samples in various programming languages. These examples demonstrate how to make a request to the API endpoint and handle the response.

  • Shell (cURL): For quick testing and command-line usage.
  • HTTP: Raw HTTP request format for understanding the structure.
  • JavaScript: Using fetch for browser or Node.js environments.
  • Ruby: Using the rest-client library for Ruby applications.
  • Python: Using the requests library for Python projects.
  • PHP: Using GuzzleHttp for PHP integrations.
  • Java: Using HttpURLConnection for Java applications.
  • Go: Using the net/http package for Go projects.

Example Request

Below is an example of how to check the balance of all country codes by currency using different languages. Select the tab corresponding to your preferred language to view the implementation.

note

Ensure you replace {access-token} with your actual API token and provide the required request parameters.

# Example cURL command to get global balance
curl -X GET {baseUrl}/check/transactions/global/balances/{currency} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'

Response Parameters

The response from the API will include the balance information for all country codes by currency. The structure of the response will depend on the specific implementation.

StatusMeaningDescriptionSchema
200OKglobal balance infos fetched successfully for currencyResponseGlobalBalanceDto
400Bad RequestBad Request possible errorsNone

Response Types

The response will be in JSON format.

Success Response (200 OK)

Example of a successful response with balance informations.

{
"bglobal": {
"balance": 200,
"deposit": 140,
"withdrawal": 60,
"potentialBalance": 100,
"possibleWithdrawal": 100,
"update": "2025-01-01TZ00:00:00"
},
"bcountry": [
{
"balance": 200,
"deposit": 150,
"withdrawal": 60,
"potentialBalance": 100,
"possibleWithdrawal": 100,
"update": "2025-01-01TZ00:00:00"
}
]
}

Error Response (400 Bad Request)

Bad Request possible errors

{
"statusCode": 400,
"error": "CURRENCY_NOT_FOUND",
"message": "It seems that this currency does not exist or You can't perform this action, this token does not allow you"
}

Was this page helpful?