-
Trying to get comfortable with the SP_API I created a small script just to authenticate me and list my orders. I want to move on try create inbound shipments. I doubt Amazon would appreciate me testing this code and fake shipments in production so I wanted to test in sandbox. However even the most basic requests fail: `from sp_api.base import Client, Marketplaces Get credentials from environment variablescredentials=dict( CreatedAfterTime = '2020-01-01T00:00:00Z' res = Orders(credentials=credentials, marketplace=Marketplaces.GB) Error:
Could anyone please offer any advice as to what I might be doing wrong. I have code to get inventory that works in prod too and fails with the same error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I modified my code:
If I change the market place back to UK it fails, so that was probably my problem. Testing for US market place I dont think will cause me issues. Same with my inventory request:
|
Beta Was this translation helpful? Give feedback.
I modified my code:
res = Orders(credentials=credentials, marketplace=Marketplaces.GB) data = res.get_orders(CreatedAfter='TEST_CASE_200', MarketplaceIds=["ATVPDKIKX0DER"]) data_dict = data.payload print(data_dict)
If I change the market place back to UK it fails, so that was probably my problem. Testing for US market place I dont think will cause me issues.
Same with my inventory request:
inventory = Inventories(credentials=credentials, marketplace=Marketplaces.US)
Has to be US with my app authorised in ACS for the US marketplace. Unless anyone can tell me different I am assuming sandbox only works for the US marketplace?