Edit a category attribute
PATCH /api/category_attribute/v1/{categoryAttributeId}
updates a categorization attribute with new values.
Request schema
Method | URL |
---|---|
PATCH | /api/category_attribute/v1/{categoryAttributeId} |
Request header
*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 . |
*CategoryAttributeId |
Integer | ID of the category attribute 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 |
---|---|---|
id |
Integer | ID of the category attribute you are editing. |
*categoryId |
Integer | ID of the category the attribute belongs to. |
*name |
String | The new name of the category attribute. |
*valueType |
String | The new type of the categorization attribute. Allowed inputs are:
|
listOfvalue |
Array of item values | This field is only set if the value type of the attribute is LOV . It takes an array of possible string values for the drop-down list. |
Sample request body
For all category attribute types except LOV:
{
"id": 9524,
"categoryId": 1271,
"name": "Fill weight",
"valueType": "FLOAT",
}
For the LOV category attribute type:
{
"id": 9525,
"categoryId": 1271,
"name": "Liner Material - new list",
"valueType": "LOV",
"listOfValue": [
{
"itemValue": "75% Brushed Poly Flannel"
},
{
"itemValue": "70B Poly Taffeta"
}
]
}
Response schema
Response body
201 response
Field | Value Type | Description |
---|---|---|
id |
Integer | Edited category attribute ID. |
categoryId |
Integer | The ID of the category that the attribute belongs to. |
name |
String | Edited category attribute name. |
valueType |
String | The value type of the edited category attribute. |
listOfValue |
Array of item values | Contains the list of item values edited for a drop-down list if the value type is LOV . Otherwise this returns null. Item values have the following parameters:
|
Sample response body
For all category attribute types except LOV:
{
"id": 9524,
"categoryId": 1271,
"name": "Fill weight",
"valueType": "FLOAT",
"listOfValue": null
}
For the LOV category attribute type:
{
"id": 9525,
"categoryId": 1271,
"name": "Liner Material - new list",
"valueType": "LOV",
"listOfValue": [
{
"id": 3150,
"attributeId": 9525,
"itemIndex": 1,
"itemValue": "75% Brushed Poly Flannel"
},
{
"id": 3151,
"attributeId": 9525,
"itemIndex": 2,
"itemValue": "70B Poly Taffeta"
}
]
}