Skip to main content

Get 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
limitintegerNumber of results to return per page.
offsetintegerNumber of results to skip before returning results.
searchstringSearch term to filter results by `name`, `code`.
orderingstringField to order 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())

Status Codes

CodeDescription
200List retrieved successfully
400Bad request — invalid input
500Internal server error

Response Fields

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