Support

createAttribute

View as Markdown

Create a new attribute.

mutation

Requires commerce.product:write.

Create a new attribute.

Required headers

HeaderRequiredDescription
x-store-idYesID of the store the operation targets. Omitting it returns HTTP 200 with a GraphQL error: extensions.code: "UNAUTHENTICATED".

Go to Authentication for credential setup.

Arguments

  • input MutationCreateAttributeInput! required
    • label String! required
    • skuGroupId ID! required
    • description String optional
    • htmlDescription String optional
    • HTMLDescription String optional — Deprecated: Use htmlDescription instead.
    • metafields [CreateMetafieldInput!] optional
      • key String! required
      • namespace String! required
      • type String! required — Metafield value type. Live catalog validation accepts lowercase values such as boolean, string, stringMultiLine, number, numberDecimal, date, dateTime, json, measurement, url, reference, money, list.string, list.number, list.numberDecimal. Uppercase STRING is rejected.
      • value String! required
    • name String optional
    • position Int optional
    • values [AssociateAttributeValueInput!] optional
      • label String! required
      • name String optional
      • position Int optional

Possible returns

  • Attribute Attribute — A SKU is comprised of a combination of multiple attributes

Last updated on

How is this guide?