Catalog attributes
The attributes products are described by — typed, localized, put in order with :move. Which products have one is decided by the attribute sets that list it.
List catalog attributes
A field the tenant gives the website's products — a color, a material, a weight, a release date — with its type, its label in each language and whether it is required. Which products have it is decided by the catalog_attribute_sets that list it; a product's value is kept in its attributes under the attribute's key. An attribute is switched off with is_active rather than deleted when its values are worth keeping: deleting it takes it out of every set and removes its values from every product. A SELECT attribute may be an option product variants differ by (a product's variant_options); while it is one, it is neither deleted nor switched off, nor is an option its variants hold taken away. At most 200 per website.
path Parameters
website_idId of the parent website.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: sort_order asc. Sortable: key, sort_order.
filterAIP-160 subset (§8). Filterable: key. A field outside the list is INVALID_ARGUMENT.
List catalog attributes › Responses
One page of catalog_attributes.
This page of catalog_attributes, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create catalog attribute
Adds an attribute products can be described by. key, display_name and type are required; a key another attribute of the website has answers ALREADY_EXISTS, and a website that already has 200 attributes answers FAILED_PRECONDITION. The new attribute comes last in sort_order, and no product has it until an attribute set lists it.
path Parameters
website_idId of the parent website.
Create catalog attribute › Request Body
display_nameThe attribute's label, shown wherever labels has none for the locale. Not blank, at most 255 characters.
keyThe name a product's value is stored under in its attributes: a lowercase letter, then up to 63 lowercase letters, digits and underscores. Unique on the website, and none of a product's own field names (sku, price, display_name, ...). Required on create and fixed afterwards.
labelsThe label in other languages: an object from a locale (de, pt-BR) to the label in it, each at most 255 characters. A locale it leaves out shows display_name. Replaced whole when sent.
descriptionThe hint shown under the attribute on the product form. At most 2000 characters.
typeWhat the attribute holds, and so which control the product form draws: TEXT, TEXTAREA, NUMBER, BOOLEAN, DATE (a YYYY-MM-DD string), SELECT (one of options) or MULTISELECT (any of them). Required on create and fixed afterwards.
displayHow the storefront shows a SELECT attribute's options — on a product's page and in its filter: SELECT (a drop-down, the default), BUTTONS (a row of buttons with the options' names) or SWATCH (a row of swatches, each option's swatch, and its name on a button where it has none). Emitted on every SELECT attribute, and on no other type, which refuses it. DISPLAY_UNSPECIFIED or null goes back to SELECT.
optionsThe choices of a SELECT or MULTISELECT attribute, in the order a form lists them: each {value, display_name, labels, swatch}, where value is what a product's attributes stores and is unique within the attribute, and swatch, optional, is what the storefront's swatch shows for it: {"color": "#RRGGBB"} or {"media_id": "<id>"}, a file of the website's media library — one of the two; deleting the file takes the swatch off. At least one and at most 200 for those two types, none for the others. Replaced whole when sent; one a product variant holds in its option_values cannot be taken away — FAILED_PRECONDITION, naming the products.
is_requiredWhether a product whose attribute set lists the attribute must have a value for it. false when omitted.
is_filterableWhether the storefront offers the attribute as a filter of a product list. Kept for the storefront; the admin does not act on it. false when omitted.
is_activeWhether the attribute is in use. Switching it off takes it off the product form and stops new values being accepted, while the values products already hold stay readable — the way to retire an attribute without losing them. true when omitted. Not switched off while a product's variant_options name it — FAILED_PRECONDITION, naming the products.
min_lengthThe fewest characters a TEXT or TEXTAREA value may have. Not allowed on other types.
max_lengthThe most characters a TEXT or TEXTAREA value may have — at most 1024 for TEXT and 8192 for TEXTAREA, which is also the limit when it is omitted. Not allowed on other types.
min_valueThe smallest value a NUMBER attribute accepts. Not allowed on other types.
max_valueThe largest value a NUMBER attribute accepts. Not allowed on other types.
Create catalog attribute › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
keyThe name a product's value is stored under in its attributes: a lowercase letter, then up to 63 lowercase letters, digits and underscores. Unique on the website, and none of a product's own field names (sku, price, display_name, ...). Required on create and fixed afterwards.
display_nameThe attribute's label, shown wherever labels has none for the locale. Not blank, at most 255 characters.
labelsThe label in other languages: an object from a locale (de, pt-BR) to the label in it, each at most 255 characters. A locale it leaves out shows display_name. Replaced whole when sent.
descriptionThe hint shown under the attribute on the product form. At most 2000 characters.
typeWhat the attribute holds, and so which control the product form draws: TEXT, TEXTAREA, NUMBER, BOOLEAN, DATE (a YYYY-MM-DD string), SELECT (one of options) or MULTISELECT (any of them). Required on create and fixed afterwards.
displayHow the storefront shows a SELECT attribute's options — on a product's page and in its filter: SELECT (a drop-down, the default), BUTTONS (a row of buttons with the options' names) or SWATCH (a row of swatches, each option's swatch, and its name on a button where it has none). Emitted on every SELECT attribute, and on no other type, which refuses it. DISPLAY_UNSPECIFIED or null goes back to SELECT.
optionsThe choices of a SELECT or MULTISELECT attribute, in the order a form lists them: each {value, display_name, labels, swatch}, where value is what a product's attributes stores and is unique within the attribute, and swatch, optional, is what the storefront's swatch shows for it: {"color": "#RRGGBB"} or {"media_id": "<id>"}, a file of the website's media library — one of the two; deleting the file takes the swatch off. At least one and at most 200 for those two types, none for the others. Replaced whole when sent; one a product variant holds in its option_values cannot be taken away — FAILED_PRECONDITION, naming the products.
is_requiredWhether a product whose attribute set lists the attribute must have a value for it. false when omitted.
is_filterableWhether the storefront offers the attribute as a filter of a product list. Kept for the storefront; the admin does not act on it. false when omitted.
is_activeWhether the attribute is in use. Switching it off takes it off the product form and stops new values being accepted, while the values products already hold stay readable — the way to retire an attribute without losing them. true when omitted. Not switched off while a product's variant_options name it — FAILED_PRECONDITION, naming the products.
min_lengthThe fewest characters a TEXT or TEXTAREA value may have. Not allowed on other types.
max_lengthThe most characters a TEXT or TEXTAREA value may have — at most 1024 for TEXT and 8192 for TEXTAREA, which is also the limit when it is omitted. Not allowed on other types.
min_valueThe smallest value a NUMBER attribute accepts. Not allowed on other types.
max_valueThe largest value a NUMBER attribute accepts. Not allowed on other types.
sort_orderWhere the attribute stands among the website's attributes: lists show them in ascending sort_order. A new attribute comes last; :move is the only way to change it.
Get catalog attribute
A field the tenant gives the website's products — a color, a material, a weight, a release date — with its type, its label in each language and whether it is required. Which products have it is decided by the catalog_attribute_sets that list it; a product's value is kept in its attributes under the attribute's key. An attribute is switched off with is_active rather than deleted when its values are worth keeping: deleting it takes it out of every set and removes its values from every product. A SELECT attribute may be an option product variants differ by (a product's variant_options); while it is one, it is neither deleted nor switched off, nor is an option its variants hold taken away. At most 200 per website.
path Parameters
website_idId of the parent website.
attribute_idId of the parent attribute.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get catalog attribute › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
keyThe name a product's value is stored under in its attributes: a lowercase letter, then up to 63 lowercase letters, digits and underscores. Unique on the website, and none of a product's own field names (sku, price, display_name, ...). Required on create and fixed afterwards.
display_nameThe attribute's label, shown wherever labels has none for the locale. Not blank, at most 255 characters.
labelsThe label in other languages: an object from a locale (de, pt-BR) to the label in it, each at most 255 characters. A locale it leaves out shows display_name. Replaced whole when sent.
descriptionThe hint shown under the attribute on the product form. At most 2000 characters.
typeWhat the attribute holds, and so which control the product form draws: TEXT, TEXTAREA, NUMBER, BOOLEAN, DATE (a YYYY-MM-DD string), SELECT (one of options) or MULTISELECT (any of them). Required on create and fixed afterwards.
displayHow the storefront shows a SELECT attribute's options — on a product's page and in its filter: SELECT (a drop-down, the default), BUTTONS (a row of buttons with the options' names) or SWATCH (a row of swatches, each option's swatch, and its name on a button where it has none). Emitted on every SELECT attribute, and on no other type, which refuses it. DISPLAY_UNSPECIFIED or null goes back to SELECT.
optionsThe choices of a SELECT or MULTISELECT attribute, in the order a form lists them: each {value, display_name, labels, swatch}, where value is what a product's attributes stores and is unique within the attribute, and swatch, optional, is what the storefront's swatch shows for it: {"color": "#RRGGBB"} or {"media_id": "<id>"}, a file of the website's media library — one of the two; deleting the file takes the swatch off. At least one and at most 200 for those two types, none for the others. Replaced whole when sent; one a product variant holds in its option_values cannot be taken away — FAILED_PRECONDITION, naming the products.
is_requiredWhether a product whose attribute set lists the attribute must have a value for it. false when omitted.
is_filterableWhether the storefront offers the attribute as a filter of a product list. Kept for the storefront; the admin does not act on it. false when omitted.
is_activeWhether the attribute is in use. Switching it off takes it off the product form and stops new values being accepted, while the values products already hold stay readable — the way to retire an attribute without losing them. true when omitted. Not switched off while a product's variant_options name it — FAILED_PRECONDITION, naming the products.
min_lengthThe fewest characters a TEXT or TEXTAREA value may have. Not allowed on other types.
max_lengthThe most characters a TEXT or TEXTAREA value may have — at most 1024 for TEXT and 8192 for TEXTAREA, which is also the limit when it is omitted. Not allowed on other types.
min_valueThe smallest value a NUMBER attribute accepts. Not allowed on other types.
max_valueThe largest value a NUMBER attribute accepts. Not allowed on other types.
sort_orderWhere the attribute stands among the website's attributes: lists show them in ascending sort_order. A new attribute comes last; :move is the only way to change it.
Delete catalog attribute
Deletes an attribute, takes it out of every attribute set and removes its values from every product before it answers. Switch is_active off instead to keep the values. An attribute a product's variant_options name is refused with FAILED_PRECONDITION, naming those products.
path Parameters
website_idId of the parent website.
attribute_idId of the parent attribute.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete catalog attribute › Responses
Deleted. No body (§7).
Update catalog attribute
Changes an attribute. key and type are fixed and refused here, and sort_order is changed with :move. The result is checked as a whole: options only on SELECT and MULTISELECT, a length only on TEXT and TEXTAREA, a range only on NUMBER. Taking away an option a product variant holds, or switching off an attribute a product's variant_options name, answers FAILED_PRECONDITION with up to 20 of those products in its details.
path Parameters
website_idId of the parent website.
attribute_idId of the parent attribute.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update catalog attribute › Request Body
display_nameThe attribute's label, shown wherever labels has none for the locale. Not blank, at most 255 characters.
labelsThe label in other languages: an object from a locale (de, pt-BR) to the label in it, each at most 255 characters. A locale it leaves out shows display_name. Replaced whole when sent.
descriptionThe hint shown under the attribute on the product form. At most 2000 characters.
displayHow the storefront shows a SELECT attribute's options — on a product's page and in its filter: SELECT (a drop-down, the default), BUTTONS (a row of buttons with the options' names) or SWATCH (a row of swatches, each option's swatch, and its name on a button where it has none). Emitted on every SELECT attribute, and on no other type, which refuses it. DISPLAY_UNSPECIFIED or null goes back to SELECT.
optionsThe choices of a SELECT or MULTISELECT attribute, in the order a form lists them: each {value, display_name, labels, swatch}, where value is what a product's attributes stores and is unique within the attribute, and swatch, optional, is what the storefront's swatch shows for it: {"color": "#RRGGBB"} or {"media_id": "<id>"}, a file of the website's media library — one of the two; deleting the file takes the swatch off. At least one and at most 200 for those two types, none for the others. Replaced whole when sent; one a product variant holds in its option_values cannot be taken away — FAILED_PRECONDITION, naming the products.
is_requiredWhether a product whose attribute set lists the attribute must have a value for it. false when omitted.
is_filterableWhether the storefront offers the attribute as a filter of a product list. Kept for the storefront; the admin does not act on it. false when omitted.
is_activeWhether the attribute is in use. Switching it off takes it off the product form and stops new values being accepted, while the values products already hold stay readable — the way to retire an attribute without losing them. true when omitted. Not switched off while a product's variant_options name it — FAILED_PRECONDITION, naming the products.
min_lengthThe fewest characters a TEXT or TEXTAREA value may have. Not allowed on other types.
max_lengthThe most characters a TEXT or TEXTAREA value may have — at most 1024 for TEXT and 8192 for TEXTAREA, which is also the limit when it is omitted. Not allowed on other types.
min_valueThe smallest value a NUMBER attribute accepts. Not allowed on other types.
max_valueThe largest value a NUMBER attribute accepts. Not allowed on other types.
Update catalog attribute › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
keyThe name a product's value is stored under in its attributes: a lowercase letter, then up to 63 lowercase letters, digits and underscores. Unique on the website, and none of a product's own field names (sku, price, display_name, ...). Required on create and fixed afterwards.
display_nameThe attribute's label, shown wherever labels has none for the locale. Not blank, at most 255 characters.
labelsThe label in other languages: an object from a locale (de, pt-BR) to the label in it, each at most 255 characters. A locale it leaves out shows display_name. Replaced whole when sent.
descriptionThe hint shown under the attribute on the product form. At most 2000 characters.
typeWhat the attribute holds, and so which control the product form draws: TEXT, TEXTAREA, NUMBER, BOOLEAN, DATE (a YYYY-MM-DD string), SELECT (one of options) or MULTISELECT (any of them). Required on create and fixed afterwards.
displayHow the storefront shows a SELECT attribute's options — on a product's page and in its filter: SELECT (a drop-down, the default), BUTTONS (a row of buttons with the options' names) or SWATCH (a row of swatches, each option's swatch, and its name on a button where it has none). Emitted on every SELECT attribute, and on no other type, which refuses it. DISPLAY_UNSPECIFIED or null goes back to SELECT.
optionsThe choices of a SELECT or MULTISELECT attribute, in the order a form lists them: each {value, display_name, labels, swatch}, where value is what a product's attributes stores and is unique within the attribute, and swatch, optional, is what the storefront's swatch shows for it: {"color": "#RRGGBB"} or {"media_id": "<id>"}, a file of the website's media library — one of the two; deleting the file takes the swatch off. At least one and at most 200 for those two types, none for the others. Replaced whole when sent; one a product variant holds in its option_values cannot be taken away — FAILED_PRECONDITION, naming the products.
is_requiredWhether a product whose attribute set lists the attribute must have a value for it. false when omitted.
is_filterableWhether the storefront offers the attribute as a filter of a product list. Kept for the storefront; the admin does not act on it. false when omitted.
is_activeWhether the attribute is in use. Switching it off takes it off the product form and stops new values being accepted, while the values products already hold stay readable — the way to retire an attribute without losing them. true when omitted. Not switched off while a product's variant_options name it — FAILED_PRECONDITION, naming the products.
min_lengthThe fewest characters a TEXT or TEXTAREA value may have. Not allowed on other types.
max_lengthThe most characters a TEXT or TEXTAREA value may have — at most 1024 for TEXT and 8192 for TEXTAREA, which is also the limit when it is omitted. Not allowed on other types.
min_valueThe smallest value a NUMBER attribute accepts. Not allowed on other types.
max_valueThe largest value a NUMBER attribute accepts. Not allowed on other types.
sort_orderWhere the attribute stands among the website's attributes: lists show them in ascending sort_order. A new attribute comes last; :move is the only way to change it.
Move (catalog attribute)
Moves an attribute to another place among the website's attributes. Send {"after_id": "..."} to put it right after that attribute, or {"after_id": null} (or {}) to put it first. Answers the moved attribute with its new sort_order; the other attributes are renumbered around it.
path Parameters
website_idId of the parent website.
attribute_idId of the parent attribute.
Move (catalog attribute) › Request Body optional
Move (catalog attribute) › Responses
The affected resource, or the method’s own response object (§10).