AI Reports

Magento 2 SQL queries › Orders and sales

Which paid orders haven't shipped after 3 days?

Short answer: Magento has no grid filter for “paid but not shipped”. Look for orders in processing state that have no row in sales_shipment.

In the Magento admin

  1. Go to Sales › Orders, filter Status = Processing and an old purchase date.
  2. Open each order and check the Shipments tab.

With one query

These queries only read data. Run them on a copy of your database if you can, or ask your developer to. If your tables have a prefix (set in app/etc/env.php), add it to each table name.

Works on Magento Open Source and Adobe Commerce:

SELECT o.increment_id, o.created_at, o.status, o.shipping_description, o.base_grand_total
FROM sales_order o
WHERE o.state = 'processing'
  AND o.is_virtual = 0
  AND o.created_at < NOW() - INTERVAL 3 DAY
  AND NOT EXISTS (SELECT 1 FROM sales_shipment sh WHERE sh.order_id = o.entity_id)
ORDER BY o.created_at;

Good to know

Related

Gaurav Harsh

Gaurav Harsh is a Magento developer who works on large Adobe Commerce stores and builds AI Reports, a Magento extension for asking your store's data questions in plain English. LinkedIn