Home > API General, Rental/Reservation, Site Administration > SWS GetSiteUnitDataFiltered Method

SWS GetSiteUnitDataFiltered Method

Retrieves a list of available rental items. Based on the parameters, it will retrieve the first unit available for the parameters requested. This will also return promotions for the items, if requested. This method is used to filter so only units that are soft reservable are returned.


Name Data Type Required
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.
Width Decimal Optional
Description The width measurment of the unit.
Depth Decimal Optional
Description The depth measurement of the unit.
MinAvailable Integer Optional
Description The minimum number of available units.
MinRentRate Decimal Optional
Description The minimum rent rate for the units queried.
MaxRentRate Decimal Optional
Description  The maximum rent rate for the units queried.
SoftReservable String Optional
Description Indicates that the rental is available to be place on a soft reservation (“Yes”) or that it is not available for a soft reservation (“No”).
HardReservable Decimal Not Used
Description This method ignores this field and only returns units that are soft reservable.
GetPromoData Boolean Optional
Description Indicates if you wish to receive promotions with the query.
PromoDataType PCDTypeOptions Optional*
Description Indicates what types of promotions to return.
Available values:

  • None
  • HighestPriorityPromotion
  • AllPromotions
  • HighestPriorityDiscount
  • AllDiscounts
  • HighestPriorityRateMod
  • AllRateMods
  • All
  • HighestPriorityDiscountAndPromo
  • HighestPriorityPCDAndRateMod

*Required if you enter true for GetPromoData.

Returned Parameters

Name DataType
Description The total number of rental items available at the site.
Description The description of the site’s revenue class.
Description The current rent rate.
DEPTH Decimal
Description The depth of the rental item.
Description The “Features” custom lookup value as defined by the site.
Description Ignored in this method.
Description The maximum rent rate that can be charged for the rental item, determined by the admin.
Description The minimum rent rate that can be charged for the rental item, determined by the admin.
Description The description for the “Unit of Measure” (UOM) for the rental cycle. Currently the only option is “Month”.
Description The promotion, discount or rate modification’s description, if GetPromoData was set to “True”.
Description The details of the current available promotion for the rental item, if GetPromoData was set to “True”.
PROMO_ID Decimal
Description The promotion’s ID number.
Description The promotion, discount or rate modification’s name.
PromoCollection PCDItem
Description Collection of data describing the promotion.
Description The total number of the specific rental items at the site.
Description The hard reservation deposit amount.
Description The site’s revenue class ID number.
Description The site’s ID number.
Description Indicates if the unit can be place on a soft reservation (“Y”) or not (“N”).
UNIT_ID Decimal
Description The unit’s ID number. This is maintained through rentals.
Description The unit’s number as assigned by the organization. This is not the UnitID.
Description The unit’s version number which serves to prevent duplicate use of the unit. This is returned when you use any version of GetSiteUnitData or the GetUnitData method.
WIDTH Decimal
Description The width of the rental item.


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

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

Here’s my sample code of the Request object using siteID and Promo Data filter options.

 ' GetSiteUnitDataFiltered Request
request.SiteID = 123456;
request.PromoDataType = SWS.PCDTypeOptions.None;

Finally we can call the method and pass across the login object and the request object to get our filtered site unit data. It’s a good idea to do this in a Try Catch block.

// Call the method that will load the response object
  response = service.GetSiteUnitDataFiltered(user_request, request);
catch (Exception ex)

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.

  1. swsBecky
    April 5, 2017 at 12:02 pm

    Updated Oct. 29,2015: Previously this function was not returning the promotion description value as was intended. The promotion description value will be returned correctly.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s