API Finances ( Amazon). , , ListFinancialEvents ( Amazon). . , PostedAfter, PostedBefore AmazonOrderID. - Scratchpad.
, , , c #, c # amazon. ( dll dist). 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;
}
}