amz-tools / amazon-sp-api

Amazon Selling Partner API Client
MIT License
237 stars 121 forks source link

createFeed with POST_PRODUCT_DATA #269

Open surbhi-ctas opened 8 months ago

surbhi-ctas commented 8 months ago

Hello,

I am trying to upload an XML feed using Feed API. But getting "Invalid request parameters".

let feed_upload_details = await sellingPartnerNewInstance.callAPI({ operation: 'createFeedDocument', endpoint: 'feeds', body: { contentType: feed.contentType, }, }); // Create Feed Document

      await sellingPartnerNewInstance.upload(feed_upload_details, feed); // Upload Feed

      let { feedId } = await sellingPartnerNewInstance.callAPI({
        operation: 'createFeed',
        endpoint: 'feeds',
        body: {
          marketplaceIds: ['A1PA6795UKMFR9', 'A1805IZSGTT6HS'],
          feedType: 'POST_PRODUCT_DATA',
          inputFeedDocumentId: feed_upload_details.feedDocumentId, // retrieve the feedDocumentId from the "createFeedDocument" operation
        },
      });

Can you please let me know what is the exact problem? Because when I use marketplaces: ['A1PA6795UKMFR9'], it works fine and passes more than one marketplace it returns an error. As per Amazon document: https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-reference#createfeedspecification, we can pass multiple marketplace IDs. Any help would be greatly appreciated.