Hi,
I just started learning Python 3.4 recently. And I am not a professional programmer. I just found that the MWSConnection only works for Amazon North America MWS. But when I try it for Amazon Europe MWS, the access is always denied and there is no request ID. Is there anyone coule help me solve this issue? Thank you for reading this issue.
from boto import mws
from boto.mws.connection import MWSConnection
accessKey = "XXXXXXXX"
merchantID = "XXXXXXXXXX"
marketplaceID = "A1F83G8C2ARO7P" #Amazon.co.uk
secretKey = "XXXXXXXXXXXXXXXXXXX"
mws = MWSConnection(accessKey, secretKey)
mws.Merchant = merchantID'
mws.SellerId = merchantID
mws.MarketplaceId = marketplaceID
response = mws.list_orders(CreatedAfter = '2016-05-09T00:00:00Z', MarketplaceId = [marketplaceID], OrderStatus=['Shipped','Unshipped'])
Looks no one knows how to solve it. I figured it out myself. The key is the code of this line, https://github.com/boto/boto/blob/develop/boto/mws/connection.py#L269
After changing 'mws.amazonservices.com' to 'mws-eu.amazonservices.com', I can use the code above to connect to Amazon Europe. So this issue is all about the Amazon Amazon MWS endpoints. I can use Boto to connect to Amazon Japan, China, India, Europe by following the instruction of this page, http://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html
Simply set the endpoint when you instantiate the MWSConnection class by using a host='mws-eu.amazonservices.com' keyword argument. You can similarly inject your Merchant=merchantID value there, which will also serve as a default for SellerId.
Thanks. You inspired me the easiest way to do the job.
Useful to me as well, saved debug.
Is there a way to pass MWS Auth token as well ?
Thanks
i want to ask you, how to sloved the error?
boto.mws.response.AccessDenied: AccessDenied: Unauthorized
Missing required MWSAuthToken for Seller.
my code like:
conn = MWSConnection(
"AKdkkewerwerwerwer",
"trtyrtutyutyurjJrtrwerwerwer",
Merchant="dfgertyrtyrtyrtutyu0",
host='mws-eu.amazonservices.com'
)
result = conn.list_inbound_shipment_items(
LastUpdatedAfter=start_time, LastUpdatedBefore=end_time
)
Looks no one knows how to solve it. I figured it out myself. The key is the code of this line, https://github.com/boto/boto/blob/develop/boto/mws/connection.py#L269
After changing 'mws.amazonservices.com' to 'mws-eu.amazonservices.com', I can use the code above to connect to Amazon Europe. So this issue is all about the Amazon Amazon MWS endpoints. I can use Boto to connect to Amazon Japan, China, India, Europe by following the instruction of this page, http://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html
hi, aoerliang, i want to ask you how to sloved it? my code occur error: boto.mws.response.AccessDenied: AccessDenied: Unauthorized Missing required MWSAuthToken for Seller
my python version is 3.6.6. boto version is 2.49.0.
thanks a lot!
Most helpful comment
Useful to me as well, saved debug.
Is there a way to pass MWS Auth token as well ?
Thanks