Update Brand
Updates an existing brand. Only the fields you send are changed; all other fields keep their current values.
HTTP Request
- URL:
/brands/{id} - Method:
PUT - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope: None. Any valid access token can call this endpoint.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the brand to update. |
Request Body
Send a JSON object with the fields you want to change. At least one field is required.
| Field | Type | Required | Description |
|---|---|---|---|
name | String | No | Name of the brand. |
url | String | No | URL slug of the brand page. It is converted to lowercase with hyphens. |
description | String | No | Description of the brand. Can be empty or null. |
image | String | No | URL of the brand image. The image is copied to your store's media library. |
sortOrder | Number | No | Display order. Lower numbers appear first. |
isFeatured | Boolean | No | Whether the brand is featured. |
isShow | Boolean | No | Whether the brand is visible on the storefront. |
isShowNavBar | Boolean | No | Whether the brand appears in the navigation bar. |
seo | Object | No | SEO settings with pageTitle, metaKeywords and metaDescription. |
metaFields | Array | No | Custom field values, each with a code and a value. See Metafields. |
cURL Example
curl --location --request PUT '<BASE_URL>/brands/663a0f1e4587085935a4fa21' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"description": "Hand tools, power tools and accessories.",
"sortOrder": 2,
"isShowNavBar": true
}'
Response
- 200 OK: The request was processed. Check
successto confirm the brand was updated. - 400 Bad Request: The access token is missing or invalid, the brand ID is not valid, or the request body is not valid.
Sample JSON Response
{
"success": true,
"message": "Brand updated successfully",
"data": {
"id": "663a0f1e4587085935a4fa21",
"name": "Acme Tools",
"url": "acme-tools",
"description": "Hand tools, power tools and accessories.",
"image": "https://cdn.example.com/brands/acme-tools.webp",
"productCount": 128,
"sortOrder": 2,
"isFeatured": true,
"isShow": true,
"isShowNavBar": true,
"seo": {
"pageTitle": "Acme Tools",
"metaKeywords": "acme, tools",
"metaDescription": "Shop Acme Tools products."
},
"metaFields": [],
"createdAt": "2024-05-07T11:13:02.066Z",
"updatedAt": "2024-10-21T08:42:17.512Z"
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | true when the brand was updated. |
message | String | Confirmation message. |
data | Object | The updated brand. See Get Single Brand for its fields. |
Notes
- If no brand matches the ID, the response has
success: falseand the messageBrand not exists!. seoreplaces the whole SEO object, so include every SEO field you want to keep.productCountis maintained automatically and cannot be set directly.