Hello,
I've been using the Amazon SP API to fetch inventory summaries, and previously, when using a PHP package, I was able to retrieve the warehouse locations associated with the inventory items. However, after reimplementing this functionality in Node.js using the amazon-sp-api package, I am unable to find the endpoint or method to retrieve the warehouse locations.
Here is a snippet of my current implementation:
async function fetchInventorySummaries(nextToken = null, allSummaries = []) {
try {
const query = {
marketplaceIds: ["A21TJRUUN4KGV"],
details: true,
granularityType: "Marketplace",
granularityId: "A21TJRUUN4KGV",
nextToken: null
};
if (nextToken) {
query.nextToken = nextToken;
} else {
query.nextToken = null;
}
const inventorySummaries = await spClient.callAPI({
operation: "getInventorySummaries",
endpoint: "fbaInventory",
query: query
});
allSummaries.push(...(inventorySummaries.inventorySummaries as []));
if (inventorySummaries.nextToken) {
return await fetchInventorySummaries(inventorySummaries.nextToken, allSummaries);
}
return allSummaries;
} catch (error) {
throw new Error(`Failed to fetch inventory summaries: ${(error as any).message}`);
}
}
Any guidance would be appreciated. Thanks in advance!
Hello,
I've been using the Amazon SP API to fetch inventory summaries, and previously, when using a PHP package, I was able to retrieve the warehouse locations associated with the inventory items. However, after reimplementing this functionality in Node.js using the amazon-sp-api package, I am unable to find the endpoint or method to retrieve the warehouse locations.
Here is a snippet of my current implementation:
Any guidance would be appreciated. Thanks in advance!