Skip to main content

Update Brand

Updates an existing brand with new information. Only the provided fields will be updated.

HTTP Request

PATCH/api/products/brands/:id

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with BrandPermission or Admin
  • Permission Code: 1813
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the brand to update

Request Body

FieldTypeRequiredDescription
nameStringNoBrand name (must be unique)
slugStringNoURL-friendly version of the brand name (unique)
imageIntegerNoID of the brand image
orderIntegerNoDisplay order for brand sorting
descriptionStringNoBrand description (max 500 characters)

Example Requests

1import requests
2
3# Update brand name and order
4response = requests.patch('http://www.example.com/api/products/brands/123', 
5  json={
6      'name': 'Nike Sports',
7      'order': 2,
8      'description': 'Updated brand description with new focus on sports equipment'
9  },
10  headers={'Authorization': 'Token <your_api_key>'}
11)
12print(response.json())
13
14# Update only the image
15response = requests.patch('http://www.example.com/api/products/brands/123', 
16  json={
17      'image': 456
18  },
19  headers={'Authorization': 'Token <your_api_key>'}
20)
21print(response.json())
22
23# Remove image by setting to null
24response = requests.patch('http://www.example.com/api/products/brands/123', 
25  json={
26      'image': None
27  },
28  headers={'Authorization': 'Token <your_api_key>'}
29)
30print(response.json())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the brand
image_dataObjectBrand image details
orderIntegerDisplay order for brand sorting (nullable)
nameStringBrand name (unique)
slugStringURL-friendly version of the brand name(unique, nullable)
descriptionStringBrand description (max 500 characters, nullable)
products_countIntegerNumber of products associated with brand
created_atString (ISO 8601)Timestamp when brand was created
updated_atString (ISO 8601)Timestamp when brand was last updated

Image Data Structure

FieldTypeDescription
idIntegerUnique ID of the image
typeStringFile type (e.g., image/jpeg)
nameStringOriginal file name
sizeIntegerFile size in bytes
human_readable_sizeStringHuman readable file size (e.g., 2.5 MB)
fStringURL to access the image file
widthIntegerImage width in pixels
heightIntegerImage height in pixels
modeStringColor mode (e.g., RGB, CMYK)
thumbnailsList of thumbnail objectsImgae thumbnails

Thumbnail Data Structure

FieldTypeDescription
idIntegerUnique ID of the thumbnail (unique)
fStringURL to access the thumbnail file
sizeIntegerFile size in bytes (nullable)

Example Response

{
"id": 2,
"image_data": {
"id": 3,
"type": "image",
"name": "logitech-mx-2",
"size": 3166,
"human_readable_size": "3.09 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/11/22/logitech-mx-2.jpg",
"width": 275,
"height": 183,
"mode": "RGB",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
},
"order": 2,
"name": "Homenick Inc",
"slug": "a-modern-brand",
"description": "logistical",
"products_count": 0,
"created_at": "2025-12-24T13:12:19.836399Z",
"updated_at": "2025-12-24T13:15:17.344572Z"
}