Im using Electron and try to use the amazon SP SPI. Somehow I always get the following error despite that my marketplaceIds are correct.
`// apiCall.js
const SellingPartner = require("amazon-sp-api");
require('dotenv').config({ path: './api.env' });
function apiCall(eanNumbers) {
(async () => {
try {
const spClient = new SellingPartner({
region: "eu",
refresh_token: process.env.REFRESH_TOKEN,
credentials: {
SELLING_PARTNER_APP_CLIENT_ID: process.env.CLIENT_ID,
SELLING_PARTNER_APP_CLIENT_SECRET: process.env.SECRET_KEY,
},
});
let res = await spClient.callAPI({
operation: "searchCatalogItems",
endpoint: "catalogItems",
marketplaceIds: ["A1PA6795UKMFR9"],
identifiers: eanNumbers,
identifiersType: "EAN",
});
console.log(res);
} catch (e) {
console.log(e);
}
})();
}
module.exports = apiCall;
`
I tried different numbers (all of them in the amazon documentation) and other formats in the marketplaceIds field such as JSON Arrays, Strings and Javascript Arrays with strings.