Update a category
Admin and inventory manager. Renames a category and optionally moves it to a new slug. A changed slug cascades onto every medicine under it, and a slug or name clash is refused.
PUT
/api/v1/categories/{slug}Authorization
AuthorizationBearer token (JWT) · headerrequiredJWT from POST /api/v1/auth/login sent as Authorization Bearer.
Path parameters
slugstringrequiredThe category slug, which is its primary key.
Request body
requiredapplication/jsonnamestringmin length 1 · max length 80
slugstringmin length 1 · max length 80
Responses
200
Category updated
slugstringrequirednamestringrequiredmedicine_countintegerrequiredmin -9007199254740991 · max 9007199254740991
400
The body is invalid, nothing is supplied to update, or the slug has no letters or digits
detailstringrequired401
Not authenticated
detailstringrequired403
Caller is not an admin, inventory manager, or branch manager
detailstringrequired404
Category not found
detailstringrequired409
A category with that slug or name already exists
detailstringrequired