jlevers / selling-partner-api

A PHP client library for Amazon's Selling Partner API
BSD 3-Clause "New" or "Revised" License
402 stars 195 forks source link

How to call grantless operations (Notifications CreateDestination) without refresh token #786

Open Sobak opened 1 month ago

Sobak commented 1 month ago

Problem description:

Hi!

Both SP API docs from Amazon and the package readme state that for the grantless operations having a refresh token for the particular seller isn't a must.

refreshToken (string): The LWA refresh token of the SP API application to use to execute API requests. Required, unless you're only using grantless operations.

However, after checking all package APIs I could think of it seems there isn't a way to create a seller connector instance without providing a valid refresh token, because the package sends it to SP API at all times.

Is my understanding correct that it should be made optional for grantless operations? Any tips on how can I achieve it without writing my own code to build the entire request to SP API, handle the response with Saloon etc?

Context: I'm building a multi-seller application where I need to call CreateDestination for notifications without a context of specific seller.

geekworm-com commented 2 days ago

Here is some example codes, refer to #390 ,