Skip to main content

List All Countries

Retrieves a list of all countries.

HTTP Request

GET/api/shop/locations/countries

Authorization

Authorization

  • Required: No
  • Permission: Public
  • Authentication: None

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results to return per page.
offsetinteger0Number of results to skip before returning results.
searchstringSearch term to lookup results by `name`, `code`.
orderingstringOrder results by (`name`, `code`).

Example Requests

1import requests
2response = requests.get('http://www.example.com/api/shop/locations/countries', params={
3  'limit': 5,
4  'ordering': 'name',
5  'search': 'Iran'
6})
7print(response.json())

Response Fields

FieldTypeDescription
countIntegerTotal number of categories
nextStringURL for the next page of results
previousStringURL for the previous page of results
resultsArray[Object]Array of Country objects

Country Object Data Structure

FieldTypeDescription
idintegerUnique ID of the country.
namestringName of the country.
codestringISO code of the country (e.g., "IR").

Example Response

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "ایران",
"code": "IR"
}
]
}