Edit a category
PATCH /api/category/v1/category/{categoryId}
enables you to edit a category's name and description.
Request schema
Method |
URL |
PATCH |
/api/category/v1/category/{categoryId} |
*indicates required parameters
Field |
Value Type |
Description |
*Authorization |
String |
Enter: Bearer access token. |
*Upc-Selected-Company |
Integer |
Company’s ID. Use the value returned in the id field received in response to the following request: GET /api/auth/v1/companies . |
*CategoryId |
Integer |
ID of the category you are editing. |
X-User-Id |
Text |
Enter the email address of the user being impersonated. This value is required if you are using a two-legged token. If you are using a three-legged token, then this field is not required. |
Request body
Field |
Value Type |
Description |
*name |
String |
New category name. |
description |
String |
New category description. |
Sample request body
{
"name": "Fasteners",
"description": "Fastening & Joining"
}
Response schema
Response body
200 response
Field |
Value Type |
Description |
id |
Integer |
Edited category ID. |
parentId |
Integer |
ID of parent category of the edited category. |
name |
String |
Edited category name. |
description |
String |
Edited category description. |
level |
Integer |
Category level in the category hierarchy. |
children |
Array of categories |
An array of subcategories, containing the same parameters as the main category (id, parentId, name, description, and level) for each. This API always returns null for this field. |
Sample response body
{
"id": 12,
"parentId": null,
"name": "Fasteners",
"description": "Fastening & Joining",
"level": 1,
"children": null
}