Skip to main content

Single Balance

To get the merchant balance of a single country code in the NoWallet system, use the following endpoint:

GET{baseUrl}/check/transactions/single/balances/{country}
note

The country parameter in the URL is the country code for which you want to check the balance. For example, CM for Cameroon.

Request Parameters

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

NameInTypeRequiredDescription
countrypathstringtruebalance country code 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 a single country code 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 single balance
curl -X GET {baseUrl}/check/transactions/single/balances/{country} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'

Response Parameters

When you make a request to the NoWallet API to check the balance of a single country code, you will receive a response containing the balance information. The response will be in JSON format and will include details such as the total deposit, withdrawal amounts, and other relevant information.

The response from the API will include the balance information for the specified country code. The structure of the response may vary based on the implementation, but it typically includes fields such as:

  • country: The country code for which the balance is being checked.
  • deposit: The total deposit amount in the specified currency.
  • withdrawal: The total withdrawal amount in the specified currency.
  • message: Any additional information or error messages related to the request.
  • statusCode: The status code of the response, indicating success or failure (e.g., 200 for success, 400 for bad request).
StatusMeaningDescriptionSchema
200OKall infos for this balance fetched successfullyResponseSingleBalanceDto
400Bad RequestBad Request possible errorsNone

Response Types

When you make a request to the NoWallet API to check the balance of a single country code, you will receive a response containing the balance information. The response will be in JSON format and will include details such as the total deposit, withdrawal amounts, and other relevant information.

The response will be in JSON format.

Success Response (200 OK)

Example of a successful response with balance informations.

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

Error Response (400 Bad Request)

Bad Request possible errors

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

Was this page helpful?