Skip to main content

Update Shop Settings

Updates the shop settings of the project

HTTP Request

PATCH/api/settings/shop

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with ShopSettingsPermission or Admin
  • Permission Code: 1062
  • Authentication: Token authentication

Request Body

FieldTypeRequiredDescription
shop_nameStringNoShop name (nullable)
shop_timezoneStringNoThe standard timezone name of the shop (default: Asia/Tehran)
shop_opening_hourStringNoThe opening time of the shop in UTC (nullable)
shop_closing_hourStringNoThe closing time of the shop in UTC (nullable)
shop_maintenance_modeBooleanNoDefines if the shop is in maintenance mode (default: False)
shop_force_user_loginBooleanNoDefines if authentication is required for shop customers (default: False)

Example Requests

1import requests
2
3# Update blog settings
4response = requests.patch('http://www.example.com/api/settings/shop', 
5  headers={'Authorization': 'Token <your_api_key>'},
6  json={
7      "shop_name": "test store",
8      "shop_opening_hour": "08:30"
9  }
10)
11print(response.json())

Response Fields

FieldTypeDescription
shop_nameStringShop name (nullable)
shop_timezoneStringThe standard timezone name of the shop (default: Asia/Tehran)
shop_opening_hourStringThe opening time of the shop in UTC (nullable)
shop_closing_hourStringThe closing time of the shop in UTC (nullable)
shop_maintenance_modeBooleanDefines if the shop is in maintenance mode (default: False)
shop_force_user_loginBooleanDefines if authentication is required for shop customers (default: False)

Example Response

{
"shop_name": "vitrin store",
"shop_timezone": "Asia/Tehran",
"shop_opening_hour": "08:00:00",
"shop_closing_hour": null,
"shop_maintenance_mode": false,
"shop_force_user_login": false
}

Notes

  • shop timezone should be selected from a standard timezone name like 'Asia/Tehran'
  • shop opening and closing hours are both optional
  • if only opening hour is provided, the shop endpoints will be available at times greater than the opening hour
  • if only closing hour is provided, the shop endpoints will be available at times smaller than the closing hour
  • the opening and closing hours MUST be in utc
  • when shop maintenance mode is true, there will be no access to the shop endpoints
  • shop force user login parameter, limits the shop endpoints to the authenticated users