Retrieve Brand
Retrieves detailed information about a specific brand by its unique ID.
HTTP Request
GET/api/products/brands/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the brand to retrieve |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Retrieve a specific brand
4response = requests.get('http://www.example.com/api/products/brands/123',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())1# Retrieve a specific brand
2curl "http://www.example.com/api/products/brands/123" \
3-H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Brand retrieved successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — brand does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the brand |
| image_data | Object | Brand image details (read-only) |
| order | Integer | Display order for brand sorting |
| name | String | Brand name (unique) |
| slug | String | URL-friendly version of the brand name |
| description | String | Brand description (max 500 characters) |
| 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 | Image ID |
| type | String | File type |
| name | String | Image file name |
| size | Integer | File size in bytes |
| human_readable_size | String | Human readable file size |
| f | String | Image file URL |
| width | Integer | Image width in pixels |
| height | Integer | Image height in pixels |
| mode | String | Image color mode |