A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
You can find documentation on how to add metafields to Product Images: https://shopify.dev/api/admin-rest/2021-10/resources/product-image#put-products-product-id-images-im...
But I can't seem to find documentation on how to load metafields for Product Images.
I've tried with:
/api/2022-04/products/{{product_id}}/images/metafields.json
/api/2022-04/images/{{image_id}}/metafields.json
But none of these seem to be working.
Anyone an idea on how to load Product Image metafields?
Hi @alessandro04,
Look at this responses (for Variants images):
Look at this responses (for Product images):
After u get an 'image_id' u can request it from [GET] /admin/api/{api-version}/prodcts/{productId}/images/{imageId}.json
NOTE: To simplify this process, use the GraphQL AdminAPI
I hope this helps. If not, describe the problem in a little more detail, with code examples. 😉
Your reply doesn't answer my question. The problem isn't about the image_id it's about Shopify lack of documentation to load metafields for an image.
Oh, so, to request this data you need to use GraphQL API, u can see docs here.
That's the point of my question, I want to use the Rest API for this not the GraphQL. And since there is documentation to create metafields on images through the Rest API there should be an option to load the metafields through the Rest API
For REST API u can request it from:
NOTE: Read this article about GraphQL API, using the REST API in this case can shoot in your leg after a while.