Metafield endpoint Link response header ignores filters from the original request

AshwiniSharma
Shopify Partner
16 0 1

I think I may have found a bug in cursor based pagination affecting the metafield endpoint.

The issue happens with filtered requests where pagination is required, i.e a owner_id has more than 100 metadata associated with it. The first page is filtered properly, but the next page response does not respect the filters from the original request.

Sample API call for reference:

curl --location --request GET 'https://{shop_id}.myshopify.com/admin/api/2021-07/metafields.json?metafield[owner_id]=XYZ&metafield[...'
--header 'User-Agent: Jersey/2.31'
--header 'Accept: application/json'
--header 'X-Shopify-Access-Token: ****'

If there are more than 100 metafield responses for this particular product owner resource, the link header that is provided in the response will drop the owner_id and owner resource params and return unfiltered data when using the url provided in the Link response header.

https://{shop_id}.myshopify.com/admin/api/2021-07/metafields.json?limit=100&page_info=****5leHQifQ

Unsure if this issue persists with other endpoints, but I've been able to reproduce the behavior consistently on the metafield endpoint.  

Replies 0 (0)