Skip to navigation

Create categories in batch

View as Markdown

Create or update multiple ecommerce categories in a single request. The categories array accepts up to 100 category objects, each requiring a unique id. When updateEnabled is false (the default), all categories are inserted as new; if any ID already exists, a 400 error is returned. When updateEnabled is true, existing categories are updated and new ones are created via upsert. Duplicate IDs within the same request payload are rejected. The response returns the count of created and updated categories.

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

OR
AuthorizationBearer

OAuth 2.0 client_credentials (machine-to-machine) grant. Exchange your app’s client_id/client_secret for a short-lived Bearer token.

Request

Values to create a batch of categories
categorieslist of objectsRequired
array of categories objects
updateEnabledbooleanOptional

Facilitate to update the existing categories in the same request (updateEnabled = true)

Response

Category created and updated
createdCountlongOptional
Number of the new created categories
updatedCountlongOptional
Number of the existing categories updated

Errors

400
Bad Request Error