【问题标题】:Amazon Fees API Transaction Summary亚马逊费用 API 交易摘要
【发布时间】:2014-02-10 15:12:20
【问题描述】:

我正在使用亚马逊商城网络服务订单 API:

https://developer.amazonservices.com/gp/mws/api.html/181-8217517-6357550?ie=UTF8&group=orders&section=orders&version=latest

亚马逊有交易摘要 API 吗?

我想准确计算亚马逊费用:

亚马逊费用(可变结算费、佣金) 送货服务费

是否有 API 可以让我获得这些确切的金额?

【问题讨论】:

    标签: amazon


    【解决方案1】:

    是的,您可以通过使用 MWS 报告 API 检索结算报告来获取此信息。它们以 XML 或平面文件格式提供。

    以下是有关结算报告的一些一般信息: http://www.amazon.com/gp/help/customer/display.html?nodeId=200253140

    以下是结算报告的不同 MWS 报告类型枚举: http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html#ReportTypeCategories__SettlementReports

    【讨论】:

      【解决方案2】:

      我使用财务 API 获取费用信息 (Amazon Documentation)。对于我需要做的事情,我使用了 ListFinancialEvents 操作 (Amazon Documentation)。使用此端点,您有几个过滤器。在我看来,最有用的是 PostedAfter、PostedBefore 和 AmazonOrderID。测试和查看响应模式的一个好方法是使用Scratchpad

      您没有提及您使用哪种语言进行编程,因此下一部分可能不适用于您,但如果您使用 c#,我建议使用 amazon c# library。您需要下载 finances 库(并使用 dist 文件夹中的 dll)。该库还包括所需的 MWSClientCsRuntime-1.0.dll。

      这里有一些您可能会或可能不会觉得有用的代码。

          public ListFinancialEventsResult GetOrderFeesByPostedDateRange(DateTime postedAfter, DateTime postedBefore)
          {
              var config = new MWSFinancesServiceConfig();
              config.ServiceURL = "https://mws.amazonservices.com";
              var client = new MWSFinancesServiceClient(AccessKey, SecretKey, AppName, AppVersion, config);
              try
              {
                  var request = new MWSFinancesService.Model.ListFinancialEventsRequest();
                  request.PostedAfter = postedAfter;
                  request.PostedBefore = postedBefore;
                  request.SellerId = SellerId;
      
                  var response = client.ListFinancialEvents(request);
                  return response.ListFinancialEventsResult;
      
              }
              catch (MWSFinancesServiceException ex)
              {
                  MWSFinancesService.Model.ResponseHeaderMetadata responseHeaderMetatData = ex.ResponseHeaderMetadata;
                  File.AppendAllText(ErrorLog, "----- SERVICE EXCEPTION -----" + Environment.NewLine);
      
                  if (responseHeaderMetatData != null)
                  {
                      File.AppendAllText(ErrorLog, "     - RequestID: " + responseHeaderMetatData.RequestId + Environment.NewLine);
                      File.AppendAllText(ErrorLog, "     - Timestamp: " + responseHeaderMetatData.Timestamp + Environment.NewLine);
                  }
      
                  File.AppendAllText(ErrorLog, "     - Message: " + ex.Message + Environment.NewLine);
                  File.AppendAllText(ErrorLog, "     - StatusCode: " + ex.StatusCode + Environment.NewLine);
                  File.AppendAllText(ErrorLog, "     - ErrorCode: " + ex.ErrorCode + Environment.NewLine);
                  File.AppendAllText(ErrorLog, "     - ErrorType: " + ex.ErrorType + Environment.NewLine + Environment.NewLine);
                  throw;
              }
          }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-31
        • 1970-01-01
        • 2016-11-26
        • 1970-01-01
        相关资源
        最近更新 更多