Batch Create Categories
POST
/v1/categories/{companyId}/{brandId}/batch-create
const url = 'https://api.dev.caspeco.net/api/am/v1/categories/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/batch-create';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"items":[{"name":"example","description":"example","externalId":"example","parentExternalId":"example","parentCategoryId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.dev.caspeco.net/api/am/v1/categories/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/batch-create \ --header 'Content-Type: application/json' \ --data '{ "items": [ { "name": "example", "description": "example", "externalId": "example", "parentExternalId": "example", "parentCategoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] }'Creates up to 50 categories in a single all-or-nothing batch
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”companyId
required
string format: uuid
brandId
required
string format: uuid
Request Body
Section titled “Request Body”object
items
required
Array<object>
object
name
required
string
description
string
externalId
string
parentExternalId
string
parentCategoryId
string format: uuid
Examplegenerated
{ "items": [ { "name": "example", "description": "example", "externalId": "example", "parentExternalId": "example", "parentCategoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}object
items
required
Array<object>
object
name
required
string
description
string
externalId
string
parentExternalId
string
parentCategoryId
string format: uuid
Examplegenerated
{ "items": [ { "name": "example", "description": "example", "externalId": "example", "parentExternalId": "example", "parentCategoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}object
items
required
Array<object>
object
name
required
string
description
string
externalId
string
parentExternalId
string
parentCategoryId
string format: uuid
Examplegenerated
{ "items": [ { "name": "example", "description": "example", "externalId": "example", "parentExternalId": "example", "parentCategoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}Responses
Section titled “Responses”Returns created categories
object
items
required
Array<object>
object
categoryId
required
string format: uuid
parentCategoryId
string format: uuid
name
required
string
description
required
string
externalId
string
parentExternalId
string
object
items
required
Array<object>
object
categoryId
required
string format: uuid
parentCategoryId
string format: uuid
name
required
string
description
required
string
externalId
string
parentExternalId
string
Examplegenerated
{ "items": [ { "categoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parentCategoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "externalId": "example", "parentExternalId": "example" } ]}object
items
required
Array<object>
object
categoryId
required
string format: uuid
parentCategoryId
string format: uuid
name
required
string
description
required
string
externalId
string
parentExternalId
string
Examplegenerated
{ "items": [ { "categoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parentCategoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "externalId": "example", "parentExternalId": "example" } ]}Bad Request
object
statusCode
integer format: int32
message
string
validationErrors
Array<object>
object
field
required
string
errorId
required
string
entity
string
object
statusCode
integer format: int32
message
string
validationErrors
Array<object>
object
field
required
string
errorId
required
string
entity
string
Examplegenerated
{ "statusCode": 1, "message": "example", "validationErrors": [ { "field": "example", "errorId": "example" } ], "entity": "example"}object
statusCode
integer format: int32
message
string
validationErrors
Array<object>
object
field
required
string
errorId
required
string
entity
string
Examplegenerated
{ "statusCode": 1, "message": "example", "validationErrors": [ { "field": "example", "errorId": "example" } ], "entity": "example"}Unauthorized
Forbidden
Internal Server Error