draft-order-cleanup
Purpose
Queries open draft orders older than a configurable age and optionally deletes them. Draft orders accumulate from abandoned B2B quotes, incomplete manual orders, or old integrations and clutter the admin. Stale drafts also inflate pending revenue metrics.
Prerequisites
- Authenticated Shopify CLI session:
shopify store auth --store <domain> --scopes read_orders,write_orders - API scopes:
read_orders,write_orders
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| older_than_days | integer | no | 30 | Delete drafts older than this many days |
| dry_run | bool | no | true | Preview drafts to delete without executing mutation |
| format | string | no | human | Output format: human or json |
Safety
⚠️
draftOrderDeletepermanently deletes draft orders. Deleted drafts cannot be recovered. Run withdry_run: trueto review the list before committing. Check that no stale drafts represent active B2B quotes awaiting customer approval before deleting.
More from 40rty-ai/shopify-admin-skills
shopify-admin-skills
Master skill collection for Shopify store operators. Provides access to all merchandising, marketing, support, and operations capabilities.
157shopify-store-skills
A brief description of what this skill does
16shopify-admin-variant-option-normalizer
Detects inconsistent variant option naming (Sm vs Small vs S) and bulk-corrects to a standard set.
5shopify-admin-discount-hygiene-cleanup
Finds expired, zero-usage, or duplicate discount codes and optionally deactivates or deletes them.
5shopify-admin-gift-card-issuance
Issue Shopify gift cards (store credit) to customers as a goodwill gesture, post-return incentive, or loyalty reward.
5shopify-admin-fulfillment-status-digest
Generate a daily fulfillment triage digest: all open orders segmented by fulfillment age and flagged for holds or exceptions.
5