Skip to main content

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.

FieldTypeRequiredDescription
nameStringYesName of the brand.
urlStringYesURL slug of the brand page on the storefront.
descriptionStringNoDescription of the brand. Can be empty or null.
imageStringNoURL of the brand image. The image is copied to your store's media library.
sortOrderNumberNoDisplay order. Lower numbers appear first. Default is 0.
isFeaturedBooleanNoWhether the brand is featured. Default is false.
isShowBooleanNoWhether the brand is visible on the storefront. Default is true.
isShowNavBarBooleanNoWhether the brand appears in the navigation bar. Default is false.
seoObjectNoSEO settings for the brand page. See below.
metaFieldsArrayNoCustom field values. See below.

SEO Object​

FieldTypeRequiredDescription
pageTitleStringNoPage title for the brand.
metaKeywordsStringNoMeta keywords.
metaDescriptionStringNoMeta description.

MetaFields Object​

FieldTypeRequiredDescription
codeStringYesCode of an existing metafield. See Metafields.
valueString, Number, Boolean or ArrayNoValue 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​

FieldTypeDescription
successBooleantrue when the brand was created.
messageStringConfirmation message.
dataObjectThe new brand. See Get Single Brand for its fields.

Notes​

  • productCount starts at 0 and is updated as products are assigned to the brand.
  • Metafields sent with an empty value are skipped.