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
618 stars 741 forks source link

Testing SP-API in draft mode #1464

Closed yuri-lonesomelabs closed 2 years ago

yuri-lonesomelabs commented 3 years ago

From reading other issues, I understand that it's not possible to complete the auth flow and get a refresh token while the app is in draft mode.

This assumes I can only test my app on one Seller Partner, which is me? If so, how do you guys test different scenarios? Is there a way to generate dummy data for the Seller Partner?

moltar commented 3 years ago

It's not true. You can definitely auth other sellers in draft mode. I'm speaking from experience.

yuri-lonesomelabs commented 3 years ago

@moltar thanks for your response. But it seems, according to this issue https://github.com/amzn/selling-partner-api-docs/issues/79 (and some others) that it's not possible.

At least in my case, I'm getting an error trying to exchange spapi_oauth_code for a refresh token in draft mode. If you can share how you succeeded to achieve that, it would be awesome.

moltar commented 3 years ago

I just followed the docs. If you get an error it doesn't mean that it's an issue with draft mode. Probably something else.

We've integrated 4 separate accounts already for our clients and all of them work fine in draft mode.

My understanding that non-draft mode is only a requirement to be listed in the App Store. But I might be wrong here.

It'd great if Amazon devs could clarify this part.

yuri-lonesomelabs commented 3 years ago

@moltar I took your feedback to heart, and looked harder at my code. I found the problem and in fact, I can get the refresh token now, so thanks for that!

But now I have the issue of getting this error on any API call I make:

[{'message': 'Access to requested resource is denied.', 'code': 'Unauthorized', 'details': ''}]

Have you encountered something like this? Can I test the API with the same store that the app belongs to, or do I need another store for testing?

Thanks!

moltar commented 3 years ago

Have you encountered something like this?

100s of times. And many others. Just search the issues.

It seems to be somewhat of a placeholder error for some other error types. It's not always about access. But quite often is.

yuri-lonesomelabs commented 3 years ago

Okay, thanks for clarifying that. Also, do you know if I can test the app using the same Seller Account that the app belongs to, or do I need another Seller Account/Store for that?

github-actions[bot] commented 2 years ago

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.