Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I want to update multiple metafields of product which is shown at my web site at one api call.
Url : https://{...}:{...}@{...}myshopify.com/admin/api/2021-07/products/{productID}/metafields.json
const metafieldParam = {
metafield(s) : [
{
namespace : "Urls",
key : "image",
value : "",
type :
},
{
namespace : "Urls",
key : "video",
value : "",
type : "",
},
{
....
},
]
}
await fetch(url, {method : 'POST' , headers : {'Content-Type' : 'application/json', body:JSON.stringify(metafieldParam)})
but I get 400 bad request from shopify.
If I send request by only one param ( ex : param = {metafield : { namespace : ... } } , It succeeds to update, but I want to update all metafields at one fetch call. Is this possible?
I tried these...
1. metafield(s)
2. param = { product : { metafields : { .... } } },
3. param = { product { id : product_id ,{ metafields : { .... } } }
4. PUT
5. POST
6. in url 2022-07
I appreciate your help !!!!
It's not possible to update multiple metafields at once. You will need to make a separate API call for each metafield you want to update.
Hi,
Is it possible to create multiple meta fields with the same key?
your help would be appreciated!!.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025