Magento Amazon Integration CLI Commands
The Magmodules Amazon integration for Magento 2 includes powerful CLI commands that allow store administrators and developers to automate key operations such as importing Amazon orders or testing the API connection. This guide covers the available commands and how to use them effectively within your Magento environment.
Available CLI Commands
magmodules-amazon:import-orders
This command triggers a manual import of orders from Amazon Marketplace into your Magento 2 store.
Usage:
php bin/magento magmodules-amazon:import-orders
What it does:
Fetches all eligible orders from Amazon based on your current configuration and imports them into Magento. This is especially useful for debugging or syncing orders outside the automatic schedule.
magmodules-amazon:test-connection
This command verifies the connection between your Magento store and Amazon’s API using the credentials set in the configuration.
Usage:
php bin/magento magmodules-amazon:test-connection
What it does:
Tests the configured Client ID, Client Secret, Application ID, and Token to confirm successful API communication with Amazon. Ideal for setup validation and troubleshooting connection issues.
When to Use CLI Commands
- During initial setup – to confirm Amazon API credentials are working correctly.
- For debugging – to manually fetch orders and test the connection if issues arise.
- In cron/job scripts – integrate into custom automation workflows as needed.
Requirements
- Magento 2 with the Magmodules Amazon integration installed and enabled
- Valid Amazon API credentials set in the configuration
- Access to the command line interface (CLI) of your Magento 2 installation
Pro Tip
Run php bin/magento list
to confirm that the magmodules-amazon
commands are registered correctly in your Magento CLI. If you don’t see them, ensure the module is installed and enabled, and then run:
php bin/magento module:enable Magmodules_Amazon
php bin/magento setup:upgrade
php bin/magento cache:flush
For more detailed configuration steps, refer to our Amazon credentials setup guide.