Upsert a product subcategory
Create or update one product subcategory. Omit id to create; pass the id of an existing subcategory to update it. The URL and body shape are the same for both — a create returns 201, an update returns 200.
On create, both name and product_category_id are required, and the parent category must belong to your company. name must be unique within its parent category, compared case-insensitively (so "Flower" and "flower" collide), and may not contain restricted special characters.
The parent category is fixed at creation: product_category_id cannot be changed on update. Sending a different value on update is rejected; omit it (or send the same value) to keep it. To reclassify products under a different category, reassign the products themselves rather than re-parenting the subcategory.
Subcategories are a Distru-internal catalog taxonomy. Creating or renaming one reshapes how products are classified (via each product's subcategory) and feeds menus, price tiers, and retailer mapping, but it does not move inventory and is not synced to Metrc or BioTrack.
Required permission: settings_permissions_product_categories.
BearerAuthorizationBearer <token>API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.
application/json- body
id?stringID of the subcategory to update. Omit to create a new subcategory; when present, the matching subcategory owned by your company is updated and the response status is 200 instead of 201.
name*stringName of the subcategory. Required on create; on update, omit it to leave the current name unchanged. Must be unique within its parent category, compared case-insensitively ("Flower" and "flower" are treated as the same, and the colliding create/rename is rejected with a 400). May contain letters, digits, spaces, underscores, and the characters ~ # - $ / | % & ' ( ) .; any other special character is rejected.
product_category_id*stringID of the parent product category this subcategory belongs to; the category must be owned by your company. Required on create and fixed thereafter — it cannot be changed on update. On update, omit it or send the same value to keep it; a different value is rejected.
The updated product subcategory
*/*- response
A single product subcategory
data?A product subcategory
curl -X POST 'https://app.distru.com/public/v1/product-subcategories' \ -H 'Content-Type: application/json' \ -d '{ "name": "Gummies", "product_category_id": "00000000-0000-0000-0000-000000000041"}'{ "data": { "category": { "id": "string", "name": "string", "official_product_category_id": "string" }, "id": "string", "inserted_datetime": "string", "name": "string", "updated_datetime": "string" }}