Skip to main content

Create Attribute

POST 

/api/attributes

Creates a new attribute.

Required scope: products:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token.

Fields:

  • name (required): Unique name, max 255 chars
  • type (required): One of: string, longtext, date, datetime, numeric, integer, checkbox
  • display_options (optional): JSON object with display configuration
  • option_values (optional): Array of selectable options for dropdown-type attributes
    • option_values.*.value (optional): Option value string, max 255 chars
    • option_values.*.sort_order (optional): Sort order integer
  • validation (optional): JSON validation rules
  • available_for_templates (optional): Boolean — makes attribute available in email templates
  • attribute_group_id (optional): ID of the group to assign this attribute to
  • notes (optional): Internal notes, max 255 chars

Requires permission: attributes.create

Each entry in option_values may carry an optional variant SWATCH — swatch_hex (a hex colour, max 20) and/or swatch_image_url (an image URL, max 500). When the attribute is used as a variant axis (e.g. Color), channels that support swatches (Walmart) render this chip for every variant that selects the value. Send null to clear a swatch.

Request

Responses

Created

Response Headers
    Content-Type