Closed jaradc closed 1 year ago
It might be an issue with how you call the finances API internally in python. Let me know if you need any help will help you.
I resolved it. I think the problem was the roles I selected inside the private app. I had only some checked. To be sure, I checked them all. After that, my code worked. Another thing I did was regenerate a refresh token after I had added the new roles. I am not sure this was necessary but was just trying everything I could think of.
@jaradc pefect
Hello. Jaradc. thank you for posting this question. Actually I have a problem with my credentials . Hope you give me help for this.
I am amazon seller and some customers wants to return delivered products and get refunded. I need to get these orders and their buyer information include address. Doe it require restricted data ? and How to get that then?
I want to use the API to check if an order was refunded based on Order ID ("Refund applied" is usually the status in the interface).
I am using a Python package PYTHON-AMAZON-SP-API.
In that package, here is the simple code:
from sp_api.api import Finances credentials=dict( refresh_token="Atzr|IwE...", lwa_app_id='amzn1.applica...1e', lwa_client_secret='1e9...5', aws_access_key="A...5M", aws_secret_key="VF...rT", role_arn='arn:aws:iam::...MyRole', ) order_id = "<123-45..658>." f = Finances(marketplace=Marketplaces.US, credentials=credentials) events = f.get_financial_events_for_order(order_id)
This code works until I get to the
events
line.sp_api.base.exceptions.SellingApiForbiddenException: [ {'message': 'Access to requested resource is denied.', 'code': 'Unauthorized', 'details': ''} ]
My simple questions:
- This is a 403 error, Unauthorized. How do I know if this error is caused by my IAM permissions or from the Selling Partner API?
- Does access to the Finances API require access to a restricted category in my Selling Partner Developer profile? I have: "Brand Analytics", "Direct-to-Consumer Shipping", "Tax Invoicing", and "Tax Remittance" unchecked. All other roles in my "Developer profile" are checked.
- Any general tips on how to fix this problem? It's obviously because of some authorization issue, but I'm lost on where to focus my efforts.
For the record, other calls to the API with my credentials work fine. For example,
get_order(<order_id_string_here>)
.
I think that I didn't check 'Direct-to-Consumer Shipping" , "Tax invoicing", "Tax Remittance".. Do I have to check them all?
Can we co-operate in this project? I want to implement lot's of functions by using selling partner api .
Were u able to get buyer information with get_order(
This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.
closed for inactivity
I want to use the API to check if an order was refunded based on Order ID ("Refund applied" is usually the status in the interface).
I am using a Python package PYTHON-AMAZON-SP-API.
In that package, here is the simple code:
This code works until I get to the
events
line.My simple questions:
For the record, other calls to the API with my credentials work fine. For example,
get_order(<order_id_string_here>)
.