POST /v1/sites/{siteId} /categories
Adds a category to a site, after its others. It starts on the site's default sales and purchase accounts. The response is the category, with the code to use from then on.
Needs Catalogue: write Changes live data
Headers Authorizationrequired
An API key from Automation > Access in the Dnero portal, sent as Authorization: Bearer <key>.
string
Idempotency-Key
A value you choose, unique to what this request creates: a UUID, or your own id for it. Sending it again with the same body returns the first response and creates nothing more. Required.
string · at most 255 characters
Body namerequired
The category's name. Unique among the site's categories.
string · 1–200 characters
active
False to create it retired. Defaults to true.
boolean
Responses 201 Created activerequired
False for a retired category, which is listed only with includeInactive.
boolean
coderequired
The category's code, the same at every site that has it.
string
namerequired
The category's name.
string
orderrequired
Where the category sits among the site's others, lowest first.
integer
defaultCourseCode
The course a product in this category goes to the kitchen with, unless the product says otherwise.
string
updatedAt
When the category last changed. Absent for one that has not changed since this was recorded.
string · date-time
curl JavaScript Python
curl -X POST "https://api.dev.dnerohq.com/v1/sites/{siteId}/categories" \
-H "Authorization: Bearer $DNERO_API_KEY " \
-H "Idempotency-Key: $( uuidgen )" \
-H "Content-Type: application/json" \
const response = await fetch ( 'https://api.dev.dnerohq.com/v1/sites/{siteId}/categories' , {
Authorization: `Bearer ${ process . env . DNERO_API_KEY }` ,
'Idempotency-Key' : crypto. randomUUID (),
'Content-Type' : 'application/json' ,
const data = await response. json ()
response = requests.post(
"https://api.dev.dnerohq.com/v1/sites/ {siteId} /categories" ,
headers = { "Authorization" : f "Bearer { os.environ[ 'DNERO_API_KEY' ] } " , "Idempotency-Key" : str (uuid.uuid4())},
201 Created application/json
"code" : "a1f0c5e2-7d3b-4c8e-9f21-6b0d4e7a9c13" ,
"defaultCourseCode" : "5c2e8a41-0b7f-4d6a-8e93-1f4c7b2d9a60" ,
"updatedAt" : "2026-10-20T03:15:00Z"
400 Bad Request application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#bad_request" ,
"detail" : "The request could not be read, for example malformed JSON." ,
401 Unauthorized application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#missing_key" ,
"detail" : "No API key was sent." ,
403 Forbidden application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#key_revoked" ,
"detail" : "The key was revoked or switched off in the Dnero portal." ,
404 Not Found application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#site_not_found" ,
"detail" : "The key does not reach that site, or there is no such site." ,
409 Conflict application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#idempotency_key_reused" ,
"detail" : "This `Idempotency-Key` was already used for a different request." ,
"code" : "idempotency_key_reused"
422 Unprocessable Entity application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#invalid_request" ,
"title" : "Unprocessable Entity" ,
"detail" : "The request was read but is not valid." ,
"code" : "invalid_request"
429 Too Many Requests application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#rate_limited" ,
"title" : "Too Many Requests" ,
"detail" : "The key has used its requests for this minute." ,
500 Internal Server Error application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#server_error" ,
"title" : "Internal Server Error" ,
"detail" : "Something went wrong on Dnero's side. It has been logged." ,
502 Bad Gateway application/problem+json
"type" : "https://developers.dnerohq.com/guides/errors/#upstream_unavailable" ,
"detail" : "Something Dnero depends on did not answer in time." ,
"code" : "upstream_unavailable"
Examples use this site's API host. Keep the key in $DNERO_API_KEY; never paste it into code.