Create New Brand
Creates a new brand and returns it. To create several brands at once, use Create Multiple Brands.
HTTP Request
- URL:
/brands - 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 object with the following fields.
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name of the brand. |
url | String | Yes | URL slug of the brand page on the storefront. |
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 for the brand page. See below. |
metaFields | Array | No | Custom field values. See below. |
SEO Object
| Field | Type | Required | Description |
|---|---|---|---|
pageTitle | String | No | Page title for the brand. |
metaKeywords | String | No | Meta keywords. |
metaDescription | String | No | Meta description. |
MetaFields Object
| Field | Type | Required | Description |
|---|---|---|---|
code | String | Yes | Code of an existing metafield. See Metafields. |
value | String, Number, Boolean or Array | No | Value to store for this metafield. |
cURL Example
curl --location '<BASE_URL>/brands' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Acme Tools",
"url": "acme-tools",
"description": "Professional-grade hand and power tools.",
"image": "https://images.example.com/acme-tools.png",
"isFeatured": true,
"seo": {
"pageTitle": "Acme Tools",
"metaKeywords": "acme, tools",
"metaDescription": "Shop Acme Tools products."
},
"metaFields": [
{ "code": "country_of_origin", "value": "Germany" }
]
}'
Response
- 200 OK: The brand was created successfully.
- 400 Bad Request: The access token is missing or invalid, or the request body is not valid (for example, a required field is missing or a metafield code does not exist).
Sample JSON Response
{
"success": true,
"message": "Brand added successfully",
"data": {
"id": "663a0f1e4587085935a4fa21",
"name": "Acme Tools",
"url": "acme-tools",
"description": "Professional-grade hand and power tools.",
"image": "https://cdn.example.com/brands/acme-tools.webp",
"productCount": 0,
"sortOrder": 0,
"isFeatured": true,
"isShow": true,
"isShowNavBar": false,
"seo": {
"pageTitle": "Acme Tools",
"metaKeywords": "acme, tools",
"metaDescription": "Shop Acme Tools products."
},
"metaFields": [
{
"metaFieldId": "6650c2a1f1d2e83a1b9c0d11",
"code": "country_of_origin",
"label": "Country of Origin",
"displayStorefront": true,
"value": "Germany",
"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 brand was created. |
message | String | Confirmation message. |
data | Object | The new brand. See Get Single Brand for its fields. |
Notes
productCountstarts at0and is updated as products are assigned to the brand.- Metafields sent with an empty value are skipped.