Retrieve a list of metafields from the resource's endpoint API - how is it supposed to work?

3 0 1


I have to return all metafields that are created in one store. The API call above just returns me an empty list even though I've created metafields and checked "Expose this metafield to Storefront API requests". It also says that it retrieves a list of metafields from the resource's endpoint. In this URL I don't see where i should provide the resource.

Can someone please explain how is this supposed to work? And could this request be used to return metafields for one resource only (for example Customers or Products).

If not is it possible to extract metafield values using this API?


I see there is a "fields" parameter that is supposed to show only certain fields, but I'm not sure how to make use of it.



Replies 3 (3)

Shopify Staff
11 5 4

Hi @sun11 !


You can get a list of Metafields under a specific resource by specifying the resource's ID in the URL.


For example:

// get list of products

// get details of product with ID 2342

// get metafields of product with ID 2342


You can read more about this API here, there are examples at the bottom of the page for getting metafields for different resource types:




To learn more visit the Shopify Help Center or the Community Blog.

3 0 1

Hey @danloomer,

Thank you for the answer. I'm aware of this solution but I'm afraid that this will really slow the execution. You are saying there is no way to return list of all existing metafields and then filtering it by resource? What I mean by this is, I need metafields for all resources that can have metafields (in this case it's:  Article, Blog, Collection, Smart Collection, Customer, Draft Order, Location, Order, Page, Product, Product Image, Product Variant and Shop). And only after I get the whole list of metafields to be able to filter it by the specific resource.

Shopify Partner
2 0 0

Hi @danloomer 

Maybe now it is possible to retrieve list of metafields for products?

I just need list of metafield definition for resource, for example

products {
metafield1 {definition...}
metafield2 {definition...}
maybe available in GraphQL API?

Is there any change I can retrieve it?