A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi everyone,
I am building an app using the Shopify API. I would like to get data for completed orders only. What dictates a completed order? Is it the closed_at field in the Orders API? Anything else we can use as an indicator?
https://shopify.dev/api/admin-rest/2022-10/resources/order
Hi,
I guess its up to you to decide when you think its completed.
If the merchant doesn't automatically archive fulfilled orders then they would remain open
Maybe you just want to fetch orders with fulfillment_status=fulfilled
Hi Jordan,
Thank you so much for your response! Much appreciated. Can I also ask, would the closed_at date be sufficient too? I was thinking we employ if the closed_at date value is not null - to then retrieve the order?
Technically you can't fetch by the closed_at attribute so it would be by status='closed'
closed_at will get set when the order is closed in the admin. Some stores do this automatically when the items are fulfilled but some stores don't automatically close the order.
This means it is possible that an order has been delivered to the customer but the order still remains open
Your two options are
fulfillment_status='fulfilled'
status='closed'
Its up to you which one you choose
You are a Legend sir. Thanks so much for your replies and input.
Wishing you all the best in whatever may be coming your way in life.
Kind Regards,
Lakshey