Amazon Connector for Magento 2 - User Guide
Amazon Connector for Magento 2 links your store with the Amazon marketplace through the Amazon Selling Partner API (SP-API). It supports two-way product mapping, automatic order import, inventory synchronization with a safety buffer, and shipping tracking upload back to Amazon. This guide covers installation, the Amazon and AWS credentials you need, configuration, how each sync flow works, CLI commands, cron jobs, and troubleshooting.
Extension Installation
For Magento Marketplace customers
Find the Composer name and version of the extension in its
composer.jsonfile.Log in to your server via SSH and run:
composer require meetanshi/magento-2-amazon-connectorEnter your Magento authentication keys when prompted (public key = username, private key = password).
Verify the module is recognized:
php bin/magento module:status Meetanshi_AmazonConnectorEnable the module and run setup:
php bin/magento module:enable Meetanshi_AmazonConnector php bin/magento setup:upgrade
For Meetanshi customers
Extract the ZIP file and upload the extension to the root of your Magento 2 directory via FTP.
Log in to your server via SSH and run:
php bin/magento setup:upgrade
Deploy static content (both methods)
Magento 2.0.x to 2.1.x
php bin/magento setup:static-content:deployMagento 2.2.x and above
php bin/magento setup:static-content:deploy -f
Flush the cache
php bin/magento cache:flush
Before You Start: Amazon and AWS Credentials
The connector needs credentials from two places: your Amazon Seller Central account and AWS. Gather these before configuring the extension.
From Amazon Seller Central (SP-API app)
- Register or use a developer profile in Seller Central and create an SP-API application in the developer console.
- From the app, copy the Client ID (LWA App ID) and Client Secret.
- Authorize the app for your seller account and generate the Refresh Token.
- Note your Seller ID (Merchant Token) and your target Marketplace (for example, US, UK, or India).
From AWS (request signing)
- In the AWS IAM console, create or use an IAM user with SP-API access.
- Copy the Access Key ID and Secret Access Key.
- Note the API Region that matches your marketplace (for example,
us-east-1for North America oreu-west-1for Europe and India).
Keep all of these secure. They are stored encrypted in Magento and are never written to logs in plain text.
Configuration
Log in to the Magento admin and go to Stores > Configuration > Meetanshi > Amazon Connector.
General Settings
- Enable Amazon Connector: Turn the connector and its background sync hooks on or off.
- Test Mode (Sandbox): Set to Yes to send requests to Amazon's sandbox endpoints without making real updates. Use this while setting up.
- Enable Debug Logging: Set to Yes to write detailed request and response logs to
var/log/meetanshi_amazon.log. - Products Per Batch: The number of products processed per batch. Default is
50. Lower it if you hit API rate limits.
Amazon API Credentials
- Client ID / Client Secret: Your SP-API application credentials from Seller Central.
- Refresh Token: The long-lived OAuth token generated when you authorized the app.
- Amazon Marketplace: Your target Amazon locale (for example, US, India, or UK).
- Seller ID (Merchant Token): The identifier for your merchant account.
AWS Credentials
- Access Key ID / Secret Access Key: Used to sign requests with AWS Signature V4.
- API Region: The AWS region that matches your marketplace (for example,
us-east-1oreu-west-1).
Product Sync
- Enable Automatic Sync: Turn on the scheduled listings upload.
- Sync Direction: Choose Push (Magento to Amazon), Pull (Amazon to Magento), or Both.
- Source Mapping Fields: Map your Magento attributes to Amazon listing fields for Product Name, Description, Price, and Barcode (UPC or GTIN).
- Price Adjustment (%): Change the price during sync. For example,
10lists items at a 10% markup on Amazon.
Order Import
- Enable Automatic Import: Turn on the scheduled order import.
- Import Order Statuses: Select the Amazon order statuses to import (for example, Unshipped or PartiallyShipped).
- Auto-send Tracking to Amazon: Set to Yes to upload tracking codes to Amazon automatically when you ship an order in Magento.
Inventory Sync
- Enable Automatic Inventory Sync: Turn on the scheduled stock updates.
- Safety Stock Buffer: The quantity to hold back from Amazon to help prevent overselling. For example, if Magento stock is 10 and the buffer is 2, the quantity sent to Amazon is 8.
After entering your settings, save the configuration and flush the cache if prompted. Keep Test Mode on until you have confirmed a successful test sync, then switch it off for live operation.
Mapping Products
Product sync works on products that are mapped between Magento and Amazon in the meetanshi_amazon_product records.
- Push: Selected Magento products are matched to their Amazon SKU and ASIN, compiled into a feed, and uploaded to the Amazon Listings API. A job ID is written to the sync log.
- Pull: Active Amazon listings are pulled, matched to Magento products by SKU, and updated with the current Amazon price and ASIN.
For Amazon India, make sure your barcode (EAN or UPC), HSN code, and GST attributes are mapped so listings meet local requirements.
Importing and Fulfilling Orders
- On the schedule you set, the connector fetches Amazon orders that match your selected statuses within the look-back period.
- Each order is parsed, the buyer's shipping details are read (guest buyers use a placeholder customer), matching SKUs are added to a quote, and a Magento order is created. The Amazon Order ID is linked to the Magento Order ID.
- If Auto Generate Invoice is enabled, an invoice is created and the order moves to processing.
- When you ship the order in Magento and enter a carrier and tracking code, the connector sends the tracking back to the Amazon Fulfillment API, which notifies the buyer and updates the order in Seller Central.
CLI Commands
Run these from the Magento root to trigger a sync manually.
| Command | Options | Purpose |
|---|---|---|
php bin/magento meetanshi:amazon:product-sync |
--direction=[push|pull|both] |
Sync catalog products in the chosen direction. |
php bin/magento meetanshi:amazon:order-import |
--days=[days] |
Import Amazon orders, overriding the look-back period. |
php bin/magento meetanshi:amazon:inventory-sync |
(none) | Sync stock levels for all mapped products. |
Cron Schedule
The connector runs three cron jobs. Make sure Magento cron is running (php bin/magento cron:run).
| Job | Schedule | Action |
|---|---|---|
meetanshi_amazon_product_sync |
0 2 * * * (daily, 2:00 AM) |
Bulk product detail sync. |
meetanshi_amazon_order_import |
*/15 * * * * (every 15 minutes) |
Fetch and import recent Amazon orders. |
meetanshi_amazon_inventory_sync |
0 * * * * (hourly) |
Adjust Amazon listing inventory. |