This API enables you to create attributes for your products. Product attributes are additional, configurable properties used to describe and classify products beyond core fields like SKU, price, brand, size, color, and category.
- Batch processing: You can add up to 100 attributes per API request.
- Capacity: By default, you can create up to 30 attributes for an organization. To increase this limit, please contact the Capillary Product support team.
Example request
curl --location 'https://{Host}/v2/product/attributes' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlcmFqa3Jpc2huYTpkY2VhNmU1ODlhM2U0M2JhODdkMTFkMTM2ODI2NmMxOQ==' \
--header 'Cookie: _cfu1_rpjmFeUA-1764931787098-0.0.1.1-604800000' \
--data '[
{
"code": "producttype",
"name": "type",
"type": "String",
"ouCode": "krishna.ou1"
},
{
"ouCode": "krishna.ou1",
"code": "productcolour",
"name": "colour",
"type": "String"
}
]'Prerequisites
- Access Group: You must have WRITE access to the Product resource.
- OU Configuration: If you intend to scope attributes to specific Organization Units (OUs), ensure OU support for product entities is enabled.
Body parameters
Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Defines the unique identifier for the attribute. A maximum of 50 characters is supported |
name | string | Yes | Defines a display name of the attribute. There is no strict character limit. |
type | string | No | Defines the data type of the attribute that is assigned to a product. |
ouCode | string | No | The OU code to scope the attribute. If omitted, the attribute is created at the org level (ouId = -1). |
defaultValueId | long | No | Defines an ID of an existing attribute value to be set as the default. |
API Quick Reference
{{host_v2_product_attributes}}
└─ {{RequestBody}} (Batch Array)
├─ {{code}} (string)
├─ {{name}} (string)
├─ {{type}} (string)
├─ {{ouCode}} (string)
├─ {{defaultValueId}} (long)
└─ {{ResponseBody}}
├─ {{created}} []
│ ├─ {{Id}} (integer)
│ ├─ {{OuId}} (integer)
│ └─ {{Code}} (string)
├─ {{summary}}
│ ├─ {{totalRequested}} (integer)
│ ├─ {{successCount}} (integer)
│ └─ {{failureCount}} (integer)
├─ {{warnings}} []
└─ {{errors}} []Example response
{
"created": [
{
"id": 91459,
"ouId": 50025951,
"code": "productcolour123"
},
{
"id": 91458,
"ouId": 50025951,
"code": "producttype122"
}
],
"summary": {
"totalRequested": 2,
"successCount": 2,
"failureCount": 0
},
"warnings": [],
"errors": []
}Response parameters
| Field | Type | Description |
|---|---|---|
| created | array | Indicates the list of successfully created brand objects. |
| .id | integer | Indicates the system-generated unique ID for the brand. |
| .ouId | integer | Indicates the ID of the Organization Unit (-1 for Org level). |
| .code | string | Indicates the brand code is provided in the request. |
| summary | object | Represents the high-level statistics and meta-information for the bulk operation. |
| .totalRequested | integer | Specifies the total count of brand records submitted in the request payload. |
| .successCount | integer | Tracks the number of brand entities that passed validation and were successfully created. |
| .failureCount | integer | Denotes the number of brand records that failed validation and were rejected. |
| warnings | array | Highlights non-blocking issues or ignored parameters encountered during processing. |
| errors | array | List of error objects for failed records. |
Error codes
| Code | Description |
|---|---|
| 201 | Created: All brands successfully created. |
| 207 | Multi-Status: Partial success. Check the errors array for details. |
| 400 | Bad Request: Validation failed for all records. |
| 917 | Brand code exceeds the maximum length of 50 characters. |
| 9205 | Request exceeds the limit of 100 brands. |
| 9209 | Duplicate brand codes found in the same request. |
| 9210 | The specified parentCode does not exist. |
| 9212 | Hierarchy depth exceeds the 5-level limit. |
