3

我需要使用 C# 通过亚马逊 MWS API 更新亚马逊商城中的 MerchantOrderID。

所以,首先我创建了 XML 文件,例如:

<?xml version="1.0"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
  <Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>M_STORE_3918753</MerchantIdentifier>
  </Header>
  <MessageType>OrderAcknowledgement</MessageType>
  <Message>
    <MessageID>1</MessageID>
    <OrderAcknowledgement>
      <AmazonOrderID>104-9209939-0469021</AmazonOrderID>
      <MerchantOrderID>100828163</MerchantOrderID>
      <StatusCode>Success</StatusCode>
      <Item>
        <AmazonOrderItemCode>11111111111111</AmazonOrderItemCode>
        <MerchantOrderItemID>111111</MerchantOrderItemID>
        <AmazonOrderItemCode>22222222222222</AmazonOrderItemCode>
        <MerchantOrderItemID>222222222</MerchantOrderItemID>
      </Item>
    </OrderAcknowledgement>
  </Message>
</AmazonEnvelope>

然后我尝试调用亚马逊 MWS SubmitFeed:

SubmitFeedRequest request = new SubmitFeedRequest();
        request.Merchant = merchantId;
        request.MarketplaceIdList = new IdList();
        request.MarketplaceIdList.Id = new List<string>(new string[] { marketplaceId });

        request.FeedContent = File.Open(path, FileMode.Open, FileAccess.Read);

        request.ContentMD5 = MarketplaceWebServiceClient.CalculateContentMD5(request.FeedContent);
        request.FeedContent.Position = 0;

        request.FeedType = "_POST_ORDER_ACKNOWLEDGEMENT_DATA_";

        MarketplaceWebService.MarketplaceWebService serviceFeed = new MarketplaceWebServiceClient(
                accessKeyId,
                secretAccessKey,
                applicationName,
                applicationVersion,
                configFeed);

        SubmitFeedResponse response = serviceFeed.SubmitFeed(request);

它成功提交,但是当我在亚马逊 (sellercentral.amazon.com) 中打开我的订单时,它显示“未保存”:您的商家订单 ID:# 未 保存

谁能帮助我,有什么问题或我该怎么办?

谢谢!

4

2 回答 2

2

对于那些想要一次在多个订单中更新商家订单 ID 的人,这里是示例(也适用于亚马逊 mws 暂存器):

<?xml version="1.0"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
  <Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>ALVH0CYWPBFNA</MerchantIdentifier>
  </Header>
  <MessageType>OrderAcknowledgement</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <OrderAcknowledgement>
        <AmazonOrderID>000-0000000-0000000</AmazonOrderID>
        <MerchantOrderID>YOUR_MERCHANT_ORDER_ID</MerchantOrderID>
        <StatusCode>Success</StatusCode>
        </OrderAcknowledgement>
    </Message>
    <Message>
        <MessageID>2</MessageID>
        <OrderAcknowledgement>
        <AmazonOrderID>000-0000000-0000000</AmazonOrderID>
        <MerchantOrderID>YOUR_MERCHANT_ORDER_ID</MerchantOrderID>
        <StatusCode>Success</StatusCode>
        </OrderAcknowledgement>
    </Message>
</AmazonEnvelope>
于 2016-07-05T04:47:41.367 回答
1

这实际上是正确的代码。不知何故,亚马逊没有标记某些特殊订单或稍后标记它们。

于 2012-11-16T17:31:14.910 回答