Update Attribute Values

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Use this API to update one or more existing product attribute values in bulk. Attribute values represent the allowed options under a product attribute, such as Red under Color or Cotton under Material.

You can update up to 100 attribute values per request. This batch limit is controlled by the CONF_PRODUCT_CREATE_UPDATE_BATCH_SIZE configuration.

Each attribute value is identified using:

  • code (attribute value code)
  • attributeCode (parent attribute code)
  • ouCode (if OU-scoped)

These fields locate the target record and cannot be modified.

What you can update

  • name

The API updates only the fields you provide in the request. Omitted fields remain unchanged.

What you cannot update

  • code (immutable identifier)
  • attributeCode (parent attribute cannot be changed)
  • ouCode (scope cannot be changed after creation)

To move an attribute value to a different attribute, delete it and recreate it under the correct attribute.

Default and validation behaviour

  • If the attribute does not exist, the API returns error 10250.
  • If the attribute value does not exist, the API returns error 10251.
  • If some records succeed and others fail, the API returns 207 Partial Success with summary details.
  • Duplicate value codes within the same request result in validation errors.

Organisation unit (OU) behaviour

  • If ouCode is provided, the API updates the OU-scoped attribute value.
  • If ouCode is not provided, the API updates the organisation-level value (ouId = -1).
  • OU scope cannot be changed using this API.

Example request

curl --location --request PUT 'https://{Host}/v2/product/attributeValues' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlcmFqaVhNmODdkMTFkMTM2ODI2NmMxOQ==' \
--data '[
  {
    "code": "COTTON",
    "name": "Premium Cotton",
    "attributeCode": "Material",
    "ouCode": "krishna.ou1"
  }
]'
curl --location --request PUT 'https://{Host}/v2/product/attributeValues' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlcmFqaVhNmODdkMTFkMTM2ODI2NmMxOQ==' \
--data '[
    {
        "code": "COTTON",
        "name": "Premium Cotton",
        "attributeCode": "Material",
        "ouCode": "krishna.ou1"
    },
    {
        "code": "POLYESTER",
        "name": "Recycled Polyester",
        "attributeCode": "Material",
        "ouCode": "krishna.ou1"
    },
    {
        "code": "SILK",
        "name": "Natural Silk",
        "attributeCode": "Material",
        "ouCode": "krishna.ou1"
    }
]'
curl --location --request PUT 'https://{Host}/v2/product/attributeValues' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic a3Jpc2huYS50aWxsMDE6MjAyY2I5wNzE1MmQyMzRiNzA=' \
--data '[
    {
        "code": "WOOL",
        "name": "Merino Wool",
        "attributeCode": "Material",
        "ouCode": "krishna.ou1"
    }
]'
curl --location --request PUT 'https://{Host}/v2/product/attributeValues' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic a3Jpc2huYS50aWxsMDE6MjAyY2I5wNzE1MmQyMzRiNzA=' \
--data '[
    {
        "code": "RED",
        "name": "Cherry Red",
        "attributeCode": "Color"
    }
]'

Prerequisites

  • Access Group: WRITE access to Product resource
  • Authorization: Basic or OAuth token

Body parameters

The body should be a JSON array of attribute value objects.

FieldTypeRequiredDescriptionUpdatable
codestringYesSpecifies the unique identifier of the attribute value to update. This field identifies which attribute value to update and cannot be changed.No
namestringNoSpecifies the display name of the attribute value (e.g., "Premium Cotton"). Supports up to 100 alphanumeric characters.Yes
attributeCodestringYesIdentifies the parent attribute code. Required to locate the attribute value. This field cannot be modified.No
ouCodestringNoIdentifies the organization unit code. Required if the attribute value was created at the OU level. If not provided, defaults to the organization level.No

API Quick Reference

{{PUT /v2/product/attributeValues}}
   └─ {{RequestBody}} (Batch Array)
      ├─ {{code}} (string)
      ├─ {{name}} (string)
      ├─ {{attributeCode}} (string)
      ├─ {{ouCode}} (string)
      └─ {{ResponseBody}}
          ├─ {{updated}} []
          │   ├─ {{responseId}} (integer)
          │   ├─ {{responseOuId}} (integer)
          │   ├─ {{responseCode}} (string)
          │   └─ {{responseOuCode}} (string)
          ├─ {{summary}}
          │   ├─ {{totalRequested}} (integer)
          │   ├─ {{successCount}} (integer)
          │   └─ {{failureCount}} (integer)
          ├─ {{warnings}} []
          └─ {{errors}} []

Example response

{
    "updated": [
        {
            "ouCode": "krishna.ou1",
            "id": 13544113,
            "ouId": 50025951,
            "code": "COTTON"
        },
        {
            "ouCode": "krishna.ou1",
            "id": 13544114,
            "ouId": 50025951,
            "code": "POLYESTER"
        },
        {
            "ouCode": "krishna.ou1",
            "id": 13544115,
            "ouId": 50025951,
            "code": "SILK"
        }
    ],
    "summary": {
        "totalRequested": 3,
        "successCount": 3,
        "failureCount": 0
    },
    "warnings": [],
    "errors": []
}
{
    "updated": [],
    "summary": {
        "totalRequested": 1,
        "successCount": 0,
        "failureCount": 1
    },
    "warnings": [],
    "errors": [
        {
            "code": 10251,
            "message": "Attribute value not found",
            "entityCode": "NONEXISTENT_VALUE",
            "ouCode": "krishna.ou1"
        }
    ]
}
{
    "updated": [],
    "summary": {
        "totalRequested": 1,
        "successCount": 0,
        "failureCount": 1
    },
    "warnings": [],
    "errors": [
        {
            "code": 10250,
            "message": "Attribute not found with code: INVALID_ATTR",
            "entityCode": "COTTON",
            "ouCode": "krishna.ou1"
        }
    ]
}
{
    "updated": [
        {
            "ouCode": "krishna.ou1",
            "id": 13544113,
            "ouId": 50025951,
            "code": "COTTON"
        }
    ],
    "summary": {
        "totalRequested": 2,
        "successCount": 1,
        "failureCount": 1
    },
    "warnings": [],
    "errors": [
        {
            "code": 10251,
            "message": "Attribute value not found",
            "entityCode": "NONEXISTENT_VALUE",
            "ouCode": "krishna.ou1"
        }
    ]
}

Response parameters

FieldTypeDescription
updatedarrayContains the array of successfully updated attribute value objects.
.idintegerIndicates the unique database ID of the updated attribute value.
.ouIdintegerSpecifies the Organization Unit ID, returning -1 if the attribute value is at the organization level.
.codestringSpecifies the unique code of the attribute value.
.ouCodestringSpecifies the organization unit code (if applicable).
summaryobjectProvides a summary of the bulk operation results.
.totalRequestedintegerIndicates the total number of attribute values submitted in the request.
.successCountintegerIndicates the number of attribute values that were successfully updated.
.failureCountintegerIndicates the number of attribute values that failed validation.
errorsarrayContains an array of error objects for any operations that failed.
.codeintegerSpecifies the error code associated with the failure.
.messagestringProvides a human-readable error message explaining why the operation failed.
.entityCodestringSpecifies the attribute value code that failed.
.ouCodestringSpecifies the organization unit code associated with the failed attribute value.
warningsarrayContains an array of warning objects for non-fatal issues encountered during processing.

Error codes

CodeDescription
10001Invalid ouCode provided. Use a valid concept code.
10002OU level product filtering is disabled for your organization, but an ouCode was provided.
10003Duplicate attribute value codes were found within the same request. Ensure every item in the array has a unique code.
10121The attribute value with the specified code was not found. Verify the attribute value code exists.
10201The request body is empty. Include at least one attribute value object in the array.
10202The request exceeds the processing limit. Reduce the batch size to 100 attribute values or fewer.
10203An attribute code is missing. Provide a valid, non-empty string for the attributeCode field.
10205Attribute code exceeds the maximum length of 30 characters. Shorten the attributeCode.
10212The attribute with the specified code was not found. Verify the attribute code exists before attempting to update.
10251An attribute value code is missing. Provide a valid, non-empty string for the code field.
10252Attribute value code exceeds the maximum length of 30 characters. Provide a shorter value code.
10253The attribute value name cannot be empty if provided. Provide a valid name string.
10254The name length exceeds the maximum limit. Shorten the attribute value name.

Body Params
Headers
string
required
Defaults to Basic bmVlcmFqa3Jpc2huYTpkY2VhNmU1ODlhM2U0M2JhODdkMTFkMTM2ODI2NmMx
Response
200

Successful response

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!