Open risner opened 3 months ago
You are missing a step or two. SP-API is not monolithic, after you have iitialized the thing you must instantiate an API connector to the specific API you need. In your case, InventorySummary is part of Amazon Warehousing and Distribution API v2024-05-09 https://developer-docs.amazon.com/sp-api/docs/awd_2024-05-09-reference#inventorysummary
So you need this: $awdApi = $apiInstance->AmazonWarehousingAndDistributionV20240509(); And then you make your InventorySummary() request to $awdApi
Thanks for the reply.
You are missing a step or two. SP-API is not monolithic, after you have iitialized the thing you must instantiate an API connector to the specific API you need. In your case, InventorySummary is part of Amazon Warehousing and Distribution API
I feel like I am not instantiating the right thing, but that is for the warehousing and distribution service. We don't use that, we just use FBA. So it was this call I was trying to make queries against: https://developer-docs.amazon.com/sp-api/docs/fbainventory-api-v1-reference#inventorysummary
In that case you go for $fbaApi = $apiInstance->FBAInventoryV1(); and continue from there.
In that case you go for $fbaApi = $apiInstance->FBAInventoryV1(); and continue from there.
Thanks.
The code I initially tried is in the first message of the ticket. I'm not seeing how it differs from your suggestion materially?
$apiInstance = new SellingPartnerApi\Api\FbaInventoryV1Api($config);
$included_data = "summaries";
$locale = "en_US";
$result = $apiInstance->InventorySummary($fnsku, $marketplace_ids, $included_data, $locale);
Of note, I have also tried all these:
$apiInstance = new SellersApi($config);
$fbaApi = $apiInstance->fbaInventoryV1();
and
$fbaApi = $apiInstance->FBAInventoryV1();
and
$fbaApi = new SellingPartnerApi\Api\FbaInventoryV1Api($config);
They all report:
PHP Fatal error: Uncaught Error: Call to undefined method SellingPartnerApi\Api\SellersV1Api::fbaInventoryV1()
I must me missing something terribly obvious, because all my other calls work fine to other api like the reports api and getInventorySummaries.
Problem description:
Per my understanding of Amazon's SP-API documentation, I should be able to look up a inventory summary by fnSku.
Error:
Code
Seller Central SP API config page screenshot
I have no idea what this asked me to provide, even after spending 23 minutes searching and looking at other issues that they didn't know what to put and got cancelled due to inactivity. This is the closest to what I thought.
I can use the AP for most other things, I just can't figure out how to query by fnsku. So I'm building a local translation db to convert fnsku to sellersku.