Create Brand
Creates a new brand with the specified properties.
HTTP Request
POST/api/products/brands
Authorization
Authorization
- Required: Yes
- Permission: Staff with BrandPermission or Admin
- Permission Code: 1811
- Authentication: Token-based (Authorization: Token <your_api_key>)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Brand name (must be unique) |
| slug | String | No | URL-friendly version of the brand name (unique) |
| image | Integer | No | ID of the brand image |
| order | Integer | No | Display order for brand sorting |
| description | String | No | Brand description (max 500 characters) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Create a new brand
4response = requests.post('http://www.example.com/api/products/brands',
5 json={
6 'name': 'Nike',
7 'image': 123,
8 'order': 1,
9 'description': 'Just Do It - Global athletic footwear and apparel company'
10 },
11 headers={'Authorization': 'Token <your_api_key>'}
12)
13print(response.json())
14
15# Create minimal brand
16response = requests.post('http://www.example.com/api/products/brands',
17 json={
18 'name': 'Adidas'
19 },
20 headers={'Authorization': 'Token <your_api_key>'}
21)
22print(response.json())1# Create a new brand
2curl -X POST "http://www.example.com/api/products/brands" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
6 "name": "Nike",
7 "image": 123,
8 "order": 1,
9 "description": "Just Do It - Global athletic footwear and apparel company"
10}'
11
12# Create minimal brand
13curl -X POST "http://www.example.com/api/products/brands" \
14-H "Authorization: Token <your_api_key>" \
15-H "Content-Type: application/json" \
16-d '{
17 "name": "Adidas"
18}'Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the brand |
| image_data | Object | Brand image details |
| order | Integer | Display order for brand sorting (nullable) |
| name | String | Brand name (unique) |
| slug | String | URL-friendly version of the brand name(unique, nullable) |
| description | String | Brand description (max 500 characters, nullable) |
| products_count | Integer | Number of products associated with brand |
| created_at | String (ISO 8601) | Timestamp when brand was created |
| updated_at | String (ISO 8601) | Timestamp when brand was last updated |
Image Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the image |
| type | String | File type (e.g., image/jpeg) |
| name | String | Original file name |
| size | Integer | File size in bytes |
| human_readable_size | String | Human readable file size (e.g., 2.5 MB) |
| f | String | URL to access the image file |
| width | Integer | Image width in pixels |
| height | Integer | Image height in pixels |
| mode | String | Color mode (e.g., RGB, CMYK) |
| thumbnails | List of thumbnail objects | Imgae thumbnails |
Thumbnail Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the thumbnail (unique) |
| f | String | URL to access the thumbnail file |
| size | Integer | File 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": 1,
"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:12:19.836407Z"
}