Solved

Can you specify ascending or descending on a field when posting a request?

t3chlady
Shopify Partner
10 0 1

When posting a request for a list of orders from Shopify, can you specify that the list be returned in a specific order on a selected field?  Like order id ascending or descending.  

Are there other functions that would return a record with the current maximum value so that you could determine where to stop when processing a list in number order?

 

Accepted Solution (1)

PageFly-Theodor
Globetrotter
576 75 88

This is an accepted solution.

Hi @t3chlady ,
This is Theodore from PageFly - Shopify Page Builder App.

 

Shopify's Order API doesn't let you directly sort order lists. Here's how to achieve similar results:

  1. Download and sort on your end: Get all orders and sort them within your code based on the desired field (e.g., order ID).

  2. Filter by since_id: This is good for new orders. Include the since_id parameter in future requests to only get orders created after a specific point (the ID of the latest order you received before).


Best regards,
Theodore | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Replies 2 (2)

PageFly-Theodor
Globetrotter
576 75 88

This is an accepted solution.

Hi @t3chlady ,
This is Theodore from PageFly - Shopify Page Builder App.

 

Shopify's Order API doesn't let you directly sort order lists. Here's how to achieve similar results:

  1. Download and sort on your end: Get all orders and sort them within your code based on the desired field (e.g., order ID).

  2. Filter by since_id: This is good for new orders. Include the since_id parameter in future requests to only get orders created after a specific point (the ID of the latest order you received before).


Best regards,
Theodore | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

t3chlady
Shopify Partner
10 0 1

Thank you PageFly Theodor.  Your answers have always been quite to the point and have resolved my issues.