Skip to main content
PUT
/
api
/
v1
/
stores
/
{slug}
Update Store
curl --request PUT \
  --url https://api.example.com/api/v1/stores/{slug}/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "brand_name": "<string>",
  "about": "<string>"
}
'
{
  "id": 123,
  "url": "<string>",
  "brand_name": "<string>",
  "about": "<string>",
  "products_sold": 123,
  "owner": 123,
  "followers": [
    {}
  ]
}
This endpoint allows store owners to update their store’s brand name and description. Only the store owner can update their own store.

Authentication

Required: Bearer token in Authorization header Permission: You must be the owner of the store (VendorOnly permission)

Path Parameters

slug
string
required
The URL slug of the store to update (derived from brand_name)

Request Body

brand_name
string
Updated brand name for the store. If omitted, keeps current value.
about
string
Updated description of the store. If omitted, keeps current value.
Both fields are optional in the update request. Only include fields you want to change.

Response

Returns the updated store object:
id
integer
Unique identifier for the store
url
string
Hyperlinked URL to the store detail endpoint (uses slug)
brand_name
string
The store’s brand name
about
string
Description of the store
products_sold
integer
Total number of products sold by this store
owner
integer
Customer ID of the store owner
followers
array
Array of customer IDs following this store

Example Request

cURL
curl -X PUT http://localhost:8000/api/v1/stores/tech-gadgets-pro/ \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "about": "Premium electronics, accessories, and smart home devices for tech enthusiasts"
  }'
Python
import requests

url = "http://localhost:8000/api/v1/stores/tech-gadgets-pro/"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "about": "Premium electronics, accessories, and smart home devices for tech enthusiasts"
}

response = requests.put(url, headers=headers, json=data)
print(response.json())

Example Response

{
  "id": 5,
  "url": "http://localhost:8000/api/v1/stores/tech-gadgets-pro/",
  "brand_name": "Tech Gadgets Pro",
  "about": "Premium electronics, accessories, and smart home devices for tech enthusiasts",
  "products_sold": 47,
  "owner": 42,
  "followers": [15, 23, 108]
}

Error Responses

400 Bad Request

Returned when brand name conflicts with another store:
{
  "brand_name": ["store with this brand name already exists."]
}

401 Unauthorized

Returned when authentication token is missing or invalid:
{
  "detail": "Authentication credentials were not provided."
}

403 Forbidden

Returned when you try to update a store you don’t own:
{
  "detail": "You do not have permission to perform this action."
}

404 Not Found

Returned when the store slug doesn’t exist:
{
  "detail": "Not found."
}

Business Rules

  • Only the store owner can update their store
  • Brand name changes will update the URL slug
  • Changing the brand name does not affect existing product associations
  • Products sold count and follower list cannot be directly modified through this endpoint
Changing the brand name will change the store’s URL slug. Update any bookmarks or links accordingly.

Code Reference

Implementation: ~/workspace/source/stores/views.py:68-76

Build docs developers (and LLMs) love