Bulk delete test orders through Shopify API

developer8971
Tourist
44 0 2

Is there a fast way to bulk delete all test orders I created through Shopify API?

Currently there's only a single DELETE request available.  And there's no way to quickly get all the order IDs in the application without having to parse through a JSON Response..

0 Likes
Nick
Community Moderator
Community Moderator
3779 357 741

Hi there, 

Nick here from Shopify. 

Natively within the Shopify admin, it is not possible to bulk delete orders. To delete an order, you first must archive or cancel it, and you can bulk archive orders (Admin > Orders > click on orders you want to archive > Action > Bulk Archive). There is an app however which might be able to do the trick for you here. It's called Excelify and you can find the information about it from the developers own website here

Once an order has been archived, it will remove any record of it from your Shopify admin. Only orders with the following characteristics can be deleted. 

Hope this helps and don't hesitate to ask should you have any other questions about anything. 

All the best, Nick

Nick | Community Moderator @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Connor_Bode
Shopify Partner
1 0 0

If you're using the GraphQL API you can perform operations in batches of 100.  Based on my calculations for deleting metafields, you can delete around 5 objects per second (compared to 2 per second with the REST API rate limiting).

There's a GraphQL mutation draftOrderDelete which might do what you need. 

Check out our blog post on batch deleting metafields in Shopify for an example of how you can run a batch of mutations using the GraphQL API.

0 Likes
Muddart
New Member
1 0 0

There seems to be something missing here.  In a development shop we may import orders to test imports, and have to delete them.  I did a test import on only a few (20) but it's making me delete them one by one and telling me the record is being kept for "tax purposes" - these are not even orders made in Shopify. Seems like a big hole from a developers perspective to not have access to the databases in the development environment.

0 Likes