首页 > 解决方案 > Why cursor-based pagination in shopify ignores last page?

问题描述

I'm using shopify api to get list of orders

For first request I use this URL:

https://my-shop-name.myshopify.com/admin/orders.json?status=any&order=created_at+desc&limit=250 

and for all next use link to next page from response headers like described here:

Pagination with a link header

The problem is that last page or orders always gets ignored, because request for previous page doesn't contain link to next one.

That's weird, because it takes all orders from 4403 to 1153 (with 250 limit it's 13 pages) and it should make one more request (latest order number is 1101), to get latest 52 orders. Maybe the problem is in 250 limit parameter, but I don't know how to bypass it if I don't know exact number of orders

标签: shopifyshopify-api

解决方案


推荐阅读