SWS GetRefundDetail Method
Retrieves a collection of submitted refunds, with categorized amounts, for specified site(s), for a given time-frame.
Parameters
Name | DataType | Is Required |
---|---|---|
SiteList | Long | Required |
Description | An array of sites from which to retrieve the data, if left undefined it will default to all sites at the organization. | |
OrgID | Long | Required |
Description | The organization’s ID number. | |
RefundStatusFilter | Integer | Optional |
Description | Allows you to filter the return for the types of refunds given. Available values:
|
|
StartDate | DateTime | Optional |
Description | The start date for the date range from which you wish to retrieve the refund details. | |
EndDate | DateTime | Optional |
Description | The end date for the date range from which you wish to retrieve the refund details. |
Returned Parameters
Name | DataType |
---|---|
RefundDetail | RefundDetail |
Description | The object containing on the details of the refund. |
Example
As with every method we need to pass in credentials. We do this with the LookupUser request object.
We’ll assume you have a web reference, let’s name it SWS, in your Visual Studio project. At this point we need to define the objects. We’ll need the standard service object, a Refund request object, and a RefundDetail response object. We can define and create those like this:
// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.Refund_Request request = new SWS.Refund_Request();
SWS.RefundDetail_Response response;
Here’s a sample code of the Request object (including optional parameters):
// GetRefundDetail Request
request.OrgID = 123456;
request.SiteList = new long[] { 123456, 456789 };
request.StartDate = DateTime.Today.AddDays(-1);
request.RefundStatusFilter = new int[] { 1, 2 };
Finally we can call the method and pass across the login object and the request object to retrieve the specified refunds. It’s a good idea to do this in a Try Catch block.
// Call the method that will load the response object
try
{
response = service.GetRefundDetail(user_request, request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Note that if something goes wrong the service will respond with an exception. You’ll want to capture the message returned in that exception so it can be debugged.
For a full list of methods see SWS Methods.
ATTENTION!
As of December 20, 2012, all amounts (RentRefund, InsuranceRefund, ServiceRefund, etc…) returned in the TransactionData object will exclude any retained amounts. For example: A tenant moves out of a unit and, before applying any site rules, the tenant is owed a $50.00 refund; however, the site rules are set such that partial period refunds are not allowed, so $15.00 of the refund will be retained. The actual refund given to the tenant is $35.00. Whereas prior to December 20, 2012 the TransactionData.RentRefund would return an amount of $50.00, it will now return an amount of $35.00.