Salesly API
API Reference

Create a product category

POST
/product-categories

Authorization

x-api-key<token>

Your tenant API key

In: header

Request Body

application/jsonRequired
name
Required
string
reference
Required
string
parent_idinteger

Parent category ID. Omit or 0 for root category.

curl -X POST "https://rest.salesly.app/api/v1/developers/product-categories" \
  -H "x-api-key: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "reference": "string",
    "parent_id": 0
  }'

Category created

{
  "data": {
    "id": 0,
    "name": "string",
    "reference": "string",
    "parent_id": 0,
    "has_products": true,
    "has_objectives": true,
    "children": [
      {
        "id": 0,
        "name": "string",
        "reference": "string",
        "parent_id": 0,
        "has_products": true,
        "has_objectives": true,
        "children": [],
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z"
      }
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}