Why can't I define metafield type via API in product creation?

Why can't I define metafield type via API in product creation?

philip_u
Shopify Partner
3 0 0

Hi, I am building an app that will push/create products in Shopify via API. 

I am looking to push metafield values for these products as well. I would like to push the values as list.single_line_text_field

 

However, when I push a product w/ the metafield and define the parameters (i.e namespace, key, type, etc) - they show up as undefined metafields. This is fine - I can go and manually define them upon creation. HOWEVER, when I go to define a metafield, I am unable to select "List values". The option is simply not there, unlike when creating a metafield definition from scratch. 

 

I am doing something wrong? 

philip_u_0-1681329450403.png

 

Replies 2 (2)

Jason
Shopify Partner
11206 226 2314

You're not creating a definition first? You can do that via the API.
This workshop would be handy if you've not done that before:
https://workshops.shopify.dev/workshops/metafields-render-automate#3

Creating the definition first is the way to go here.

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★

philip_u
Shopify Partner
3 0 0

Hi, did you ever end up figuring this out? I have the same issue where list.single_line_text_product is not being created properly. My metafields show up as undefined and I can define them to use list. 

 

Thanks