How to get archieved (after fulfilled) orders using REST order API?

Iceey
Shopify Partner
1 0 0

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 

orders.json?name=${orderId}&status=any
or
orders.json?status=any

both cannnot get the archieved orders.

This is my code for reference
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;
}
Replies 0 (0)