Support

createOptionValues

View as Markdown

Create multiple new Option Values in a single transaction.

mutation

Requires commerce.product:write.

Create multiple new Option Values in a single transaction.

For SimpleMoneyInput.value, send 1999 for $19.99 USD, not 19.99.

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 [MutationCreateOptionValueInput!]! required
    • label String! required
    • optionId String! required
    • 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
    • prices [CreateOptionValuePriceInput!] optional
      • value SimpleMoneyInput! required
        • currencyCode String! required
        • value Float! required — Integer minor units in the smallest currency unit (for USD, cents: 1999 = $19.99). Send 1999, not 19.99.
      • compareAtValue SimpleMoneyInput optional
        • currencyCode String! required
        • value Float! required — Integer minor units in the smallest currency unit (for USD, cents: 1999 = $19.99). Send 1999, not 19.99.

Possible returns

  • OptionValue [OptionValue!]

Last updated on

How is this guide?