Python API customer.orders() empty

Topic summary

Issue: In the Shopify Python API, customer.orders() returns an empty list even though orders_count=1 and a specific order clearly links to that customer.

Cause: Orders older than 60 days require the app permission (scope) “read_all_orders”. Using only “read_orders” limits results to the last 60 days and will typically return an empty array for older orders.

Action: Check the order’s age. If it’s over 60 days, update the app to include the “read_all_orders” scope and retry the query.

Notes: This behavior aligns with the API FAQ; the empty array is expected when the scope is insufficient for older orders.

Status: No confirmation that the change resolved the issue, but guidance points to a missing permission as the likely cause. The discussion appears open pending verification.

Summarized with AI on February 23. AI used: gpt-5.

I have an issue with the Python API package.

The customer.orders() function will not find all the orders associated with the given customer.

For example I have a customer with an order count of 1.

shopify.Customer.find(407915331645)

=> customer(407915331645)

shopify.Customer.find(407915331645).orders_count

=> 1

shopify.Customer.find(407915331645).orders()

=>

shopify.Order.find(380765536317)

=> order(380765536317)

shopify.Order.find(380765536317).customer

=> customer(407915331645)

shopify.Order.find(380765536317).customer.orders()

=>

The customer.orders() function returns an empty list when I know for certain there is an order tied to that account. The last line clearly illustrates the issue.

Not sure if this the Python packages fault or the API fault. Any help would be appreciated.

Hey @codyk12 ,

We touch on this in the API FAQ - if the order in question is older than 60 days and you are unable to successfully retrieve the data via API, you may be missing the necessary scope “read_all_orders”. Querying for orders that are older than 60 days with only “read_orders” will typically return an empty array, like what you are seeing here.

I would check to see if your order is greater than 60 days old, and if so, make sure your app has the “read_all_orders” scope applied before trying again.

Best,