Which documents disappear when you delete a Magento 2 order?

1 min read

Two trays with bundles of documents held by brass clips

On a restorable test copy, prepare two fictional orders. Record their internal IDs, invoices, shipments and credit memos. If the test environment has integrations, also record references to payment, ERP and attachment records. In Sales → Orders, select just one test order.

Check what is removed and in what order

Bulk Order Deletion 1.0.0 removes invoices, shipments and credit memos before the order record. The original controller ran against a local data model with 701 selected and 702 as the control. In a separate run, a shipment deletion error left 701 in place after its invoice had gone. Bulk Order Deletion. Module documentation.

Compare the documents by ID after the test

Check each type of document in the test copy. After an error, compare the state with your baseline and restore the copy before retrying. The table shows record counts in the local model of the two orders.

Test records before and after the operation
Record type701 before701 after success702 control after success701 after interruption
Order1011
Invoice1010
Shipment1011
Credit memo1011

Use the sales and payment workflow for cancellation or refund, based on the current order status. Check attachments, customer data and records in your ERP or payment provider separately. Adobe Commerce order workflow. Adobe Commerce refunds and credit memos.

For selecting test orders, see the earlier guide.

Previous

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)