Archive
SWS CancelReservationV2 Method
Cancels a reservation made for specified rental item(s) and/or quote(s). Returns data regarding possible refunds. Note: If the rental contact information is not supplied and the refund data indicates a refund should be processed, the contact information will default to the rental item(s)’ primary contact information. This method also lets you retain the refund, which was not possible in the original method.
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. | |
ContactData | ContactInfo | Optional |
Description | The object containing the contact information. If no information is entered here, the primary contact info is used as default. | |
DenyDepositRefund | Boolean | Required |
Description | Indicates that a refund should be retain (“True”) or refunded (“False”). Defaults to false. Refunds are processed based on site rules in the form of cash, check or credit card. | |
DenyRefundReason | String | Required |
Description | The reason for denying a customer’s refund (i.e., Delinquent on other rentals). Max string length of 500. | |
LostDemandNotes | String | Required |
Description | The free text note as to why the customer terminated the rental. Max string length of 500. | |
LostDemandReason | String | Required |
Description | The lost demand reason as to why a customer terminated a rental. Available values:
|
|
QuoteIDs | Long | Optional |
Description | The quote’s ID number. This can be an array of quotes if there are multiple quotes that need to be cancelled. This is returned when processing the MakeReservation method or can be retrieved using the GetReservations method. | |
RentalIDs | Long | Optional |
Description | The rental items id numbers. This can be an array if there are multiple rentals that need to be cancelled. This is returned when using the MakeReservation method or can be searched for using the SearchBy method. |
Returned Parameters
Name | DataType |
---|---|
AvailableRefundAmount | Decimal |
Description | The amount that will be refunded to the customer, if any refund is due. |
ErrorMessage | Decimal |
Description | A message about any problem that occurred during the process, including details to locate errant code. |
HasDeposit | Boolean |
Description | Indicates if the deposit can be refunded (“True”) or not (“False”). |
ObjectID | Long |
Description | The unit’s ID number that is being cancelled. This is maintained through rentals. |
RefundMessage | String |
Description | The message associated with the success or failure of processing the refund. |
Succeeded | Decimal |
Description | Indicates if the cancellation was successful (“True”) or not (“False”). |
TranID | String |
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 CancelReservationV2 request object and a CancelReservation response object. We can define and create those like this:
// Create a request and response objects and ContactInfo object.
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.CancelReservationV2_Request request = new SWS.CancelReservationV2_Request();
SWS.CancelReservation_Response response;
SWS.ContactInfo contact_info = new SWS.ContactInfo();
Here’s my sample code of the Request object.
// Contact Data contact_info.AccountID = 123456; contact_info.Address1 = "123 Main St."; contact_info.City = "My Town"; contact_info.State = "UT"; contact_info.PostalCode = "00000"; contact_info.ContactName = "First Last"; // To cancel reservations(s) request.AcctID = 123456; request.RentalIDs = new long[] { 123456, 654321 }; request.LostDemandReason = SWS.Lost_Demand_Reasons.Availability; request.LostDemandNotes = "Unit size no longer available"; request.ContactData = contact_info; request.DenyDepositRefund = true; request.DenyRefundReason = "They were told the amount was non-refundable.";
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.
// Call the method that will load the response object
try
{
response = service.CancelReservationV2(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.
ContactInfo Reference
Reference for any method using the ContactInfo object.
Name | DataType | Is Required |
---|---|---|
AccountID | Long | Ignored |
Description | The accounts system generated id. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. | |
RentalID | Long | Ignored |
Description | The system generated id for the rental. This is returned when using the MakeReservation method or can be searched for using the SearchBy method. | |
ContactName | String | Required |
Description | The first and last name of the contact. | |
Address1 | String | Required |
Description | The first line of the address. | |
Address2 | String | Optional |
Description | The second line of the address. | |
City | String | Required |
Description | The city for the address. Max string length 50. | |
State | String | Required |
Description | The state/province for the address. Max string length 2. | |
PostalCode | String | Required |
Description | The ZIP/postal code for the address. Max string length of 15. | |
Country | String | Optional |
Description | The country for the address. Max string length of 25. |
AssessmentData Reference
Reference information for the AssessmentData object.
Parameters
Name | DataType | Is Required |
---|---|---|
AssessmentID | Long | Required |
Description | The system generated id for the assessment you are processing. | |
AmountPayingForAssessment | Decimal | Required |
Description | The amount of the assessment. |
SWS2 GetAccountInfo
Retrieves all the contacts for an account using either the account ID or the contact ID.
Parameters
Name | Data Type | Is Required |
---|---|---|
AcctID | Long | Optional* |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. * Either AcctID or ContactID are required. |
|
ContactID | Long | Optional* |
Description | The rental contact’s ID number. This is returned when using the CreateNewAccount or AddNewContact methods or you can search for it using the SearchBy method. * Either AcctID or ContactID are required. |
|
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. |
Returned Parameters
A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application.
Name | Data Type |
---|---|
ACCT_ID | Long |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. |
SITE_ID | Long |
Description | The site’s ID number. This can be found using the GetSiteList method. |
ACCT_NAME | 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. |
CFLEX01 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX02 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX03 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX04 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX05 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
ACCT_TYPE | String |
Description | Indicates the type of account, whether a company account or a customer account. |
ACCT_CLASS | String |
Description | Indicates if the account is a personal or business account class. |
CONTACT_ID | Long |
Description | The rental contact’s ID number. This is returned when using the CreateNewAccount or AddNewContact methods or you can search for it using the SearchBy method. |
FIRST_NAME | String |
Description | The first name of the primary contact. |
LAST_NAME | String |
Description | The last name of the primary contact. |
KNOWN_AS | String |
Description | The name by which the customer prefers to be called. |
ACTIVE | Boolean |
Description | Indicates if the account is active or not. |
CONTACT_TYPE | String |
Description | Indicates if the contact has full access or contact only status. |
CREATED_BY | Long |
Description | The user’s ID that created the account. |
UPDATED_BY | Long |
Description | The user’s ID that last updated the account. |
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 GetAccountInfo_Request request 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();
GetAccountInfo_Request request = new GetAccountInfo_Request();
As with every method we need to pass in credentials. We also set up the parameters for our request.
//Get Account Info setup
client.ChannelFactory.Credentials.UserName.UserName = "user";
client.ChannelFactory.Credentials.UserName.Password = "pass";
client.ChannelFactory.Credentials.SupportInteractive = true;
request.SiteID = 123456;
request.AcctID = 123456;
Finally we can call the method and pass across the login object and the request object to retrieve the data. It’s a good idea to do this in a Try Catch block.
try
{
// Call the method that will load the response object
System.Data.DataTable resp;
resp = client.GetAccountInfo(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.