When to use this. Compliance categories are admin reference data that sit behind the
Compliance module. You create them once in Admin, and they then appear as a dropdown choice
whenever a user creates a certificate or compliance standard. Set these up before you start
creating certificates. Categories classify by product type (e.g. Textiles, Footwear),
while groups classify by purpose (e.g. Sustainability, Chain of Custody): they are
separate resources.
The workflow
Compliance categories are prerequisites for the Compliance module. The typical path is to create your category vocabulary, optionally assign user-defined IDs for import/export alignment, and then reference categories from certificates and standards.1
Create the categories
POST /api/compliance-categories with an array of one or more categories. Each category
needs only a name; add a userDefinedId if you need to match against an external system.2
List and verify
GET /api/compliance-categories to confirm all categories are in place. Filter by State,
Names, or Search if you have a large vocabulary.3
Retrieve a single category
GET /api/compliance-categories/{id} to inspect usedInStandard and
usedInCertificates: these counters tell you whether a category is safe to delete.4
Retire or remove
To stop offering the category to new certificates without losing history, set its state to
inactive. PATCH /api/compliance-categories/{id} with a JSON Patch document changes only
the state; PUT /api/compliance-categories/{id} is a full replace, so send the whole body
(name, state and the current userDefinedId). To hard-delete the category instead, call
DELETE /api/compliance-categories/{id} (blocked if usedInStandard > 0 or
usedInCertificates > 0). To update or delete several categories in one call, send an array
to PUT /api/compliance-categories with each item’s id: an item with state: "deleted" is
hard-deleted, and the updates and deletes commit together in one all-or-nothing transaction.Walkthrough
Create a compliance category for Footwear. The body is an array: one or many categories are created in a single all-or-nothing transaction.id: you
will need it when updating or deleting individual categories.
Field reference
Roles & permissions
Creating, updating and deleting compliance categories requires thecompliance permission at
admin level on a designer (brand) account: in practice the CompanyAdmin role. Requests from
supplier accounts are rejected. The Compliance module itself requires a Professional licence
subscription.
When things go wrong
Errors use the standard envelope (status: "error", a code, and error.details[]). Key
cases to handle:
- 409 Conflict:
DELETE, or a bulkPUTitem withstate: "deleted", is rejected whenusedInStandard > 0orusedInCertificates > 0. Check the counts withGET /api/compliance-categories/{id}first, then reassign or remove the references before deleting. A bulkPUTalso returns 409 when an item’snameoruserDefinedIdclashes with another category. - 400 validation_error:
nameandstateare required onPUT(a bulk item sent withstate: "deleted"needs onlyidandstate),nameis required onPOST, andstate: "deleted"is rejected onPOST, single-itemPUTandPATCH. A bulkPUTthat lists the sameidtwice is also rejected. - 403 authorization_error: the
idbelongs to another organisation. This applies toGET,PUTandPATCHon/api/compliance-categories/{id}, and to any item in a bulkPUT. - 404 resource_error: the
iddoes not exist.DELETEalso returns 404 for anidthat belongs to another organisation. In a bulkPUT, a missingidtakes precedence: the batch returns 404 even if another item would be a 403.
What to call next
Style categories
A parallel category vocabulary that organises styles: set these up alongside compliance
categories for a consistent admin structure.
Item categories
Category classification for items (materials, fabrics, trims).
Groups
Compliance groups organise certificates and standards by purpose, e.g. Sustainability or
Chain of Custody: the sibling resource to categories.
Size ranges
Another admin reference dataset needed before product data can be created.