Amazon provided MWS ( Amazon Marketplace Web Service ) as its API Gateway – a full-fledged APIs program to manage all operations. Anyone who has an Amazon account can use its MWS API service.
Get Amazon API Access Keys
To obtain amazon access keys, you need to sign up for an amazon web service account, this account is different from your shopping account.
Sign up here for amazon web service access: aws.amazon.com
Once your account is ready than access the security credential page. Here
you can create new amazon api access keys.
Just click on the “Create New Access Key” option, after complete this process, you will get Access Key ID and Secret Key.
Amazon MWS Submit Feed Process
Amazon has a Feeds API section, which allows you to upload Product, inventory, and order data to Amazon.
These feed operations work on the basis of XML or Flat files. Using SubmitFeed API call, upload feed data to amazon.
Lets start with SubmitFeed to Add Products to the Amazon account.
First, we are going to create an XML feed with Product data. Check Amazon feed api documentation
See below sample Product XML Feed. You can use this feed to upload product data to your amazon account.
For multiple products data use <Message>…</Message> repeatedly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<?xml version="1.0" encoding="iso-8859-1"?> <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd"> <Header> <DocumentVersion>1.01</DocumentVersion> <MerchantIdentifier>M_EXAMPLE_123456</MerchantIdentifier> </Header> <MessageType>Product</MessageType> <PurgeAndReplace>false</PurgeAndReplace> <Message> <MessageID>1</MessageID> <OperationType>Update</OperationType> <Product> <SKU>56789</SKU> <StandardProductID> <Type>UPC</Type> <Value>463563647487</Value> </StandardProductID> <ProductTaxCode>A_GEN_NOTAX</ProductTaxCode> <DescriptionData> <Title>Example Product Title</Title> <Brand>Example Product Brand</Brand> <Description>This is an example product description.</Description> <BulletPoint>Example Bullet Point 1</BulletPoint> <BulletPoint>Example Bullet Point 2</BulletPoint> <MSRP currency="USD">25.19</MSRP> <Manufacturer>Example Product Manufacturer</Manufacturer> <ItemType>example-item-type</ItemType> </DescriptionData> <ProductData> <Health> <ProductType> <HealthMisc> <Ingredients>Example Ingredients</Ingredients> <Directions>Example Directions</Directions> </HealthMisc> </ProductType> </Health> </ProductData> </Product> </Message> </AmazonEnvelope> |
Amazon MWS API Submit Feed Code
Now we are going to write SubmitFeed API call, which will upload this xml feed.
Check below example query code to Add products via SubmitFeed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
POST /Feeds/2009-01-01 HTTP/1.1 Content-Type: x-www-form-urlencoded Host: mws.amazonservices.com User-Agent: <Your User Agent Header> ?AWSAccessKeyId=0PB842ExampleN4ZTR2 &Action=SubmitFeed &FeedType=_POST_PRODUCT_DATA_ &MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE &MarketplaceIdList.Id.1=ATVExampleDER &SellerId=A1XExample5E6 &ContentMD5Value=ExampleMd5HashOfHttpBodyAsPerRfc2616Example &SignatureMethod=HmacSHA256 &SignatureVersion=2 &Timestamp=2009-01-26T23%3A51%3A31.315Z &Version=2009-01-01 &Signature=SvSExamplefZpSignaturex2cs%3D |
After execute above SubmitFeed script, Amazon MWS returns an XML response which contains the response to a successful request or subscription. If the request is unsuccessful, the main response element is ErrorResponse.
On success you will get the “FeedSubmissionId“. You can test the feed response via this ID. Check it out this “GetFeedSubmissionList” operation. This API call result show you that feed is processed completely or not.
You can use above script for another Feed Type operations, just change the “Action” parameter value and make xml feed according to it.
Thanks for taking the time to post this. Very helpful!
This is very helpful. Can you please provide me full source code. Please