Create a category
POST
/categories/add
const url = 'https://acme.mykreezalid.com/api/v1/categories/add';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"title":"Shoes","parent_id":4242,"description":"example","slug":"shoes","external_id":"example"}'};
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://acme.mykreezalid.com/api/v1/categories/add \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "title": "Shoes", "parent_id": 4242, "description": "example", "slug": "shoes", "external_id": "example" }'Creates a listing category. title is required. The response always has the HTTP status 200: read success to know whether the category was created. On failure, message is either a sentence or an object listing the invalid fields.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
title
required
string
Example
Shoesparent_id
Parent category, to create a sub-category
integer
Example
4242description
string
slug
string
Example
shoesexternal_id
Your own reference for the category
string
Responses
Section titled “Responses”Result of the creation
Media typeapplication/json
object
id
Identifier of the new category, null on failure
integer
success
boolean
message
Category created, or the reason of the failure
Example
{ "id": 4242, "success": true, "message": "Category created"}Missing or wrong API credentials