Shopify Order API : New pagination method returns same page_info and gives duplicate results

Shopify Order API : New pagination method returns same page_info and gives duplicate results

aspirewebsystem
Visitor
1 0 1

Dear Shopify team,

I am currently using order api for admin/api/2021-10/orders.json. I am using latest pagination method, which gives Link in response header.  So I am taking next page based on rel="next" in Link from response header.

 

Using admin/api/2021-10/orders/count.json, I am getting 2657 results. So I am getting 11 pages. Following links are generated:

https://myshop.myshopify.com/admin/api/2021-10/orders.json?status=all&created_at_min=2009-12-31 23:00:00&created_at_max=2022-07-23 00:00:00&limit=250

 

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJzdGF0dXMiOiJhbGwiL...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJwc...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJuZ...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJwc...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJuZ...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJwc...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJuZ...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJwc...

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJuZ...

 

https://myshop.myshopify.com/admin/api/2021-10/orders.json?limit=250&page_info=eyJkaXJlY3Rpb24iOiJwc...

 

If you can check page_info in query string, it shows duplicate random string in few of the urls.

Using these links, I am getting only 250 unique results, rest results are duplicated.

 

Can anyone tell me, what is going wrong here?

Replies 2 (2)

adam1231
Visitor
1 0 0

I am getting the same issue

VikashGaurav
Shopify Partner
1 0 1

The response header includes a link to the previous page of results and a link to the next page,

ex: 

Link: "<https://{shop}.myshopify.com/admin/api/{api_version}/products.json?page_info=abcdefg&limit=3>; rel=previous, <https://{shop}.myshopify.com/admin/api/{api_version}/products.json?page_info=opqrstu&limit=3>; rel=next"


if response header only includes a link to the previous page, then you've reached the last page of results.

ref: pagination-rest#supported-endpoints