Skip to main content

Create Multiple Categories

Creates several categories in a single request. This is useful when importing a catalog from another system.

HTTP Request​

  • URL: /categories/multiple
  • Method: POST
  • Headers:
    • accessToken: Required. Your API access token.
    • Content-Type: application/json
  • Required scope: READ_WRITE_CATEGORY

Request Body​

Send a JSON array. Each item in the array is a category with the following fields.

FieldTypeRequiredDescription
nameStringYesName of the category.
urlStringNoURL slug of the category page. If omitted, it is generated from name.
descriptionStringNoDescription of the category. Can be empty.
parentCategoryStringNoID of the parent category, or null for a top-level category.
imageStringNoURL of the category image. The image is copied to your store's media library.
sortOrderNumberNoDisplay order. Lower numbers appear first. Default is 0.
isFeaturedBooleanNoWhether the category is featured. Default is false.
isShowNavBarBooleanNoWhether the category appears in the navigation bar. Default is false.
seoObjectNoSEO settings with pageTitle, metaKeywords and metaDescription.
metaFieldsArrayNoCustom field values, each with a code and a value. See Metafields.

cURL Example​

curl --location '<BASE_URL>/categories/multiple' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '[
{
"name": "Cordless Drills",
"parentCategory": "663a0cbe516313e5bc94aa87"
},
{
"name": "Impact Drivers",
"url": "impact-drivers",
"parentCategory": "663a0cbe516313e5bc94aa87"
}
]'

Response​

  • 200 OK: The categories were created successfully.
  • 400 Bad Request: The access token is missing, invalid or lacks the required scope, or the request body is not valid.

Sample JSON Response​

{
"success": true,
"message": "Categories added Successfully"
}

Response Details​

FieldTypeDescription
successBooleantrue when the categories were created.
messageStringConfirmation message.

Notes​

  • New categories are visible on the storefront.
  • The response does not include the new categories. Use Get All Categories to read them.