Closed tabbedy closed 2 years ago
Patrick,
The package will automatically manage your access tokens. You can add another parameter to AmznSPAConfig called save_lwa_tokens_callback
if you would like to store/cache your access tokens. Here's an example:
use Illuminate\Support\Facades\Cache;
use Jasara\AmznSPA\DataTransferObjects\AuthTokensDTO;
new AmznSPAConfig(
lwa_access_token: Cache::get('spa:lwa_access_token'),
save_lwa_tokens_callback: function (AuthTokensDTO $tokens) {
Cache::put('spa:lwa_access_token', $tokens->access_token, $tokens->expires_at);
},
...
);
Here is the correct call for the catalog items:
$this->spa->catalog_items->getCatalogItem(asin: 'ASIN', marketplace_ids: ['MARKETPLACE_IDS']);
another issue i have, when i set the received access token manually and make a call
$items = $spa->catalog->getItems();
there is no catalog, because the element $spa does not contain a catalog node... a year ago i worked with kitebrink laravel mws pretty well and i build a small application for my own seller account, but here i am a little bit helpless.
does anybody has a representative easy example which will work with correct credentials?
best regards Patrick