Search code examples
amazon-selling-partner-api

Amazon SP API Update SellerOrderId


I have a working integration in C# for Amazon SP API (it uses https://github.com/abuzuhri/Amazon-SP-API-CSharp and works like a charm).

Now I want to improve it saving my order Id, so I am trying to PUT or PATCH the field SellerOrderId. I have seen this question: How to update Seller Order Id with Amazon SP API, but I want to use the Orders API, not the Feeds API.

Is it possible to update SellerOrderId anyway through Orders API? What is the simplest approach to do this?

If it is not possible and I must assume that I have to use Feeds API, should it be updated via POST_ORDER_ACKNOWLEDGEMENT_DATA or POST_ORDER_FULFILLMENT_DATA?

Thank you


Solution

  • I got it. No, it is not possible to update the SellerOrderId field from the Orders API, you have to do it from the Feeds API. You have to use POST_ORDER_ACKNOWLEDGEMENT_DATA.

    I have used https://github.com/abuzuhri/Amazon-SP-API-CSharp, so I paste the code here, maybe it is useful for someone:

        public void SubmitFeedOrderAcknowledgement()
        {
            ConstructFeedService createDocument = new ConstructFeedService("{sellerId}", "1.02");
            var list = new List<OrderAcknowledgementMessage>();
            list.Add(new OrderAcknowledgementMessage()
            {
                AmazonOrderID = "AMZ1234567890123",
                MerchantOrderID = "12345678",
                StatusCode = OrderAcknowledgementStatusCode.Success
            });
            createDocument.AddOrderAcknowledgementMessage(list);
            var xml = createDocument.GetXML();
    
            var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_ORDER_ACKNOWLEDGEMENT_DATA);
            GetFeedDetails(feedID);
        }
    

    The code is taken from: https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.SampleCode/FeedsSample.cs.