error with paging on orders of customers

TOZDEV
Shopify Partner
5 0 3

Hello,

 

One of our customer have 96 orders, when calling the end point :

admin/api/2019-10/customers/XXXX/orders.json?fields=id&status=any

the api return a link 'next' on the same endpoint with the page_info.

admin/api/2019-10/customers/XXXX/orders.json?fields=id&page_info=eyJz....

When calling this link Shopify reply with an error :

{"errors":{"customer_id":"customer_id cannot be passed when page_info is present. See https:\/\/help.shopify.com\/api\/guides\/paginated-rest-results for more information."}}

removing the "customers/XXXX/" from the link, make it work properly.

It is ugly, beacause the code can not be generic any more.

 

It is the expected behaviour? 

 

Thank you for any advice,

Marc Guiot.

 

_JB
Shopify Staff
Shopify Staff
750 87 165

Hey @TOZDEV,

 

Thanks for bringing this up, I've been able to replicate the behaviour as well and can confirm this isn't expected. You should be able to use the pagination link as-is with no modifications to the URL. I've raised this with our developers who are currently investigating, and will be implementing a fix to allow this link to work as expected. As soon as I have an update on that, I'll post back here to let you know.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

PittsburghJoe
New Member
2 0 0

I have the same problem with a different end point :

 

/admin/api/2019-10/products/XXXXXX/variants.json?limit=10&fields=id,barcode

 

I have to remove "products/XXXXXX/"  from the page_info link returned to get it to work.

 

Thanks,

Joe

0 Likes
_JB
Shopify Staff
Shopify Staff
750 87 165

Hey @PittsburghJoe, thanks for bringing up this other example.

 

@TOZDEV and @PittsburghJoe our developers were able to resolve both issues with regards to paginating through customer orders or product variants. You can now make a call using the provided pagination link, and it will complete as expected without needing to remove the customer_id/product_id from the URL.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

PittsburghJoe
New Member
2 0 0

Great. It works as expected now. 

Thank you,

Joe

0 Likes
shopSketch
Tourist
5 0 1

@_JB we're seeing the same thing on `customer_saved_searches`.

There is a forum post acknowledging the issue, but no updates.

We're getting worried about the upcoming deprecation of pagination with no working cursor based solution for `customer_saved_searches` on any API version.

0 Likes
_JB
Shopify Staff
Shopify Staff
750 87 165

Hey @shopSketch,

 

I've checked in and can confirm our devs are working on it. We'll be sure to have this fixed before the current version is deprecated, keep an eye on the original forum post as Hassain will post an update there once it's resolved.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

mwaqas
Shopify Partner
2 0 1

{"status":"status cannot be passed when page_info is present. See https:\/\/help.shopify.com\/api\/guides\/paginated-rest-results for more information."}

i'm getting this error when going to page 2 and if i remove status then it says "name" cannot be passed, next field i'm passing is name.

Any ideas why this is still happening.