Create Multiple Brands
Creates several brands in a single request. This is useful when importing brands from another system.
HTTP Request
- URL:
/brands/multiple - Method:
POST - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope: None. Any valid access token can call this endpoint.
Request Body
Send a JSON array. Each item in the array is a brand with the following fields.
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name of the brand. |
url | String | No | URL slug of the brand page. If omitted, it is generated from name. |
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. Default is 0. |
isFeatured | Boolean | No | Whether the brand is featured. Default is false. |
isShow | Boolean | No | Whether the brand is visible on the storefront. Default is true. |
isShowNavBar | Boolean | No | Whether the brand appears in the navigation bar. Default is false. |
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 '<BASE_URL>/brands/multiple' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[
{
"name": "Acme Tools",
"url": "acme-tools",
"sortOrder": 1,
"isFeatured": true
},
{
"name": "Northwind Hardware",
"description": "Fasteners and fixings.",
"metaFields": [
{ "code": "country_of_origin", "value": "Japan" }
]
}
]'
Response
- 200 OK: The brands were created successfully.
- 400 Bad Request: The access token is missing or invalid, or the request body is not valid. No brands are created.
Sample JSON Response
{
"success": true,
"message": "Brands added successfully",
"data": [
{
"id": "663a0f1e4587085935a4fa21",
"name": "Acme Tools",
"url": "acme-tools",
"productCount": 0,
"sortOrder": 1,
"isFeatured": true,
"isShow": true,
"isShowNavBar": false,
"seo": {},
"metaFields": [],
"createdAt": "2024-05-07T11:13:02.066Z",
"updatedAt": "2024-05-07T11:13:02.066Z"
},
{
"id": "663a0f1e4587085935a4fa22",
"name": "Northwind Hardware",
"url": "northwind-hardware",
"description": "Fasteners and fixings.",
"productCount": 0,
"sortOrder": 0,
"isFeatured": false,
"isShow": true,
"isShowNavBar": false,
"seo": {},
"metaFields": [
{
"metaFieldId": "6650c2a1f1d2e83a1b9c0d11",
"code": "country_of_origin",
"label": "Country of Origin",
"displayStorefront": true,
"value": "Japan",
"valueType": "text"
}
],
"createdAt": "2024-05-07T11:13:02.066Z",
"updatedAt": "2024-05-07T11:13:02.066Z"
}
]
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | true when the brands were created. |
message | String | Confirmation message. |
data | Array | The new brands, in the same order as the request. See Get Single Brand for the brand fields. |
Notes
productCountstarts at0for every new brand.