Skip to main content

CLI commands

The module ships six bin/magento commands. Two for inspection / scanning, four for action — including the --dry-run and --force escape hatches you'll need on launch day.

preorder:list

List pre-orders. Defaults to all statuses; flags filter the result.

bin/magento preorder:list
bin/magento preorder:list --status=pending
bin/magento preorder:list --vault=failed
bin/magento preorder:list --balance=outstanding
bin/magento preorder:list --email=customer@example.com
bin/magento preorder:list --limit=200

Output is a table — Pre-order #, Order #, Customer, Status, Vault, Deposit, Balance, Created. Useful for ops triage when the admin grid is slow or you want to grep results.

Source: Console/Command/ListCommand.php.

byte8:preorder:scan-stock

Scan the catalog for SKUs that have pending pre-order items, check whether each is now salable, and trigger the Mark-Ready flow for any that have stock available. The same code path the MSI SourceItemsSaveInterface plugin runs — usable manually, in cron, or as a recovery tool after a bulk stock import.

# Scan every SKU with pending pre-order items
bin/magento byte8:preorder:scan-stock

# Limit to one SKU
bin/magento byte8:preorder:scan-stock --sku=24-MB01

# See what would happen without triggering anything
bin/magento byte8:preorder:scan-stock --dry-run

Output is a table — SKU, Pending Items, Salable, Triggered, Items Updated, Note. Use --dry-run to preview before running on launch day. Recommended cron tier: every 5–10 minutes as a belt-and-braces backup to the MSI plugin (handles bulk imports, vendor-sync paths, and edge cases where the plugin doesn't fire).

Source: Console/Command/ScanStockCommand.php.

preorder:vault:process

Manually trigger the vault capture cron. Use to process pending captures without waiting 5 minutes.

# Process all pending captures
bin/magento preorder:vault:process

# Process a single pre-order
bin/magento preorder:vault:process --id=1234

# Dry run — show what would be charged, charge nothing
bin/magento preorder:vault:process --dry-run

Source: Console/Command/VaultProcessCommand.php.

--dry-run is the safety net before a big batch. It walks the same selection the cron would, prints what each charge would do (token, amount, gateway), and exits without calling the gateway.

preorder:vault:reset

Reset failed or fallback-sent vault captures so the cron will retry them.

# Reset a single failure
bin/magento preorder:vault:reset --id=1234

# Reset all currently-failed captures
bin/magento preorder:vault:reset --all-failed

# Reset only fallback-sent (already emailed customer)
bin/magento preorder:vault:reset --status=fallback_sent

Use this after a gateway outage, when you've fixed the root cause and want to re-run captures that previously exhausted retries. Without reset, those pre-orders stay in fallback_sent forever and the cron skips them.

Source: Console/Command/VaultResetCommand.php.

preorder:complete

Force-complete a pre-order. Captures via vault if available, otherwise marks complete without payment.

# Complete via vault, validate normally
bin/magento preorder:complete 1234

# Skip all validation — including stock and balance checks
bin/magento preorder:complete 1234 --force

--force is the breakglass for "this pre-order is in a weird state, just close it". Use sparingly; prefer the admin grid action for normal cases.

Source: Console/Command/CompleteCommand.php.

preorder:cancel

Cancel a pre-order, revert reservation, optionally refund.

bin/magento preorder:cancel 1234
bin/magento preorder:cancel 1234 --reason="Customer requested - launch slipped to Q3"

The reason is stored in the notification log for audit. Source: Console/Command/CancelCommand.php.

DI registration

All six commands are registered as Magento\Framework\Console\CommandListInterface entries in etc/di.xml. If a command isn't available after install, run bin/magento setup:di:compile and cache:flush.

Output formatting

All commands respect --no-ansi for log-friendly output and --no-interaction for scripting. Standard Symfony Console flags. Exit codes:

CodeMeaning
0Success
1Validation / not-found error
2Gateway / external failure
64+Internal — file a support ticket