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!!.
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025