SWS GetRefundDetailV2 Method
Retrieves a collection of submitted refunds with categorized amounts for specified site(s), for a given time-frame.
Parameters
Name | DataType | Is Required |
---|---|---|
OrgID | Long | Required |
Description | The organization’s ID number. | |
RefundStatusFilter | Integer | Optional |
Description | Selects refunds of given status. Defaults to 2 and 5 if left undefined. Available values:
|
|
SiteList | Long | Optional |
Description | An array of sites from which you wish to retrieve the refund details. | |
StartDate | DateTime | Required |
Description | The start date of the date range from which you wish to retrieve the refund details. | |
EndDate | DateTime | Optional |
Description | The end date of the date range from which you wish to retrieve the refund details. Will default to today if left undefined. |
Returned Parameters
Name | DataType |
---|---|
SiteNumber | String |
Description | The site’s number as defined by the site administrator. This is not the site ID number. |
AccountName | String |
Description | The name on the account. This may differ from the primary contact’s name in some instances, such as a business account or a guardianship account. |
AccountNumber | Long |
Description | The account ID for the customers account or, if it’s non-account retail, the retail account ID. (The retail account ID cannot be pulled in the application.) |
PhoneNumber | String |
Description | The phone number for the account contact. |
PhoneType | String |
Description | The type of phone number. Available values:
|
Address1 | String |
Description | The first line of the account address. |
Address2 | String |
Description | The second line of the account address. |
Address3 | String |
Description | The third line of the account address. |
City | String |
Description | The city of the account address. |
PostalCode | String |
Description | The postal/ZIP code of the account address. |
State | String |
Description | The state/province of the account address. |
ApprovedDate | DateTime |
Description | The date the refund was approved. Either by the system automatically or by the refund approver. |
InsuranceRefund | Decimal |
Description | The amount, if any, of the insurance that is eligible to be refunded. |
OtherRefund | Decimal |
Description | The amount, if any, of the charge that are eligible to be refunded and not included as part of other refunded items. |
RefundNotes | String |
Description | The notes of why a refund was denied. |
RegionalApprovedBy | String |
Description | The name of the user that approved the refund, or, if it was automatically approved, based on site rules, “Auto Approved”. |
RentRefund | Decimal |
Description | The amount, if any, of the rent that is eligible to be refunded. |
RetailRefund | Decimal |
Description | The amount, if any, of retail that is eligible to be refunded. |
ServiceRefund | Decimal |
Description | The amount, if any, of services that are eligible to be refunded. |
SitePerson | String |
Description | The name of the person who processed and, if needed, requested the refund. |
Status | String |
Description | Shows the status of the refund. (I.E., Approved, Denied, etc.) |
TaxRefund | Decimal |
Description | The amount, if any, of taxes that are eligible to be refunded. |
TodaysDate | DateTime |
Description | The current date. |
TotalRefundAmount | Decimal |
Description | The total refund amount based on the site rules of what can be refunded. |
TransactionNumber | Long |
Description | The transaction’s ID number. Transaction IDs are system generated for each payment transaction that occurs in the system. A null or “0” response indicates the transaction failed. |
Units | String |
Description | A list of unit numbers as assigned by the organization. This is not the UnitID. |
VacateDate | Date |
Description | The date the rental item was vacated. |
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 RefundDetailV2 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.RefundDetailV2_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.GetRefundDetailV2(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.
Updated Oct. 29,2015: Previously this function was not returning the promotion description value as was intended. The promotion description value will be returned correctly.