Archive

Posts Tagged ‘reservation’

SWS eInquirySource Method

Retrieves the organizations customized list of inquiry source values.

Parameters

Name DataType Is Required
OrgID Long Required
Description The organization’s ID number.

Returned Parameters

Name DataType
CFG_LOOKUPS CFG_LOOKUPS

Example

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 and a eInquirySource response object. We can define and create those like this:

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

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.eInquirySource(123456);
}
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, CRM, e-commerce Tags:

SWS CancelReservation Method

April 28, 2011 1 comment

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.

Parameters

Name DataType Is Required
Request CancelReservation_Request Required
Description Request object that includes the required fields for the method.

Returned Parameters

Name DataType
AvailableRefundAmount Decimal
Description The processed refund amount, if warranted.
ErrorMessage String
Description A message about any problem that occurred during the process, including details to locate errant code.
HasDeposit Boolean
Description Indicates if a refund will be processed (“True”) or not (“False”).
ObjectID Long
Description The rental_id that was cancelled.
RefundMessage String
Description The message associated with the success or failure of processing the refund.
Succeeded Boolean
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 CancelReservation request object and a CancelReservation response object.  We can define and create those like this:

// Create a request and response objects and contact info object
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.CancelReservation_Request request = new SWS.CancelReservation_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 quote(s)
request.AcctID = 123456;
request.QuoteIDs = new long?[] { 123456, 654321 };
request.LostDemandReason = SWS.Lost_Demand_Reasons.Availability;
request.LostDemandNotes = "Unit size no longer available";
request.ContactData = contact_info;

// OR To cancel rentals(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;

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

Please check around Centershift DevX for additional articles about the vast methods available in Store Enterprise/Advantage SWS to power your application.

ATTN: As of 2/21/2013 There is no need to call a SWS method to process a refund after calling CancelReservation. The CancelReservation SWS method takes care of the refund.

Multiple reservations under one credit card transaction can now be canceled and refunded back to the credit card. For example, if three reservations were paid with one credit card payment, CancelReservation will now refund the full amount to the credit card. In this example, each reservation can also be canceled one at a time and all refunds will go back to the card.

Multiple reservations on the same account under separate transactions can also be refunded correctly to a credit card.

The CancelReservation optional parameter RefundData in the request object is no longer used. The RefundData.PaymentType is now determined by the payment type of the original transaction. If the payment type is credit card, then it will be refunded back to the credit card. If it is any other payment type, including cash, then the refund will default to a check. If a single reservation transaction has multiple payment types, then a check refund will be created.

For a full list of methods see SWS Methods.

SWS CancelReservationCashCredit Method

April 28, 2011 Leave a comment

Cancels a reservation made for specified rental item(s) and/or quote(s) AND credits an alternate rental on the account with the refund amount. Note: If you are canceling a reservation and NOT crediting the refund to an alternate rental, use the CancelReservation method.

Parameters

Name DataType Is Required
RefundInfo RefundData Required
Description The object containing the refund information for the cancellation.
Request CancelReservation_Request Required
Description The object containing the cancellation information.

Returned Parameters

Name DataType
Succeeded Boolean
Description Indicates that the reservation was cancelled successfully (“True”) or not (“False”).

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 CancelReservationCashCredit request object and a CancelReservationCashCredit response object.  We can define and create those like this:

// Create a request and response objects and RefundData and ContactInfo objects.
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.CancelReservation_Request res_request = new SWS.CancelReservation_Request();
SWS.RefundData refund_request = new SWS.RefundData();
SWS.CancelReservationCashCredit_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";

// Refund Data
refund_request.ApplyRefundRentalID = 123456;
refund_request.RefundType = SWS.RefundTypes.CASH_CREDIT;

// To cancel reservations(s)
res_request.AcctID = 123456;
res_request.RentalIDs = new long?[] { 123456, 654321 };
res_request.LostDemandReason = SWS.Lost_Demand_Reasons.Availability;
res_request.LostDemandNotes = "Unit size no longer available";
res_request.ContactData = contact_info;

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.CancelReservationCashCredit(user_request, res_request, 
refund_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.