# API GraphQL ProductCreate with options error

**URL:** <https://community.shopify.com/t/api-graphql-productcreate-with-options-error/392434>\
**Category:** Shopify Discussion\
**Tags:** troubleshooting\
**Created:** [February 5, 2025, 3:42pm UTC](https://community.shopify.com/t/api-graphql-productcreate-with-options-error/392434 "2025-02-05T15:42:13Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

A developer encounters an error when attempting to create a product with options using Shopify's GraphQL `productCreate` mutation. The error indicates that the `options` field is being rejected with a type coercion issue: "Could not coerce value {name:"Size",values:["EACH"]} to String".

**Key Details:**
- The mutation includes product title, options (Size: EACH), variants with SKU/pricing/barcode, and custom metafields
- Error suggests the options array structure may be incorrectly formatted or incompatible with the expected input type
- Multiple variations of the options field have been attempted without success

**Related Issues:**
- Another user reports similar problems creating products with multiple variants
- A third user can create basic products (title, vendor, tags) but cannot include variant-specific details like SKU, price, cost, inventory, and barcode

**Status:** Unresolved. No solutions have been identified, and the discussion remains open with users seeking guidance on proper mutation syntax for product variants and options.

<div class="post-metadata">

**Author:** ![WaltG](https://avatars.discourse-cdn.com/v4/letter/w/53a042/32.png) [@WaltG](https://community.shopify.com/u/WaltG)\
**Post date:** [February 5, 2025, 3:42pm UTC](https://community.shopify.com/t/api-graphql-productcreate-with-options-error/392434/1 "2025-02-05T15:42:13Z")

</div>

Trying to create new product with options. Get an error!  
Tried different variations of “options”, still same error  
Here is my mutation query:

_{_  
_“query” : “mutation productCreate($input: ProductInput!) { productCreate(input: $input) { product { metafields(first: 5) { edges { node { id namespace key value } } } id title description options(first: 25) { name values } variants(first: 25) { nodes { id sku price compareAtPrice selectedOptions { name optionValue { id name } } sku price taxable taxCode barcode weight weightUnit requiresShipping inventoryItem { harmonizedSystemCode } inventoryPolicy metafields(first: 5) { edges { node { id namespace key value } } } } } } } }”,_  
_“variables” : {_  
_“synchronous” : true,_  
_“input” : {_  
_“title” : “MOLLY Product 5.3”,_  
_“options” : [_  
_{_  
_“name” : “Size”,_  
_“values” : [“EACH”]_  
_}_  
_],_  
_“variants” : [_  
_{_  
_“barcode” : “4447771111333-EACH”,_  
_“sku” : “444888”,_  
_“price” : 9.01,_  
_“compareAtPrice” : 10.50,_  
_“taxCode” : “MMM9966”_  
_}_  
_],_  
_“metafields” : [_  
_{_  
_“namespace” : “custom”,_  
_“key” : “ns\_internalid”,_  
_“value” : “731”,_  
_“type” : “number\_integer”_  
_}_  
_]_  
_}_  
_}_  
_}_  
Error:  
{“errors”:[{“message”:"Variable $input of type ProductInput! was provided invalid value for options.0 (Could not coerce value {name:"Size",values:["EACH"]}

“problems”:[{“path”:[“options”,0],“explanation”:“Could not coerce value {name:"Size",values:["EACH"]} to String”}]}}]

---

<div class="post-metadata">

**Author:** ![bilal87](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bilal87](https://community.shopify.com/u/bilal87)\
**Post date:** [February 22, 2025, 12:46pm UTC](https://community.shopify.com/t/api-graphql-productcreate-with-options-error/392434/2 "2025-02-22T12:46:30Z")

</div>

Were you able to find a solution? I am trying to create a product with multiple variants but the mutation is not working.

---

<div class="post-metadata">

**Author:** ![tirthmehta10](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@tirthmehta10](https://community.shopify.com/u/tirthmehta10)\
**Post date:** [February 27, 2025, 7:05pm UTC](https://community.shopify.com/t/api-graphql-productcreate-with-options-error/392434/3 "2025-02-27T19:05:56Z")

</div>

I am attempting to create a product without multiple variants. While I can successfully create a product with fields like title, vendor, tags, and status, I am unable to include and retrieve additional details such as SKU, price, cost, inventory, and barcode. If you know how to achieve this using the productCreate mutation, your guidance would be greatly appreciated. For more details: [https://community.shopify.com/topic/2964382](https://community.shopify.com/topic/2964382)
