Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to paginate Orders using Shopify API with Curl

How to paginate Orders using Shopify API with Curl

RJA
New Member
4 0 0

Hello,

 

I'm trying to get a list of all orders with a limit of 20 orders per page.

 

I'm doing:

 

curl --ssl-no-revoke -sb -X GET "https://myshop.myshopify.com/admin/api/2022-10/orders.json?limit=20" -H "X-Shopify-Access-Token: mytoken" -H "Accept: application/json;charset=ISO-8859-2"

I get the orders, but i don't see any field that allows me to go to the next set of orders.

 

Can anyone help me?

Reply 1 (1)

JustinW
Shopify Partner
15 0 4

The information that you need is stored in the response header 'Link'. You can write the headers to a file using -D flag.

There is more info here:
https://stackoverflow.com/questions/10060098/getting-only-response-header-from-http-post-using-curl

Helping customers integrate their E-Commerce and Salesforce data