What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Cancelled orders returning null

Cancelled orders returning null

softype
Visitor
2 0 0

Hi,

We are successfully getting orders from shopify api for status as open, closed and any. Now while fetching cancelled orders from shopify api it returns no orders in response but cancelled orders are available on shopify admin portal.

 

Api's tried to get cancelled orders

/admin/api/2021-07/orders.json?status=cancelled

/admin/api/2021-07/orders.json?financial_status=voided

/admin/api/2021-07/orders.json?status=any&financial_status=voided

 

Replies 3 (3)

Luke_K
Shopify Staff
402 66 102

Hey @softype 

If I query the API via  /orders.json?status=cancelled on my store I am returned orders in which the cancelled_at field is not null and has a timestamp. 

Would you mind sharing an x-request_id from the headers when you make this call and we can take a look into things - thanks!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
softype
Visitor
2 0 0

Hi,

Thank you for your reply. Please find below header X-Access-token

We have also shring you the screenshot for api which we are accessing.

Luke_K
Shopify Staff
402 66 102

Hey @softype 

I took a look into this for you. Checking the database, the store has cancelled orders. However these orders were created over 60 days ago.

Checking out the app you made this call with to orders.json, your app does not have access to more than the last 60 days of orders on the store.

You can get access to these orders  by applying for the read_all_orders scope. It can be requested from within the app in the partner dashboard and will go through an approval process. Check out the docs here for further info. Once that scope is approved, I would then try the call again. You'd be able to get all the orders for the other calls you are making too with that scope.

I also edited this post as you shared your secret key there, I removed it. Just a friendly reminder to keep your credentials secure -  I'd recommend rotating your API access credentials to ensure security of your app. Hope that all helps!

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!