Add Product Attribute value

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.
Supported values: String, Int, Double, Boolean. Defaults to String.

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

FieldTypeDescription
createdarrayIndicates the list of successfully created brand objects.
.idintegerIndicates the system-generated unique ID for the brand.
.ouIdintegerIndicates the ID of the Organization Unit (-1 for Org level).
.codestringIndicates the brand code is provided in the request.
summaryobjectRepresents the high-level statistics and meta-information for the bulk operation.
.totalRequestedintegerSpecifies the total count of brand records submitted in the request payload.
.successCountintegerTracks the number of brand entities that passed validation and were successfully created.
.failureCountintegerDenotes the number of brand records that failed validation and were rejected.
warningsarrayHighlights non-blocking issues or ignored parameters encountered during processing.
errorsarrayList of error objects for failed records.

Error codes

CodeDescription
201Created: All brands successfully created.
207Multi-Status: Partial success. Check the errors array for details.
400Bad Request: Validation failed for all records.
917Brand code exceeds the maximum length of 50 characters.
9205Request exceeds the limit of 100 brands.
9209Duplicate brand codes found in the same request.
9210The specified parentCode does not exist.
9212Hierarchy depth exceeds the 5-level limit.

Language
Click Try It! to start a request and see the response here!