Skip to main content

Retrieve Brand by Slug

Retrieve a specific brand by its unique slug.

HTTP Request

GET/api/shop/brands/:slug

Authorization

Authorization

  • Required: No
  • Permission: None (public access) or Authenticated users
  • Authentication: None or Token-based authentication

Path Parameters

ParameterTypeRequiredDescription
slugStringYesURL-friendly version of the brand name

Example Requests

1import requests
2response = requests.get('http://www.example.com/api/shop/brands/apple/')
3print(response.json())

Status Codes

CodeDescription
200Brand retrieved successfully
400Bad request — invalid parameters
404Not found — brand does not exist
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the brand
orderIntegerDisplay order of the brand
imageObject or nullBrand image data (`id`, `url`, `name`)
nameStringBrand name
slugStringURL-friendly version of the brand name
descriptionStringBrand description
products_countIntegerNumber of products associated with this brand
created_atString (ISO 8601)Timestamp when brand was created
updated_atString (ISO 8601)Timestamp when brand was last updated

Example Response

{
"id": 1,
"order": 1,
"image": {
"id": 10,
"url": "http://www.example.com/media/brands/apple.png",
"name": "apple.png"
},
"name": "Apple",
"slug": "apple",
"description": "Leading technology company known for iPhones and MacBooks.",
"products_count": 150,
"created_at": "2023-01-15T10:00:00Z",
"updated_at": "2023-06-20T12:30:00Z"
}

Notes

    • The image field may be null if no image is associated with the brand.
    • The description field may be empty if no description is available.
    • The products_count field indicates how many active products are associated with the brand.