List Countries

This API lists all countries.

Endpoint Information

Property Value
URL {{APP_URL}}/api/v1/countries
HTTP Method GET
Content Type application/json
Authentication APIKEY header

Request Parameters

This endpoint has no URL or content parameters.

Example Usage

API Request

Below is an example HTTP raw request for the API request.

GET {{APP_URL}}/api/v1/countries
Content-Type: application/json
APIKEY: {{APIKEY}}

API Response

On a successful request, the API will return a response like the following:

{
    "status": true,
    "message": null,
    "data": [
        {
            "id": 1,
            "code": 4,
            "name": "Afghanistan",
            "iso2": "AF",
            "iso3": "AFG",
            "postalCodePattern": null,
            "isPostalCodeRequired": true
        },
        {
            "id": 2,
            "code": 248,
            "name": "Aland Islands",
            "iso2": "AX",
            "iso3": "ALA",
            "postalCodePattern": null,
            "isPostalCodeRequired": true
        },
        {
            "id": 83,
            "code": 276,
            "name": "Germany",
            "iso2": "DE",
            "iso3": "DEU",
            "postalCodePattern": null,
            "isPostalCodeRequired": true
        }
    ]
}

Error Responses

If the API request fails, the API will return an error response like the following:

{
    "status": false,
    "errors": [
        {
            "message": "Unknown error"
        }
    ]
}