Thursday, November 13, 2014

If you are into integrating third party api's into .net c# , you might have had to bang your heads against amazon api's at some point.

To save someone the same, putting out some findings here.

A very important amazon Utility that I can find to dry run what you will be writing in code is

https://mws.amazonservices.in/scratchpad/index.html

This allows you to put in all required details and check the results.

Of course, prerequisite to this is having proper amazon subscription, clientID,secret key,MarketPlaceID.

1)If you want to list a product already on amazon for your inventory. Ideal way to do it using the EAN and SKU present on amazon and link it to your inventory.

EAN is an identification number for a product which could be available from many sellers on amazon.

SKU is basically a product code and it differs for every individual product piece.

Xml for product upload using EAN as well as SKU

FeedType: _POST_PRODUCT_DATA_
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
 <DocumentVersion>1.01</DocumentVersion>
 <MerchantIdentifier>merchandIdentifier</MerchantIdentifier>
 </Header>
 <MessageType>Product</MessageType>
 <PurgeAndReplace>false</PurgeAndReplace>
 <Message>
 <MessageID>1</MessageID>
 <OperationType>Update</OperationType>
 <Product>
 <SKU>skuID</SKU>
 <StandardProductID>
 <Type>EAN</Type>
 <Value>EAN ID</Value>
 </StandardProductID>
 </Product>
 </Message>
</AmazonEnvelope>

Once your product is linked to amazon, it will not be visible straight away,  as amazon does not know it's inventory nor the pricing that seller wants to set.
Hence next step is update price as well as update inventory:

2)Update Inventory:

Feed Type:_POST_INVENTORY_AVAILABILITY_DATA_
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>Merchang Identifier</MerchantIdentifier>
</Header>
<MessageType>Inventory</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Inventory>
<SKU>Sku ID</SKU>
<Quantity>20</Quantity>
</Inventory>
</Message>
</AmazonEnvelope>

Once you update the inventory, next step is update your price.
Feed Type:_POST_PRODUCT_PRICING_DATA_
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>Merchant Identifier</MerchantIdentifier>
</Header>
<MessageType>Price</MessageType>
<Message>
<MessageID>1</MessageID>
<Price>
<SKU>SKU</SKU>
<StandardPrice currency="yourcurrencyCode">price</StandardPrice>
</Price>
</Message>
</AmazonEnvelope>

Once all 3 of the above are completed, the product should be visible on amazon as part of your inventory.


Labels: , , , , ,