Hello, this is possible in our GraphQL API. For example, with the `productUpdate` mutation you can input multiple metafields. See https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productupdate?#product...for the product example.
Hope you are well!! I'm using REST admin api for product metafield. I want to post this both metafields vlalue using REST admin api .
$array1 = array ( 'product' => array ( 'metafields' => array ( 0 => array ( 'namespace' => 'your_namespace', 'key' => 'your_key', 'value' => 'your_value', 'value_type' => 'string', ), 1 => array ( 'namespace' => 'your_namespace_2', 'key' => 'your_key_2', 'value' => 'your_value', 'value_type' => 'string', ), ), ), ); $getmetafields = shopify_call($token, $shop, "/admin/api/2021-04/products/6406423871657/metafields.json", $array1, 'POST'); $getmetafields = json_decode($getmetafields['response'], JSON_PRETTY_PRINT); echo "<pre>"; print_r($getmetafields); echo "</pre>";
This is my question too.
Is there any way to add necessary meta fields to one level above the products?
I mean adding meta fields somehow that could be assigned automatically to every new product, It's not reasonable to send a separate request for every single field, imaging all of my 1000 products have 50 fields, so how it will be handled?
Really I need to make 50000 requests?
Or I'm totally wrong here?
Did you have any answer related to this?
I am also interested in creating different metafields in one single call if possible.
We released a new and improved metafieldsSet mutation in our GraphQL Admin API: https://shopify.dev/api/admin-graphql/2021-10/mutations/metafieldsSet as part of the 2021-10 API version.
It lets you create or update multiple (up to 25) metafields on _different_ owners as well.