Domanda

I am using the Amazon Marketplace Web Service Order API:

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

Is there a transaction summary API for Amazon?

I want to calculate Amazon fees accurately:

Amazon Fees (Variable closing fee, commission) Shipping service fees

Is there an API where I can obtain these exact amounts?

È stato utile?

Soluzione

Yes, you can get this information by retrieving Settlement Reports using the MWS Reports API. They are available in XML or flat file format.

Here is some general information about the Settlement Reports: http://www.amazon.com/gp/help/customer/display.html?nodeId=200253140

And here are the different MWS report type enumerations for Settlement Reports: http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html#ReportTypeCategories__SettlementReports

Altri suggerimenti

I use the Finances API to get the fee information (Amazon Documentation). For what I needed to do, I used the ListFinancialEvents operation (Amazon Documentation). With this endpoint, you have several filters. In my opinion, the most helpful ones are PostedAfter, PostedBefore, and AmazonOrderID. A good way to test and see the response schema is to use Scratchpad.

You didn't mention which language you program in, so this next part may not apply to you, but if you use c#, I recommend using the amazon c# library. You will need to download the finances library (and use the dlls in dist folder). This library also includes the MWSClientCsRuntime-1.0.dll that is required.

Here's some code that you may or may not find helpful.

    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;
        }
    }
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top