Skip to main content

Countries Data

This page provides information about the countries data used in the Nowallet API. The countries data is used to identify the country code and its corresponding currency for payment transactions.

To get the list of countries and their corresponding currency codes, phone length, and more, you can use the following endpoint:

GET{baseUrl}/countries/data
note

For example, if you want to get specific data about Cameroon, you can use the following URL:

{baseUrl}/countries/data?country=CM.

Request Parameters

When retrieving the countries data, the request must include the following parameters in the URL:

NameInTypeRequiredDescription
countryquerystringfalsecountry code will be checked, return all countries if empty or not provided

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 retrieve the countries data 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.

# Exemple de commande cURL pour obtenir les données des pays
curl -X GET {baseUrl}/countries/data \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'

Response Parameters

The response from the API will include the following parameters:

StatusMeaningDescriptionSchema
200OKcountries fetched successfullyInline
400Bad RequestBad Request possible errorsNone

Response Types

The response from the API will include the following parameters in JSON format:

Success Response (200 OK)

Example response for a successful request

{
"code": "CM",
"name": "Cameroon",
"indicatif": "+237",
"currency": "XAF",
"phone_length": 8
}

Error Response (400 Bad Request)

{
"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"
}

Enumerated Values

PropertyValue
codeDZ
codeAO
codeBJ
codeBW
codeBF
codeBI
codeCM
codeCV
codeCF
codeTD
codeKM
codeCG
codeCD
codeCI
codeDJ
codeEG
codeGQ
codeER
codeET
codeGA
codeGM
codeGH
codeGN
codeGW
codeKE
codeLS
codeLR
codeLY
codeMG
codeMW
codeML
codeMR
codeMU
codeYT
codeMA
codeMZ
codeNA
codeNE
codeNG
codeRE
codeRW
codeST
codeSN
codeSC
codeSL
codeSO
codeZA
codeSS
codeSD
codeSZ
codeTZ
codeTG
codeTN
codeUG
codeEH
codeZM
codeZW

Was this page helpful?