Skip to content

Instantly share code, notes, and snippets.

@absognety
Forked from mmlin/boto-mws-example.py
Created October 9, 2020 04:48
Show Gist options
  • Save absognety/8e8beb1f0d5b86a1bb07ed495c4c5bb9 to your computer and use it in GitHub Desktop.
Save absognety/8e8beb1f0d5b86a1bb07ed495c4c5bb9 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment