Hi,
So I’m building an API for my customers where they provide us with their email addresses and I look up the details of their order(s). I understand that this pull is limited to open orders. How do I include closed orders in my pull using the same data?
Topic summary
Main issue: A developer wants to fetch a customer’s order details by email but currently only retrieves open orders. They ask how to include closed orders using the same input data.
Key guidance provided:
- Use the Orders API with the status parameter set to “any” to return both open and closed orders. Example: /admin/api/2023-07/orders.json?status=any.
- Ensure the app has the read_all_orders scope in addition to read_orders or write_orders. This permission combination enables access to closed orders alongside open ones.
Context/clarification:
- The status parameter controls which order statuses are returned; “any” includes all statuses.
- No change to the customer-provided data is implied; the change is in query parameters and app scopes.
Outcome: Concrete steps were provided to expand the results to include closed orders. No disagreement or further questions were raised, and the issue appears resolved.
Hi LuxLadyFit,
To retrieve both open and closed orders using the Orders API, you can use the status parameter set to “any”. EG: /admin/api/2023-07/orders.json?status=any
You’ll also need to ensure the read_all_orders scope is added to your app along with read_orders or write_orders. This will enable you to access both open and closed orders in your API.
Hope this helps!