Get Single Brand
This endpoint retrieves the details of a specific brand by its ID.
Endpoint
- URL:
/brands/{id} - Method:
GET
Replace {id} with the specific brand ID you want to retrieve.
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the brand to be retrieved. |
Example Request
Here is an example using curl to retrieve a brand:
curl --location '<BASE-URL>/brands/brand_id_here' \
--header 'accessToken: <ACCESS-TOKEN>'
Note
- Replace the placeholder in the URL with the actual brand ID.
- Ensure you include a valid
accessTokenin the request to authenticate.
Response
- Status Code: 200 OK
Success Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the request was successful. |
data | object | Contains the details of the requested brand. |
Example Success Response
{
"success": true,
"data": {
"id": "brand_id",
"name": "Brand Name",
"url": "brand-url",
"description": "Brand description",
"image": "image_url",
"productCount": 10,
"sortOrder": 0,
"isFeatured": false,
"isShow": true,
"isShowNavBar": false,
"seo": {
"pageTitle": "Brand Page Title",
"metaKeywords": "keywords",
"metaDescription": "description"
},
"metaFields": [],
"createdAt": "2024-05-07T11:13:02.066Z",
"updatedAt": "2024-10-09T13:05:59.036Z"
}
}
Brand Data Object
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the brand. |
name | string | The name of the brand. |
url | string | URL-friendly slug for the brand. |
description | string | A brief description of the brand. |
image | string | URL to the brand's main image. |
productCount | number | Number of products associated with this brand. |
sortOrder | number | Order for sorting brands. Lower numbers appear first. |
isFeatured | boolean | Whether the brand is marked as featured. |
isShow | boolean | Whether the brand is visible. |
isShowNavBar | boolean | Whether the brand appears in the navigation bar. |
seo | object | SEO metadata for the brand page. |
metaFields | array | Custom metadata fields associated with the brand. |
createdAt | date | Timestamp when the brand was created. |
updatedAt | date | Timestamp when the brand was last updated. |
SEO Object
| Field | Type | Description |
|---|---|---|
pageTitle | string | Title for the brand page. |
metaKeywords | string | Meta keywords for SEO. |
metaDescription | string | Meta description for SEO. |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Provided data is invalid or malformed. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 404 | Not Found: Brand with specified ID does not exist. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Ensure the ID of the brand you wish to retrieve is valid and exists.
- You must provide a valid
accessTokenfor authentication.