API Playground

Create a new attribute for your active brand. This playground calls the live API and will modify your data.

Authentication Required

You need to Login to test the API playground

Create attribute

Create a new global or family attribute for the active brand.

Endpoint URL
POST https://api.commerceclarity.com/api/2026-05/attributes/create

Body parameters

ParameterTypeRequiredDescription
namestringRequiredHuman-readable attribute name.
attribute_idstringRequiredUnique identifier for the attribute within the brand.
typestringRequiredtext, rich-text, number, boolean, single-select, multi-select.
scopestringRequiredglobal or family.
descriptionstringOptionalOptional attribute description.
is_enabledbooleanOptionalWhether the attribute is active. Default true.
optionsarrayconditionalRequired for single-select / multi-select. Array of { action, value, value_id? }.
  options[].actionstringRequiredUse "new" when creating.
  options[].valuestringRequiredDisplay label (e.g. "Red"). A normalised key is derived automatically.
  options[].value_idstringOptionalOptional custom identifier for the option.
family_idsarrayconditionalRequired when scope = family. Family ids the attribute is linked to.

Request Examples

curl -X POST "https://api.commerceclarity.com/api/2026-05/attributes/create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Color",
    "attribute_id": "color",
    "type": "single-select",
    "scope": "global",
    "options": [
      { "action": "new", "value": "Red" },
      { "action": "new", "value": "Blue" }
    ]
  }'

Response Example

Success Response
{
  "success": true,
  "data": {
    "attribute": {
      "_id": "507f1f77bcf86cd799439011",
      "attribute_id": "color",
      "name": "Color",
      "type": "single-select",
      "scope": "global",
      "is_essential": false,
      "options": {
        "red":  { "value": "Red" },
        "blue": { "value": "Blue" }
      },
      "family_ids": [],
      "brand_id": "507f1f77bcf86cd799439010",
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-01-15T10:30:00Z"
    }
  }
}
Error Response - Validation
{
  "success": false,
  "message": "Validation error",
  "errors": {
    "attribute_id": ["The attribute_id has already been taken."]
  }
}