Specify the Attribute to be created with the ProductTypeDraft.

interface AttributeDefinitionDraft {
    attributeConstraint?: string;
    inputHint?: string;
    inputTip?: LocalizedString;
    isRequired: boolean;
    isSearchable?: boolean;
    label: LocalizedString;
    name: string;
    type: AttributeType;
}

Properties

attributeConstraint?: string

Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product.

inputHint?: string

Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).

inputTip?: LocalizedString

Provides additional information about the Attribute that aids content managers when setting Product details.

isRequired: boolean

Set to true if the Attribute is required to have a value on a ProductVariant.

isSearchable?: boolean

Set to true if the Attribute's values should be available in the Product Projections Search API and can be used in full-text search queries, filters, and facets. Which exact features are available with this flag depends on the specific AttributeType. The maximum size of a searchable field is restricted by the Field content size limit. This constraint is enforced at both Product creation and Product update. If the length of the input exceeds the maximum size, an InvalidField error is returned.

Human-readable label for the Attribute.

name: string

User-defined name of the Attribute that is unique with the Project.

When using the same `name` for an Attribute in multiple ProductTypes, all fields of the AttributeDefinition of this Attribute must be the same across the ProductTypes, else an [AttributeDefinitionAlreadyExists](ctp:api:type:AttributeDefinitionAlreadyExistsError) error is returned.
An exception to this are the values of an `enum` or `lenum` Type and sets thereof.

Describes the Type of the Attribute.

When the `type` is different for an AttributeDefinition using the same name in multiple ProductTypes, an [AttributeDefinitionTypeConflict](ctp:api:type:AttributeDefinitionTypeConflictError) error is returned.

Generated using TypeDoc