abuzuhri / Amazon-SP-API-CSharp

.Net C# library for the new Amazon Selling Partner API
MIT License
215 stars 191 forks source link

Invoice Upload #546

Open kokkotron opened 1 year ago

kokkotron commented 1 year ago

Ist it planned to integrate the UPLOAD_VAT_INVOICE Feed? This would be a ver fine feature for a lot of Customers. Thanks.

zinsmeik commented 1 year ago

You can upload a invoice. First create a feed option object

var options = new FikaAmazonAPI.AmazonSpApiSDK.Models.Feeds.FeedOptions();
            options.Add("metadata:documenttype", "Invoice");
            options.Add("metadata:invoicenumber", <YOUR_INVOICE_NUMBER>);
            options.Add("metadata:orderid", <YOUR_AMAZON_ORDERID>);

Then submit a feed with the file and the feed options

       var feedresultPDF = Connection.Feed
                .SubmitFeed(
                    <YOUR_INVOICE_FILE_AS_PDF>,
                    FikaAmazonAPI.Utils.Constants.FeedType.UPLOAD_VAT_INVOICE,
                    new List<string>() { FikaAmazonAPI.Utils.MarketPlace.Germany.ID },
                    options,
                    FikaAmazonAPI.Utils.Constants.ContentType.PDF);

as a result you get the Feed ID which you can query later to check for success or errors.

Note: upload is limited one invoice every three seconds.