Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Amazon MWS example with boto
# MWS API docs at http://docs.developer.amazonservices.com/en_US/orders-2013-09-01/Orders_Datatypes.html#Order
# MWS Scratchpad at https://mws.amazonservices.com/scratchpad/index.html
# Boto docs at http://docs.pythonboto.org/en/latest/ref/mws.html?#module-boto.mws
from boto.mws.connection import MWSConnection
...
# Provide your credentials.
conn = MWSConnection(
aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY,
Merchant=SELLER_ID
)
# Get a list of orders.
response = conn.list_orders(
CreatedAfter='2016-08-01T00:00:00Z',
MarketplaceId=[MARKETPLACE_ID]
)
# Get the Amazon Order Id.
response.ListOrdersResult.Orders.Order[0].AmazonOrderId
@jefferythewind

This comment has been minimized.

Copy link

@jefferythewind jefferythewind commented Oct 23, 2016

Very Helpful and works out of the box!

@chatlourd

This comment has been minimized.

Copy link

@chatlourd chatlourd commented Jun 2, 2018

Have you managed to get this to work with get_matching_product_for_id ?

@gmartin83

This comment has been minimized.

Copy link

@gmartin83 gmartin83 commented Dec 17, 2020

i'm getting this error. IndexError: list index out of range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment