Archive

Posts Tagged ‘End Rental’

SWS GetMoveOutInfo Method

May 17, 2011 Leave a comment

Retrieves all the assessments (charges) on a rental item and a summary of amounts, detailing what is due/owed on a rental item prior to termination.

Parameters

Name Data Type Is Required
AccountID Long Required
Description The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method.
MoveOutDate DateTime Optional
Description  The date applied when vacating a rental item. This defaults to today’s date unless otherwise specified. The date can be set in the past, based on the site’s End Rental rule settings, but no future dates are allowed.
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 Data Type
AssessmentDate DateTime
Description The date the assessment was added to the account.
Description String
Description A brief description of the assessment.
DueAmount Decimal
Description The amount due on the assessment if it is unpaid.
OriginalCharge Decimal
Description The original amount of the assessment.
PaidAmount Decimal
Description The amount paid towards the assessment.
UnappliedAmount Decimal
Description The amount to be applied to the closing balance of that particular assessment.
DueAmount Decimal
Description The total of all assessments to be paid at the time of move out.
DueTax Decimal
Description The tax amount to be paid at the time of move out.
DueTotal Decimal
Description The total of both the DueAmount and the DueTax to be paid at move out.
GrossAmount Decimal
Description The total for all assessments on the account. This could be a refund or an amount to be paid. A r
GrossTax Decimal
Description The tax applicable to the GrossAmount
GrossTotal Decimal
Description The total of all assessments including the GrossTax.
WithheldAmount Decimal
Description Any amount that is retained by the site based on the site rules.
WithheldTax Decimal
Description Any taxes that are retained.
WithheldTotal Decimal
Description Total amount of the WithheldAmount and the WithheldTax.
RefundTypes RefundTypes
Description The type of refund that can be processed for the unit if a refund is due.
Available values:

  • CASH_CREDIT
  • CASH
  • CREDIT_CARD
  • CHECK

Example

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

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a GetMoveOutInfo request object and a GetMoveOutInfo response object. We can define and create those like this:

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

Here’s my sample code of the Request object.

// GetMoveOutInfo Request
request.SiteID = 123456;
request.AccountID = 123465;
request.RentalID = 123456;
request.MoveOutDate = DateTime.Today;

Finally we can call the method and pass across the login object and the request object to get our move out 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.GetMoveOutInfo(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 take a look at that message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS GetEndRentalRules Method

May 16, 2011 Leave a comment

Retrieves site rules pertaining to terminating a rental.

Parameters

Name DataType Is Required
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
RULE_VALUES RULE_VALUES
Description The object containing all returned information about the end rental rules.

Example

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

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a GetEndRentalRules request object and a RULE_VALUES collection object for the response. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetEndRentalRules_Request request = new SWS.GetEndRentalRules_Request();
SWS.RULE_VALUES[] response;

Here’s my sample code of the Request object.

// GetEndRentalRules Request
request.SiteID = 123456;

Finally we can call the method and pass across the login object and the request object to get our end rental rules. 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.GetEndRentalRules(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 take a look at that message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS GetEstimatedRefund Method

May 16, 2011 Leave a comment

Retrieves potential refund amount for a terminated reservation. This is for reservations only and will return “0” for any currently occupied rental.

Parameters

Name DataType Is Required
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.

Returned Parameters

Name DataType
EstimatedRefundAmount 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.

Example

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

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a GetEstimatedRefund request object and a GetEstimatedRefund response object.  We can define and create those like this:

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

Here’s my sample code of the Request object.

// GetEstimatedRefund Request
request.RentalID = 123456;

Finally we can call the method and pass across the login object and the request object to get our estimated refund. 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.GetEstimatedRefund(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 take a look at that message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.

SWS EndRental Method

April 29, 2011 Leave a comment

Vacates a rental item and processes a final payment if rent is due, or it processes a refund if rent is overpaid. The PaymentData object is required if a refund is warranted upon termination of rental; otherwise it is ignored. The TotalAmtDue object must be equal to either the total of the CreditCardInfo, CheckInfo or CashInfo object’s amount. The RefundData object is required if a refund is warranted upon termination of rental; otherwise it is ignored. The ContactData object is required for all refunds to Check or Credit Card; otherwise it is ignored. Use the GetMoveOutInfo SWS method prior to using this SWS method to determine whether rent is due, or a refund is warranted, for a specific rental item as well as the refund types that are available upon termination.

Parameters

Name DataType Is Required
AccountID Long Required
Description The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method.
ContactData ContactInfo Required
Description The data object required to confirm the customer’s contact information at rental termination.
PaymentData MakePayment_Request Optional
Description The data object required to processing a payment if there is an amount due at the time of rental termination.
MoveOutDate DateTime Optional
Description The date applied when vacating a rental item. This defaults to today’s date unless otherwise specified. The date can be set in the past, based on the site’s End Rental rule settings. No future dates are allowed.
OrgID Long Required
Description The organization’s ID number.
RefundData RefundData Optional
Description Data object required if processing a refund a the time of rental termination.
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
AppliedCashCredit Boolean
Description Indicates that the cash credit/escrow was successfully applied (“True”) or not (“False”).
ErrorMessage String
Description A message about any problem that occurred during the process, including details to locate errant code.
RefundMessage String
Description The message associated with the success or failure of processing the refund.
TransactionID 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.

Example

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

We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project.  At this point we need to our objects.  We’ll need the standard service object, a EndRental request object and a EndRental response object.  We can define and create those like this:

// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.EndRental_Request  request = new SWS.EndRental_Request();
SWS.EndRental_Response response;

SWS.MakePayment_Request pay_request = new SWS.MakePayment_Request();

Here’s my sample code of the Request object.

// payment data
pay_request.SiteID = 123456;
pay_request.AcctID = 123456;
pay_request.RentalIDs = new long[] { 123456 };
pay_request.Cycles = new int[] { 1 };
pay_request.TotalAmtDue = 50.50m;
pay_request.TotalAmtPaid = 50.50m;
pay_request.CashInfo= 50.50m;
pay_request.IsRetail = false;
pay_request.IsRetailAndRental = false;

// end rental request with money owed
request.OrgID = 123456;
request.SiteID = 123456;
request.AccountID = 123456;
request.RentalID = 123546;
request.MoveOutDate = DateTime.Today;

Finally we can call the method and pass across the login object and the request object to end our rental. 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.EndRental(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 take a look at that message returned in that exception so it can be debugged.

For a full list of methods see SWS Methods.