Archive

Archive for the ‘End Rental/Moveout’ Category

SWS2 CancelReservation Method

April 6, 2017 Leave a comment

Allows you to cancel a reservation or an array of reservations.

Parameters

Name Data Type Is Required
AcctID 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.
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.
Address1 String Required
Description The first address line of the contact’s address.
Address2 String Required
Description  The second address line of the contact’s address.
City String Required
Description  The city of the contact’s address.
ContactName String Required
Description The first and last name of the account contact.
Country String Required
Description The country of the contact’s address.
PostalCode String Required
Description The postal/ZIP code of the contact’s address.
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.
State String Required
Description The state/province of the contact’s address.
DenyDepositRefund Boolean Required
Description Indicates the deposit will be refunded (“True”) or retained (“False”).
DenyRefundReason String Required
Description An explanation of why the refund of the deposit was denied.
LostDemandNotes String Required
Description Explanation of why the customer chose to cancel the reservation rather than rent the unit.
LostDemandReason Integer Required
Description The reason the customer chose not to rent. This can be customized by the organization’s admin. Contact the organization for their list of reasons.
QuoteIds Long Required
Description The quote IDs that you wish to cancel. This can be a single quote id or an array. The quote ID is returned when you use the MakeReservation method.
RentalIDs Long Required
Description The rental IDs that you wish to cancel. This can be a single rental ID or an array. The rental ID is returned when you use the MakeReservation method. This array needs to match 1 to 1 with the QuoteIds array.
SiteID Long Required
Description The site’s ID number. This can be found using the SearchBy method.

Returned Parameters

Name Data Type
AvailableRefundAmount Decimal
Description The amount that is being refunded to the customer.
ErrorMessage String
Description The message explaining why the cancellation was unsuccessful.
HasDeposit Boolean
Description Indicates if there was a deposit on the reservation (“True”) or not (“False”).
ObjectID Long
Description The unit’s ID number. This is maintained through rentals.
RefundMessage String
Description
Succeeded Boolean
Description “True” indicates that the reservation/s were cancelled successfully, or “False” if not.
TranID 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

We’ll assume you’ve got a web reference, let’s name it Store, in your Visual Studio project. At this point we need to reference our objects. We’ll need the standard service object, a CancelReservation_Request request object and a SWS2ContactInfo object. You will also need to pass in credentials. We can define and create those like this:

// Create a request and response objects
StoreServiceClient client = new StoreServiceClient();
CancelReservation_Request request = new CancelReservation_Request();
SWS2ContactInfo thisCon = new SWS2ContactInfo();

As with every method we need to pass in credentials. We also set up the parameters for our request.

//Cancel reservation setup
client.ChannelFactory.Credentials.UserName.UserName = "user";
client.ChannelFactory.Credentials.UserName.Password = "pass";
client.ChannelFactory.Credentials.SupportInteractive = true;

thisCon.AccountID = 123456;
thisCon.RentalID = 123456;
thisCon.ContactName = "John Doe";

request.SiteID = 123456;
request.AcctID = 123456;
request.ContactData = thisCon;
request.RentalIDs = new long[] { 123456 };

Finally we can call the method and pass across the login object and the request object to cancel the reservation. It’s a good idea to do this in a Try Catch block.

try
{
    // Call the method that will load the response object
    object resp;
    resp = client.CancelReservation(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 SWS2 Methods.

SWS SetUpMoveOut Method

March 23, 2017 Leave a comment

Makes a partial payment on rental item(s) for the specified account, based on information retrieved from the GetPrePayMoveOutInfo SWS method. This SWS method cannot be used without calling the GetPrePayMoveOutInfo SWS method first and will also update the intended move out date of the rental item(s). This payment method allows you to use two payment types at one time, with up to three payments per type.

Parameters

Name DataType Is Required
AcctID 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.
CashCreditID Long Optional
Description The cash credit/escrow ID number. This is required if you wish to apply a cash credit/escrow.
CashInfo Decimal Optional*
Description The amount of cash used in the transaction.
*At least one payment type is required.
CheckInfo CheckData Optional*
Description The object containing the required information for a check payment.
*At least one payment type is required.
CreditCardInfo CreditCardData Optional*
Description The object containing the required information for a credit card payment.
*At least one payment type is required.
MoveOutDate DateTime Required
Description The date the rental will be vacated. This will not automatically end the rental on that day but will update the intended termination date in Store.
PaymentCode String Required
Description A Store-generated payment code. Use the GetPrePayMoveOutInfo SWS method for this code.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
TranID 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 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 SetupMoveOut request object, and a SetupMoveOut response object. We can define and create those like this:

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

Here is a sample code of the request object:

// SetupMoveOut Request
request.SiteID = 123456;
request.AcctID = 213456;
request.MoveOutDate = new DateTime(2017, 9, 1);
request.PaymentCode = "iNR3+yqF8ACI1Hf7KoXwAAAAAAAAAAAAAAAAADvBDRE=";

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.SetupMoveOut(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.