Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look up sellerSku by fnSku? #765

Open
risner opened this issue Aug 9, 2024 · 4 comments
Open

Look up sellerSku by fnSku? #765

risner opened this issue Aug 9, 2024 · 4 comments

Comments

@risner
Copy link

risner commented Aug 9, 2024

Problem description:

Per my understanding of Amazon's SP-API documentation, I should be able to look up a inventory summary by fnSku.

Error:

% php fnsku.php
PHP Fatal error:  Uncaught Error: Call to undefined method SellingPartnerApi\Api\FbaInventoryV1Api::InventorySummary() in fnsku.php:36
Stack trace:
#0 {main}
  thrown in fnsku.php on line 36

Code

$apiInstance = new SellingPartnerApi\Api\FbaInventoryV1Api($config);
$included_data = "summaries";
$locale = "en_US";
$result = $apiInstance->InventorySummary($fnsku, $marketplace_ids, $included_data, $locale);

Seller Central SP API config page screenshot

image

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.

@misterakko
Copy link

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

@risner
Copy link
Author

risner commented Aug 13, 2024

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

@misterakko
Copy link

In that case you go for $fbaApi = $apiInstance->FBAInventoryV1(); and continue from there.

@risner
Copy link
Author

risner commented Aug 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants