V1 and V2Categories

Update a product category

PATCH
/api/v1/categories/product/{category_id}

Using this verb you can change some of the properties of any category.

Allowed properties:

PropertyDescription
nameCategory name
parent_idNew parent category id. Use emtpy string to make it root category
sort_childrenReorder subcategories

Note: parent_id and sort_children are not allowed in the same request.

Moving Categories

Convert to root category (a.k.a first level categories)

You must issue a patch request to https://pim.plytix.com/api/v1/categories/product/categoryId (see examples) specifiying parent_id as empty string, i.e. {"parent_id": ""}

Move as subcategory of another category

You must issue a patch request to https://pim.plytix.com/api/v1/categories/product/categoryId (see examples) specifiying parent_id as new parent category id, i.e. {"parent_id": "new parent category here"}

Sorting Categories

Sorting Root Categories

When patching root categories (a.k.a first level categories) only reorder is allowed and must be done under the special endpoint https://pim.plytix.com/api/v1/categories/product/root, 200 status code is returned upon successful response and empty data array is returned.

Sorting Subcategories

A patch request must be issued to parent ID category including in its body a dictionary with ALL subcategories in desired order, you are not allowed to make partial orders or add new categories or this operations will return 422 error code.

{ "sort_children": ["<subcategory_id>", "<subcategory_id>"] }

Authorization

bearerAuth
AuthorizationBearer <token>

Obtain a token via POST /auth/api/get-token (15 minute lifetime), then send it as Authorization: Bearer <token>.

In: header

Path Parameters

category_id*string

Response Body

application/json

curl -X PATCH 'https://example.com/api/v1/categories/product/string'
{  "data": [    {      "id": "5cfa0c1e3da03100019ba90f",      "modified": "2019-06-07T07:05:06.959196+00:00",      "n_children": 0,      "name": "Apron Bamboo",      "order": "1",      "parents_ids": [        "5cfa05273da03100019ba90e"      ],      "path": [        "Kitchen Sinks",        "Apron Bamboo"      ],      "slug": "apron-bamboo"    }  ]}