Home > API General, Refunds > SWS GetRefunds Method

SWS GetRefunds Method


Retrieves a collection of submitted refunds for specified site(s), for a given timeframe.

Parameters

Name DataType Is Required
OrgID Long Required
Description The organization’s ID number.
RefundStatusFilter Integer Optional
Description Allows you to filter unwanted refund statuses. Defaults to 2 and 5 if left undefined.
Available values:

  • 1 – Pending Approval
  • 2 – Approved
  • 3 – Denied
  • 4 – Processed
  • 5 – ReSet
  • 6 – Credit Fail
  • 7 – System Refund
  • 99 – Cancelled
SiteList Long Optional
Description The sites for which you wish to retrieve the refunds. I no site is entered this will return all sites at the organization.
StartDate DateTime Required
Description The start date of the date range from which you wish to return the refund information.
EndDate DateTime Optional
Description The start date of the date range from which you wish to return the refund information. This will default to the same date as the StartDate if left undefined.

Returned Parameters

Name Data Type
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 autopay debit/credit card number or ACH checking or savings account number. This is required for new autopay setups.
PhoneNumber String
Description The account’s phone number.
PhoneType String
Description The type of phone number.
Available values:

  • HOME
  • OFFICE
  • MOBILE
  • FAX
  • OTHER
Address1 String
Description The first line of the address.
Address2 String
Description The second line of the address.
Address3 String
Description The third line of the address.
City String
Description The city for the address.
PostalCode String
Description The postal/ZIP code for the address.
State String
Description The state/province for the address.
RefundNotes String
Description The free text refund note, usually created by the site manager that approves the refund.
RegionalApprovedBy String
Description The Store user’s name that approved the refund.
RentRefund Decimal
Description The rental item’s refund amount that was overpaid due to vacating the rental item earlier than expected.
SitePerson String
Description The Store user’s name that initiated the refund process.
TodaysDate DateTime
Description The current date.
TotalRefundAmount Decimal
Description The refund amount is automatically calculated by the Store application, based on the Refund rules for the site. This is from the CancelReservation SWS method.
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 The unit’s number as assigned by the organization. This is not the UnitID.
VacateDate DateTime
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 Refund response object.  We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.Refund_Request request = new SWS.Refund_Request();
SWS.Refund_Response response;

Here’s a sample code of the Request object (including optional parameters):

// GetRefunds 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.GetRefunds(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.

Categories: API General, Refunds Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: