Product Options Create User Error
Requires access scope.
Error codes for failed mutation.
Anchor to FieldsFields
- Anchor to codecode•Product
Options Create User Error Code The error code.
- Anchor to fieldfield•[String!]
The path to the input field that caused the error.
- Anchor to messagemessage•String!non-null
The error message.
Anchor to MutationsMutations
- •mutation
Creates one or more options on a product, such as size, color, or material. Each option includes a name, position, and a list of values. The combination of a product option and value creates a product variant.
Use the
mutation for the following use cases:
- Add product choices: Add a new option, like "Size" (Small, Medium, Large) or "Color" (Red, Blue, Green), to an existing product so customers can select their preferred variant.
- Enable personalization features: Add options such as "Engraving text" to let customers customize their purchase.
- Offer seasonal or limited edition products: Add a new value (for example, "Holiday red") to an existing option to support limited-time or seasonal variants.
- Integrate with apps that manage product configuration: Allow third-party apps to add options, like "Bundle size", when customers select or customize product bundles.
- Link options to metafields: Associate a product option with a custom metafield, like "Fabric code", for richer integrations with other systems or apps.
NoteThe
mutation enforces strict data integrity for product options and variants. All option positions must be sequential, and every option should be used by at least one variant. If you use the
variant strategy, consider the maximum allowed number of variants for each product (100 by default, and 2,048 if you've enabled the Extended Variants developer preview).
After you create product options, you can further manage a product's configuration using related mutations:
Learn more about the product model and adding product data.
- Anchor to optionsoptions•[Option
Create Input!]! required Options to add to the product.
- Anchor to productIdproduct•ID!
Id required The ID of the product to update.
- Anchor to variantStrategyvariant•Product
Strategy Option Create Variant Strategy Default:LEAVE_AS_IS The strategy defines which behavior the mutation should observe regarding variants. If not provided or set to null, the strategy
will be used.
Arguments
- Anchor to productproduct•Product
The updated product object.
- Anchor to userErrorsuser•[Product
Errors Options Create User Error!]! non-null The list of errors that occurred from executing the mutation.
Fields