Skip to content

Instantly share code, notes, and snippets.

@mmlin
Created August 2, 2016 06:37
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mmlin/944fda9a466006a0c93726006991dd88 to your computer and use it in GitHub Desktop.
Save mmlin/944fda9a466006a0c93726006991dd88 to your computer and use it in GitHub Desktop.
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
Copy link

Very Helpful and works out of the box!

@chatlourd
Copy link

Have you managed to get this to work with get_matching_product_for_id ?

@gmartin83
Copy link

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