Skip to main content
POST/product-categories/

Create product category

You can create a product category.

Attributes

Optional unless marked required

custom_idstring
A unique identifier for the product which is provided by the client.
descriptionstring
A product category description.
namestringrequired
A category name.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/product-categories/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Outdoor gear",
"custom_id": "outdoor-gear",
"description": "Tents, backpacks and camping equipment."
}'

Response examples​

{
"id": 30,
"name": "my category",
"custom_id": "my_id",
"description": "category description"
}

Response fields​

Fields returned in the 201 Created response body.

idinteger
A unique identifier for the product which is given by User automatically.
namestring
A product name.
custom_idstring
A unique identifier for the product which is provided by the client. Usually related to the product’s SKU.
descriptionstring
A product category description.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.