Development discussions around Shopify APIs
Hello,
I need to add additional fields to a product (beyond the ones Shopify provides). Ideally, it would be some sort of key-value that I can add to a product via API or CSV and that I can later retrieve in my storefront and admin. Is there any way to do this? Are metafields the way to go?
For example, I would like to add key-values for each product like: "marking-price-1-colors": "3", "marking-price-2-colors": "5" ... etc
Hey @apiexplorer ,
Metafields would indeed be the best way to do this. You can assign Metafields at the product level or variant level.
The Metafield structure is already in key/value format. It also supports namespaces so you can have identical key names in different namespaces (e.g. facebook.category, google_shopping.category).
You can also use raw JSON strings for the Metafield value for more flexibility (e.g. nested data structures)
User | RANK |
---|---|
10 | |
5 | |
3 | |
3 | |
3 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023