Discussing APIs and development related to customers, discounts, and order management.
Hi,
I have all read_orders,read_draft_orders, read_all_orders scopes, but when I try to get an order that is archieved after fulfilled, it retrun empty product.
I try to call by this
static async getOrderById(session: Session, orderId: string): Promise<Record<string, unknown>> { const client = new shopify.clients.Rest({ session: session }); const result = await client.get({ path: `orders.json?name=${orderId}&status=any`, }); const order = (result.body as Record<string, unknown>).orders as Record<string, unknown>; return order; }
Thanks for getting in touch! If you're looking for archived orders, in REST you could call a GET for example to orders.json?status=closed which would give you a store's orders that show as 'archived' in the Shopify Admin. There's a closed_at timestamp present on the orders object too. Feel free to check out the docs here that will show you what status(s) you can GET. Hope that helps!