Skip to main content

Update Attribute Values

Updates an existing value for a specific product attribute.

HTTP Request

PATCH/api/products/attributes/:attribute_id/values/:value_id

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
attribute_idIntegerYesUnique ID of the attribute
value_idIntegerYesUnique ID of the attribute value

Request Body

FieldTypeRequiredDescription
valueStringYesThe value of the attribute

Example Requests

1import requests
2
3# Create a new attribute value
4response = requests.post('http://www.example.com/api/products/attributes/123/values',
5  headers={'Authorization': 'Token <your_api_key>'},
6  json={'value': 'New Attribute Value'}
7)
8print(response.json())

Status Codes

CodeDescription
201Attribute value created successfully
400Bad request — invalid input
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Not found — attribute does not exist
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the attribute value
valueStringThe value of the attribute
created_atString (ISO 8601)Timestamp when attribute value was created
updated_atString (ISO 8601)Timestamp when attribute value was last updated