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