Update Product Attribute
Updates an existing product attribute.
HTTP Request
PATCH/api/products/attributes/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff with AttributePermission or Admin
- Permission Code: 1823
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the product attribute |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | No | Name of the product attribute (unique) |
| description | String | No | Description of the product attribute(nullable) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Update a specific product attribute
4response = requests.patch('http://www.example.com/api/products/attributes/456',
5 headers={'Authorization': 'Token <your_api_key>'},
6 json={
7 "description": "some new description"
8 }
9)
10
11print(response.json())1# Update a specific product attribute
2curl -X PATCH "http://www.example.com/api/products/123/attributes/456" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
6 "name": "some new name"
7}'Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the product attribute |
| name | String | Name of the attribute(unique) |
| description | Object | Description of the attribute |
| created_at | String (ISO 8601) | Timestamp when product attribute was created |
| updated_at | String (ISO 8601) | Timestamp when product attribute was last updated |
Example Response
{
"id": 5,
"name": "size",
"description": "width and height",
"created_at": "2025-12-24T16:14:44.180013Z",
"updated_at": "2025-12-24T16:15:05.503898Z"
}