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;
}
}