From 2baa691991be5a1e092f71404ce486687b24f48d Mon Sep 17 00:00:00 2001 From: klo Date: Thu, 3 May 2018 12:42:25 +0200 Subject: [PATCH] Feeds example. --- docs/source/feeds.rst | 97 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/docs/source/feeds.rst b/docs/source/feeds.rst index 8a354d25..31f3cd70 100644 --- a/docs/source/feeds.rst +++ b/docs/source/feeds.rst @@ -1,3 +1,100 @@ ############ Feeds ############ + +There are several types of feeds and some of them are used to send product data. Here is a example of how to send product basic data, inventory data and product images. + +To build your own XML data you should use Amazon documentation about feed types that you can find here: http://docs.developer.amazonservices.com/en_US/feeds/Feeds_FeedType.html#FeedType_Enumeration__ProductInventoryFeeds. Also Python xml.etree.ElementTree module can be very useful. + +.. code-block:: Python + + import mws + + access_key = 'accesskey' #replace with your access key + seller_id = 'merchantid' #replace with your seller id + secret_key = 'secretkey' #replace with your secret key + marketplace_usa = 'ATVPDKIKX0DER' + + feed = mws.Feeds(access_key, secret_key, seller_id, region='US') + + print "### Product feed ###" + xml = """ + +
+ 1.01 + merchantid +
+ Product + + 1 + Update + + 153024 + + EAN + 8427426004696 + + + DENTAID Interprox Micro 18 units + Dentaid + Interprox Plus Micro is designed to remove oral biofilm (bacterial plaque) build-up from 0.9 mm* interproximal spaces, particularly in the premolar and molar areas. + 15.76 + Dentaid + 8427426004696 + + + + + + English + + + + + + +
""" + response = feed.submit_feed(xml, "_POST_PRODUCT_DATA_", MSW_MARKETPLACE_ID).parsed + print response + + print "### Inventory feed ###" + xml = """ + +
+ 1.01 + merchantid +
+ Inventory + + 1 + Update + + 153024 + 2 + + +
""" + response = feed.submit_feed(xml, "_POST_INVENTORY_AVAILABILITY_DATA_", MSW_MARKETPLACE_ID).parsed + print response + + + print "### Product image feed ###" + xml = """ + +
+ 1.01 + merchantid +
+ ProductImage + + 1 + Update + + 235609 + Main + http://your-domain.org/235609.JPG + + +
""" + response = feed.submit_feed(xml, "_POST_PRODUCT_IMAGE_DATA_", MSW_MARKETPLACE_ID).parsed + print response \ No newline at end of file