Archive

Archive for the ‘Refunds’ Category

SWS VoidDeposit Method

July 8, 2013 Leave a comment

Allows you to void a paid or unpaid security or reservation deposit on the same day it was assessed. You will not be able to reverse/void any assessment that has already processed through nightly processing.

Parameters

Name DataType Is Required
AssessmentID Long Required
Description The assessment’s ID number to be voided. This can be retrieved using the GetAssessments method.
OrgID Long Required
Description The organization’s ID number.
RentalID Long Required
Description The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
Succeeded Boolean
Description Indicates if the void was successful (“True”) or not (“False”).

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects. We will need the standard service object, a VoidDeposit request object, and a VoidDeposit response object. We can define and create those like this:

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

Here is a sample code of the request object:

// VoidDeposit Request
request.OrgID = 123456;
request.SiteID = 123546;
request.RentalID = 123456;
request.AssessmentID = 123456;

Finally we can call the method and pass across the login object and the request object to retrieve our requested information. 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.VoidDeposit(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.

Categories: API General, Refunds, Void

SWS ExportRefundDetail Method

August 8, 2012 1 comment

Retrieves detailed refund information and resets the refund status to indicate the records have been exported. Data is gathered for specified site(s) for a given timeframe.

Parameters

Name DataType Is Required
EndDate DateTime Optional
Description The date to end a process. If start date is provided, then it is the end date of a range of dates. Technically, it’s one day beyond the end date. This will default to today’s date if left undefined.
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:

  • 1 – Pending Approval
  • 2 – Approved
  • 3 – Denied
  • 4 – Processed
  • 5 – Reset
  • 6 – Credit Fail
  • 7 – System Refund
  • 99 – Cancelled
SiteList Long Optional
Description A collection of limited site details for a specified site zip code(s), site names, or area codes. This will return all sites within the organization if left undefined.
StartDate DateTime Required
Description The date to start a process. If end date is provided, then it is the start date of a range of dates.

Returned Parameters

Name DataType
RefundDetail RefundDetail
Description The object containing all the values of the refund detail.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We will assume you have a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to classify our objects.  We’ll need the standard service object, an ExportRefundDetail request object, and an ExportRefundDetail 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.RefundDetail_Response response;

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

// ExportRefunds Request
request.OrgID = 5005;
request.SiteList = new long[] { 123456, 456789 };
request.StartDate = DateTime.Today.AddDays(1);
request.EndDate = DateTime.Today;
request.RefundStatusFilter = new int[] { 1 };

 Finally we can call the method and pass across the login object and the request object to export 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.ExportRefundDetail(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will 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, Reports

SWS ProcessRefund Method

Submits a request for a cash, check, credit or ‘Deny’ refund, based on a cancelled transaction. You will need data from the cancellation to process this request. If you wish to credit the amount of the refund to an alternate rental on the account, you must use the CancelReservationCashCredit SWS method.

Parameters

Name DataType Is Required
ContactData ContactInfo Required
Description The object containing required data for the accounts contact.
OrgID Long Required
Description The organization’s ID number.
RefundInfo RefundData Required
Description The object containing the required refund details.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
Details String
Description The total amount due to the customer for the assessments.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects.  We will need the standard service object, a ProcessRefund request object, and a ProcessRefund response object. We will also need a ContactInfo object and a RefundData object. We can define and create those like this:

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

SWS.ContactInfo conRequest = new SWS.ContactInfo();
SWS.RefundData refRequest = new SWS.RefundData();

Here is a sample code of the request object:

// ProcessRefund Request
conRequest.AccountID = 123456;
conRequest.RentalID = 123456;
conRequest.ContactName = "John Doe";
conRequest.Address1 = "123 Main St.";
conRequest.City = "My Town";
conRequest.State = "UT";
conRequest.PostalCode = "12345";

refRequest.TranID = 123456;
refRequest.RefundType = SWS.RefundTypes.CREDIT_CARD;
refRequest.RefundAmount = 25.30m;
refRequest.IsDenied = false;

request.OrgID = 123456;
request.SiteID = 123456;
request.ContactData = conRequest;
request.RefundInfo = refRequest;

Finally we can call the method and pass across the login object and the request object to retrieve our requested information. 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.ProcessRefund(user_request, request);
}
catch (Exception ex)
{
  MessageBox.Show(ex.Message);
}

Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.

For a full list of methods see SWS Methods.

Categories: API General, Refunds