Attributes

Attributes require product scopes. Reads use read_products; writes use write_products. Attributes are compound resources: the parent owns name, slug, description, sub_type, and sort_order, while options[] owns option labels, values, swatch colors, image file ids, and option sort order. sub_type is one of standard, swatch, or image; swatch options require colors, image options require upload file ids. Referencing a non-empty option file_id also requires read_files. Attribute option translations are their own Store API endpoints because options are separate translatable records.

Endpoints#

Attribute limits

GET read_products

Fetch Attribute limits, option limits, and list constraints.

Returns parent field limits, option field limits, allowed sub types, reorder caps, list caps, and sort options for Product Attribute endpoints.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

List attributes

GET read_products

List product attributes for the store.

Returns paginated product attributes with their nested options. Use sub_type to filter to standard, swatch, or image attributes; use in_use to filter attributes currently used by variants.

Query parameters

Name Type Description
page integer

Page number.

Example: 1
limit integer

Page size.

Example: 20
search string

Search attributes by name or slug.

Example: color
sub_type string

Filter by sub type: standard, swatch, or image.

Example: swatch
in_use boolean

Filter by whether the attribute is used by variants.

Example: true
sort_by string

Sort field from the Attribute list contract.

Allowed values
namecreated_atupdated_at
Example: name
sort_direction string

Sort direction from the Attribute list contract.

Allowed values
ascdesc
Example: asc

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Search attributes

GET read_products

Search attributes for picker-style suggestions.

Returns lightweight attribute suggestions by query. This endpoint is intended for pickers and simple selection UIs.

Query parameters

Name Type Description
q string

Search query.

Example: color
limit integer

Suggestion count.

Example: 10
offset integer

Result offset.

Example: 0

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Get an attribute

GET read_products

Fetch one attribute by id.

Returns the attribute and its nested options if it belongs to the token's store.

Path parameters

Name Type Description
id required integer

Attribute id.

Example: 7

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 400 STORE_API_INVALID_ATTRIBUTE_ID

    Attribute id must be an integer.

  • 404 ATTRIBUTE_NOT_FOUND

    Attribute does not exist in this store.

Create an attribute

POST write_products

Create an attribute with options.

Creates a product attribute. name, sub_type, and at least one option are required. slug is optional on create and is generated from the name when omitted. sub_type controls option shape: standard uses labels/values, swatch options require color, and image options require file_id. Non-empty option file_id values must point to upload files in the same store and require read_files in addition to write_products.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name required string

Attribute name.

Example: Color
slug string

Optional slug. Omit to generate from name.

Example: color
description string

Optional plain-text description.

Example: Product color choices.
sub_type required string

One of standard, swatch, or image. Controls which option fields are required.

Example: swatch
sort_order integer

Store-wide display order.

Example: 10
options required array<object>

Attribute options. label is required. value is optional and can be generated. color is required for swatch attributes. file_id is required for image attributes and requires read_files.

Example: [{"label":"Red","value":"red","color":"#ef4444","sort_order":0}]

Errors

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON or does not match the expected shape.

  • 400 ATTRIBUTE_NAME_REQUIRED

    Name is empty after normalization.

  • 400 ATTRIBUTE_NAME_TOO_LONG

    Name exceeds the Attribute contract max length.

  • 400 ATTRIBUTE_SLUG_INVALID_FORMAT

    Slug is not valid for Attribute URLs.

  • 400 ATTRIBUTE_SUB_TYPE_INVALID

    Sub type is not standard, swatch, or image.

  • 400 ATTRIBUTE_SUB_TYPE_IMMUTABLE

    Sub type cannot be changed after creation.

  • 400 ATTRIBUTE_OPTIONS_REQUIRED

    At least one option is required.

  • 400 ATTRIBUTE_OPTIONS_TOO_MANY

    Option count exceeds the contract max per attribute.

  • 400 ATTRIBUTE_OPTION_LABEL_TOO_LONG

    Option label exceeds the contract max length.

  • 400 ATTRIBUTE_OPTION_VALUE_INVALID_FORMAT

    Option value is not a valid filter identifier.

  • 400 ATTRIBUTE_OPTION_COLOR_REQUIRED

    Swatch options require a color.

  • 400 ATTRIBUTE_OPTION_COLOR_INVALID_FORMAT

    Option color must be #RRGGBB.

  • 400 ATTRIBUTE_OPTION_IMAGE_REQUIRED

    Image options require a file_id.

  • 400 ATTRIBUTE_LIMIT_REACHED

    Store attribute cap has been reached.

  • 403 STORE_ADMIN_TOKEN_RUNTIME_FORBIDDEN

    A non-empty option file_id requires read_files scope in addition to write_products.

  • 404 ATTRIBUTE_NOT_FOUND

    Attribute does not exist in this store.

  • 409 ATTRIBUTE_DUPLICATE

    Name or slug already exists in this store.

  • 409 ATTRIBUTE_OPTIONS_IN_USE

    An option removed by the update is still used by variants.

Update an attribute

PUT write_products

Update an attribute and replace its option set.

Updates provided parent fields and replaces the option array. Omitted parent fields are left unchanged, but options is a full-array replacement when sent by Store Admin clients. sub_type is immutable after create and must match the existing value when included. Existing options keep their id; id: 0 creates a new option. Removing an option used by variants is blocked. Non-empty option file_id values require read_files in addition to write_products.

Path parameters

Name Type Description
id required integer

Attribute id.

Example: 7

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
name string

Attribute name.

Example: Color
slug string

Optional slug. Omit to generate from name.

Example: color
description string

Optional plain-text description.

Example: Product color choices.
sub_type required string

sub_type is immutable after create. If sent, it must match the existing attribute.

Example: swatch
sort_order integer

Store-wide display order.

Example: 10
options required array<object>

Full replacement option array. Existing options include their id; new options use id: 0. Removing an option in use by variants is blocked.

Example: [{"label":"Red","value":"red","color":"#ef4444","sort_order":0}]

Errors

  • 400 STORE_API_INVALID_ATTRIBUTE_ID

    Attribute id must be an integer.

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON or does not match the expected shape.

  • 400 ATTRIBUTE_NAME_REQUIRED

    Name is empty after normalization.

  • 400 ATTRIBUTE_NAME_TOO_LONG

    Name exceeds the Attribute contract max length.

  • 400 ATTRIBUTE_SLUG_INVALID_FORMAT

    Slug is not valid for Attribute URLs.

  • 400 ATTRIBUTE_SUB_TYPE_INVALID

    Sub type is not standard, swatch, or image.

  • 400 ATTRIBUTE_SUB_TYPE_IMMUTABLE

    Sub type cannot be changed after creation.

  • 400 ATTRIBUTE_OPTIONS_REQUIRED

    At least one option is required.

  • 400 ATTRIBUTE_OPTIONS_TOO_MANY

    Option count exceeds the contract max per attribute.

  • 400 ATTRIBUTE_OPTION_LABEL_TOO_LONG

    Option label exceeds the contract max length.

  • 400 ATTRIBUTE_OPTION_VALUE_INVALID_FORMAT

    Option value is not a valid filter identifier.

  • 400 ATTRIBUTE_OPTION_COLOR_REQUIRED

    Swatch options require a color.

  • 400 ATTRIBUTE_OPTION_COLOR_INVALID_FORMAT

    Option color must be #RRGGBB.

  • 400 ATTRIBUTE_OPTION_IMAGE_REQUIRED

    Image options require a file_id.

  • 400 ATTRIBUTE_LIMIT_REACHED

    Store attribute cap has been reached.

  • 403 STORE_ADMIN_TOKEN_RUNTIME_FORBIDDEN

    A non-empty option file_id requires read_files scope in addition to write_products.

  • 404 ATTRIBUTE_NOT_FOUND

    Attribute does not exist in this store.

  • 409 ATTRIBUTE_DUPLICATE

    Name or slug already exists in this store.

  • 409 ATTRIBUTE_OPTIONS_IN_USE

    An option removed by the update is still used by variants.

Delete an attribute

DELETE write_products

Delete an attribute.

Deletes an attribute only when it is not used by product variants. Variant usage is a hard block; there is no confirmation-and-clear flow because clearing variant attribute data would corrupt variant identity. When deletion is allowed, its options and the translations for both the attribute and those options are deleted in the same transaction. The attribute delete webhook includes the removed option summaries.

Path parameters

Name Type Description
id required integer

Attribute id.

Example: 7

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Errors

  • 400 STORE_API_INVALID_ATTRIBUTE_ID

    Attribute id must be an integer.

  • 404 ATTRIBUTE_NOT_FOUND

    Attribute does not exist in this store.

  • 409 ATTRIBUTE_IN_USE

    Attribute is used by variants and cannot be deleted.

Bulk delete attributes

POST write_products

Delete multiple attributes.

Send store-scoped integer attribute ids in attribute_ids. Attributes that are missing, concurrently changed, or used by variants appear in failed; the others appear in deleted. Deleting an attribute also deletes its options and both levels of translations in the same transaction. The envelope succeeds when the batch itself is valid, even when individual ids fail.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
attribute_ids required array<integer>

Store-scoped integer attribute ids to delete.

Example: [7, 8, 9]

Errors

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON or does not match the expected shape.

  • 400 ATTRIBUTE_BULK_NO_IDS

    No attribute ids were provided.

  • 400 ATTRIBUTE_BULK_DELETE_TOO_MANY

    Batch exceeds the Attribute bulk delete cap.

  • 409 ATTRIBUTE_BULK_RACED

    An attribute became in-use during deletion and was returned in failed.

Reorder attributes

POST write_products

Set the order of selected attributes.

Assigns consecutive sort positions, starting at zero, to the supplied attribute ids. Omitted attributes keep their current sort order. Every supplied id must belong to the store and the list cannot contain duplicates.

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
attribute_ids required array<integer>

Attribute ids in display order.

Example: [7,8,9]

Errors

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON or does not match the expected shape.

  • 400 ATTRIBUTE_REORDER_IDS_REQUIRED

    At least one attribute id is required.

  • 400 ATTRIBUTE_REORDER_DUPLICATE_ID

    The reorder list contains duplicate attribute ids.

  • 400 ATTRIBUTE_REORDER_UNKNOWN_IDS

    One or more attribute ids do not belong to this store.

Reorder attribute options

POST write_products

Set the order of selected options within one attribute.

Assigns consecutive sort positions, starting at zero, to the supplied option ids. Omitted options keep their current sort order. Every supplied id must belong to the attribute and the list cannot contain duplicates.

Path parameters

Name Type Description
id required integer

Attribute id.

Example: 7

Headers

Name Type Description
Authorization required string

Bearer Store API token.

Body parameters

Name Type Description
option_ids required array<integer>

Option ids in display order.

Example: [41,42,43]

Errors

  • 400 STORE_API_INVALID_ATTRIBUTE_ID

    Attribute id must be an integer.

  • 400 STORE_API_INVALID_REQUEST_BODY

    Request body is not valid JSON or does not match the expected shape.

  • 400 ATTRIBUTE_OPTION_REORDER_IDS_REQUIRED

    At least one option id is required.

  • 400 ATTRIBUTE_OPTION_REORDER_DUPLICATE_ID

    The reorder list contains duplicate option ids.

  • 400 ATTRIBUTE_OPTION_REORDER_UNKNOWN_IDS

    One or more option ids do not belong to this attribute.

  • 404 ATTRIBUTE_NOT_FOUND

    Attribute does not exist in this store.

Fields#

Field

Kind

Create

Update

Required

Translatable

name

text

Yes

Yes

create

Yes

slug

slug

Yes

Yes

Yes

description

textarea

Yes

Yes

Yes

sub_type

select

Yes

Yes

create, update

No

sort_order

integer

Yes

Yes

No

options

attribute_options

Yes

Yes

create, update

No

variant_usage_count

integer

No

No

No

in_use

boolean

No

No

No

created_at

datetime

No

No

No

updated_at

datetime

No

No

No

Admin CSV shape#

CSV import, update, and export are Store Admin bulk-job features, not Store API JSON endpoints. They are shown here because the same Attribute registry contract owns the field shape and permissions. Attributes use one row per option: the parent attribute columns identify the attribute, while the option columns describe the nested option on that row.

Mode

Columns

Required columns

Import

Name, Slug, Sub Type, Description, Sort Order, Option Label, Option Value, Option Color, Option Image URL, Option Sort

Name, Option Label

Update

ID, Name, Slug, Sub Type, Description, Sort Order, Option ID, Option Label, Option Value, Option Color, Option Image URL, Option Sort

ID

Export

ID, Name, Slug, Sub Type, Description, Sort Order, Option ID, Option Label, Option Value, Option Color, Option Image URL, Option Image Site URL, Option Sort

Create import example#

csv
NameSlugSub TypeDescriptionSort OrderOption LabelOption ValueOption ColorOption Image URLOption Sort
AcmeacmeswatchAcme makes durable outdoor gear.10Redred#ef4444https://cdn.example.com/red.png10

Update options example#

csv
IDNameSlugSub TypeDescriptionSort OrderOption IDOption LabelOption ValueOption ColorOption Image URLOption Sort
7AcmeacmeswatchAcme makes durable outdoor gear.1041Redred#ef4444https://cdn.example.com/red.png10

Webhook events#

Attribute webhook events are declared by the Attribute resource contract. The event cards below include the topic, subscription scope, store permission, payload schema, and sample payload.

Attribute created

EVENT attributes/create write_products products:write

Fired when a product attribute is created.

Payload fields

Field Type Description
attribute.id integer Always present
attribute.store_seq_id integer Can be removed/added via the Payload builder
attribute.name string Can be removed/added via the Payload builder
attribute.slug string Can be removed/added via the Payload builder
attribute.description string Can be removed/added via the Payload builder
attribute.sub_type string Can be removed/added via the Payload builder
attribute.sort_order integer Can be removed/added via the Payload builder
attribute.in_use boolean Can be removed/added via the Payload builder
attribute.variant_usage_count integer Can be removed/added via the Payload builder
attribute.created_at string Can be removed/added via the Payload builder
attribute.updated_at string Can be removed/added via the Payload builder
attribute.options[*].id integer Always present
attribute.options[*].store_seq_id integer Can be removed/added via the Payload builder
attribute.options[*].attribute_id integer Can be removed/added via the Payload builder
attribute.options[*].label string Can be removed/added via the Payload builder
attribute.options[*].value string Can be removed/added via the Payload builder
attribute.options[*].color string Can be removed/added via the Payload builder
attribute.options[*].file_id string Can be removed/added via the Payload builder
attribute.options[*].file_url string Can be removed/added via the Payload builder
attribute.options[*].file_cdn_url string Can be removed/added via the Payload builder
attribute.options[*].sort_order integer Can be removed/added via the Payload builder
attribute.options[*].created_at string Can be removed/added via the Payload builder

Attribute updated

EVENT attributes/update write_products products:write

Fired when a product attribute is updated.

Payload fields

Field Type Description
attribute.id integer Always present
attribute.store_seq_id integer Can be removed/added via the Payload builder
attribute.name string Can be removed/added via the Payload builder
attribute.slug string Can be removed/added via the Payload builder
attribute.description string Can be removed/added via the Payload builder
attribute.sub_type string Can be removed/added via the Payload builder
attribute.sort_order integer Can be removed/added via the Payload builder
attribute.in_use boolean Can be removed/added via the Payload builder
attribute.variant_usage_count integer Can be removed/added via the Payload builder
attribute.created_at string Can be removed/added via the Payload builder
attribute.updated_at string Can be removed/added via the Payload builder
attribute.options[*].id integer Always present
attribute.options[*].store_seq_id integer Can be removed/added via the Payload builder
attribute.options[*].attribute_id integer Can be removed/added via the Payload builder
attribute.options[*].label string Can be removed/added via the Payload builder
attribute.options[*].value string Can be removed/added via the Payload builder
attribute.options[*].color string Can be removed/added via the Payload builder
attribute.options[*].file_id string Can be removed/added via the Payload builder
attribute.options[*].file_url string Can be removed/added via the Payload builder
attribute.options[*].file_cdn_url string Can be removed/added via the Payload builder
attribute.options[*].sort_order integer Can be removed/added via the Payload builder
attribute.options[*].created_at string Can be removed/added via the Payload builder

Attribute deleted

EVENT attributes/delete write_products products:write

Fired when a product attribute is deleted. Payload carries the attribute plus the options that cascaded with it.

Payload fields

Field Type Description
attribute.id integer Always present
attribute.store_seq_id integer Can be removed/added via the Payload builder
attribute.name string Can be removed/added via the Payload builder
attribute.slug string Can be removed/added via the Payload builder
attribute.sub_type string Can be removed/added via the Payload builder
attribute.options[*].id integer Always present
attribute.options[*].store_seq_id integer Can be removed/added via the Payload builder
attribute.options[*].label string Can be removed/added via the Payload builder
attribute.options[*].value string Can be removed/added via the Payload builder

Attributes reordered

EVENT attributes/reorder write_products products:write

Fired when the sort order of attributes is changed. Payload carries the ordered id list.

Payload fields

Field Type Description
attribute_ids array Always present

Attribute option created

EVENT attribute_options/create write_products products:write

Fired when a new option is added to an attribute.

Payload fields

Field Type Description
option.id integer Always present
option.store_seq_id integer Can be removed/added via the Payload builder
option.attribute_id integer Can be removed/added via the Payload builder
option.label string Can be removed/added via the Payload builder
option.value string Can be removed/added via the Payload builder
option.color string Can be removed/added via the Payload builder
option.file_id string Can be removed/added via the Payload builder
option.file_url string Can be removed/added via the Payload builder
option.file_cdn_url string Can be removed/added via the Payload builder
option.sort_order integer Can be removed/added via the Payload builder
option.created_at string Can be removed/added via the Payload builder

Attribute option updated

EVENT attribute_options/update write_products products:write

Fired when an existing attribute option is updated.

Payload fields

Field Type Description
option.id integer Always present
option.store_seq_id integer Can be removed/added via the Payload builder
option.attribute_id integer Can be removed/added via the Payload builder
option.label string Can be removed/added via the Payload builder
option.value string Can be removed/added via the Payload builder
option.color string Can be removed/added via the Payload builder
option.file_id string Can be removed/added via the Payload builder
option.file_url string Can be removed/added via the Payload builder
option.file_cdn_url string Can be removed/added via the Payload builder
option.sort_order integer Can be removed/added via the Payload builder
option.created_at string Can be removed/added via the Payload builder

Attribute option deleted

EVENT attribute_options/delete write_products products:write

Fired when an attribute option is removed.

Payload fields

Field Type Description
option.id integer Always present
option.store_seq_id integer Can be removed/added via the Payload builder
option.label string Can be removed/added via the Payload builder
option.value string Can be removed/added via the Payload builder

Attribute options reordered

EVENT attribute_options/reorder write_products products:write

Fired when the sort order of options within an attribute changes. Payload carries the attribute_id plus the ordered option_id list.

Payload fields

Field Type Description
attribute_id integer Always present
option_ids array Always present