Add Attributes

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

Use this API to create custom product attributes. Product attributes define additional properties that describe and classify products beyond core fields such as SKU, price, brand, and category.

Attributes act as the metadata layer of your catalogue. You can use them to model characteristics such as material, size, season, or any custom property required by your business.

What this API supports

  • Bulk creation of attributes (up to 100 per request)
  • Definition of attribute data types (String, Int, Double, Boolean)
  • Optional OU-scoped attribute creation
  • Setting a default value for an attribute
  • Creating a default value inline using valueCode

Limits and configuration

  • You can create up to 100 attributes per request. This limit is controlled by CONF_PRODUCT_CREATE_UPDATE_BATCH_SIZE.
  • By default, an organisation can create up to 30 custom attributes. This limit is controlled by org_product_custom_attribute_limit.
  • You can raise a JIRA ticket to modify these configuration values.

Default and OU behaviour

  • If type is not provided, the API defaults it to String and returns warning code 10209.
  • If ouCode is not provided, the attribute is created at the organisation level (ouId = -1).
  • OU-scoped attributes require OU support to be enabled.
  • Attribute codes are immutable after creation.

Example request

curl --location 'https://{host}.api.capillarytech.com/v2/product/attributes' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <auth_token>' \
--data '[
  {
    "code": "material_type",
    "name": "Material Type",
    "type": "String"
  },
  {
    "ouCode": "zone_north_01",
    "code": "seasonal_stock",
    "name": "Seasonal Stock",
    "type": "Int",
    "defaultValueId": 101
  }
]'

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

FieldTypeRequiredDescription
codestringYesDefines the unique identifier for the attribute. Maximum 30 characters are supported. Codes are validated case-insensitively. For example, "ATTRIBUTE1" and "attribute1" are treated as duplicates. The same code can exist for different organizational units (ouCode).
namestringYesDefines a display name of the attribute. There is no strict character limit.
typestringOptionalSpecifies the data type of the attribute.
Supported values: String, Int, Double, Boolean. Defaults to String.
ouCodestringOptionalThe OU code to scope the attribute. If omitted, the attribute is created at the org level (ouId = -1). Specifies the concept code of the organisation unit. This is applicable only if OU support for product inventory is enabled. For more information, see OU support for product inventory.
defaultValueIdlongOptionalSpecifies an ID of an existing attribute value to be set as the default.
valueCodestringOptionalCreates an attribute value with this code and sets it as the default value in a single API call. Maximum 30 characters. If the value exceeds this limit, the attribute is created but the default value is not set, and warning code 10252 is returned.

API Quick Reference

{{https://{host}.api.capillarytech.com/v2/product/attributes}}
   └─ {{RequestBody}} (Batch Array)
      ├─ {{code}} (string)
      ├─ {{name}} (string)
      ├─ {{type}} (string)
      ├─ {{ouCode}} (string)
      ├─ {{defaultValueId}} (long)
      ├─ {{valueCode}} (string)
      └─ {{ResponseBody}}
          ├─ {{created}} []
          │   ├─ {{responseId}} (integer)
          │   ├─ {{responseOuId}} (integer)
          │   └─ {{responseCode}} (string)
          ├─ {{summary}}
          │   ├─ {{totalRequested}} (integer)
          │   ├─ {{successCount}} (integer)
          │   └─ {{failureCount}} (integer)
          ├─ {{warnings}} []
          └─ {{errors}} []

Example response

{
    "created": [
        {
            "id": 91459,
            "ouId": 50025951,
            "code": "productcolour"
        },
        {
            "id": 91458,
            "ouId": 50025951,
            "code": "producttype"
        }
    ],
    "summary": {
        "totalRequested": 2,
        "successCount": 2,
        "failureCount": 0
    },
    "warnings": [],
    "errors": []
}

Response parameters

FieldTypeDescription
createdarrayContains a list of successfully created product attribute objects.
.idlongSpecifies the auto-generated unique identifier for the attribute.
.ouIdintegerIndicates the ID of the Organization Unit (OU) where the attribute was created.
.codestringDefines the unique attribute code provided in the request.
.ouCodestringOrganization unit code. Only included if the brand belongs to a specific OU (not returned for organization-level brands where ouId = -1).
summaryobjectProvides a statistical overview of the results of the bulk operation.
.totalRequestedintegerSpecifies the total number of attributes processed in the request.
.successCountintegerIndicates the total number of attributes successfully created.
.failureCountintegerIndicates the total number of attributes that failed validation or creation.
warningsarrayContains non-blocking notices, such as warning code 10209 for missing types that were defaulted to String.
errorsarrayContains detailed error information for each attribute that failed validation.

Error codes

CodeDescription
9182Organization-level attribute limit reached (Default 30). Contact support to increase the limit.
10001Invalid ouCode provided. Use a valid concept code.
10002OU level product filtering is disabled for your organization, but an ouCode was provided.
10003Duplicate attribute code found within the same request payload. Use a unique attribute code within all objects.
10201At least one attribute must be present in the request.
10202Batch size exceeded. A maximum of 100 attributes can be processed in a single request.
10203Attribute code cannot be empty. Provide a valid string for the code field.
10204Attribute code already exists. Use a unique attribute code.
10205Attribute code exceeds the maximum length of 30 characters.
10206Attribute name cannot be empty. Provide a valid string for the name field.
10207Attribute name exceeds the maximum length of 50 characters.
10208Invalid attribute type provided. Use a valid attribute type such as String, Int, Double or Boolean.

Warning codes

CodeDescription
10209Attribute type was missing and defaulted to String.
10210The defaultValueId provided does not exist. The attribute is created without setting the default value.
10252The valueCode exceeds the maximum length of 30 characters. The attribute is created but the default value is not set.

Body Params

Request body

Responses

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json