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 do I get the last created lineItem in an order?

How do I get the last created lineItem in an order?

coco7cats
Visitor
1 0 0

Does anyone know how to get the last created lineItem in an order or know whether the default sort order rule is IDs ascending in Shopify?

I know how to sort order objects, but lineitems in an order don't don't have query parameters which can sort by created time.

When I get a lineItem by [last 1], it seems I can get the last created one, but I couldn't find any documents which say the default sorting rule is IDs ascending.

I don't want to get all lineitems only to find the newest lineitem...

 

 

Replies 0 (0)