Skip to main content

Get All Cities

Retrieves a list of all cities.

HTTP Request

GET/api/shop/locations/cities

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`.
orderingstringField to order results by (`name`).
statestringFilter results by state ID.

Example Requests

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

Status Codes

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

Response Fields

FieldTypeDescription
idintegerUnique ID of the city.
namestringName of the city.