amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
612 stars 736 forks source link

Seller authorization Documentation #977

Closed donhmorris closed 3 years ago

donhmorris commented 3 years ago

After reading the documentation I am confused about seller authorization for using the api.

I have developed an app for a seller that is registered as a developer. We have been using the mws and advertising api for several years. With this new api does each seller that wants to use my app have to take a step to authorize my app? If so, this is confusing to me. Why can't I just add the selling partner scope to my other scopes during my login process and get authorization from the seller to access their account?

I'm really confused on how I need to modify my app to start using the selling partner api. It sounds like i need two buttons. One for my normal login and one for a onetime authorization by the seller to utilize the selling partner api.

I don't understand why I cant just add the selling partner api scope to my lwa url and be done with it.

vikingcodes commented 3 years ago

@donhmorris I am also looking similar case . As per my understanding on SP-API when seller signup for SP-API App Permission windows appear to User then users need to select permission. On the based on permission developer can call SP-API.

In MWS you can call all MWS API when seller approved developer . But in SP-API amazon highly focused on security . So, developer can call only those API which seller given permissions.

You can think these cases like facebook app permission to post, read comment etc or android permission like camera, photo gallery etc.

donhmorris commented 3 years ago

I am confused by what the team is expecting from sellers. It's not clear to me in the documentation.

vikingcodes commented 3 years ago

Not only you many developers are confused and wasted their time . Due to bad documentation.

donhmorris commented 3 years ago

The developer guide does contain this reference but I haven't been able to find the guide it mentions:

Migrating authorization from Amazon Marketplace Web Service If a selling partner has authorized you to make calls to Amazon Marketplace Web Service on their behalf, you can use the Authorization API to migrate that authorization to a hybrid Selling Partner API application. This eliminates the need to request authorization from the selling partner again. For more information, see the Authorization API User Guide.

ShivikaK commented 3 years ago

Hello @donhmorris

Thank you for raising this issue.

The Authorization API use case guide is available here - https://github.com/amzn/selling-partner-api-docs/blob/main/guides/use-case-guides/authorization-api-use-case-guide.md

To use this API, you are required to have a published hybrid application.

Please refer to the guide and feel to reach out to us via support case if you require further assistance on this.

Thanks, 
Shivika Khare
 Selling Partner API Developer Support

donhmorris commented 3 years ago

When you say published do you mean it has to be listed in the marketplace and not just in draft mode? If so, that doesn't make sense while I'm trying to develop the app.

Another issue I am facing is the redirect url does not get saved when editing the app in seller central.

Also, I don't understand what I need to set the OAuth Login URI field to.

Also, the redirect fields will not accept a https://localhost:4200 value, which is really inconvenient. Apps listed with LWA allow localhosts. That is how I developed my auth process for LWA. Screen Shot 2021-01-22 at 6 34 10 PM

sirajea commented 3 years ago

Also, I don't understand what I need to set the OAuth Login URI field to.

When sellers initiate authorization from the appstore (the marketplace appstore workflow), they have to log into your application in order for Amazon to send your application the authorization information so you can store it with their user data. This is what this URI is for. Whatever you enter will not apply to your application while it is in draft state because you will be using the website workflow.

donhmorris commented 3 years ago

OK. I get that part now.

It doesn't seem to be saving what I put into either of these two fields. When I reopen these settings they are blank even thought I saved my changes.

ShivikaK commented 3 years ago

Hello @donhmorris

Some issues had been encountered with App Edit page which have been resolved.

Can you try to make changes to the app again and let us know if the app changes are being saved or not?

Thanks, Shivika Khare Selling Partner API Developer Support