Home > Rates/Pricing > SWS UpdateStreetRate Method

SWS UpdateStreetRate Method


Updates the street rate for a group of rental items, based on dimensions and attributes.

Parameters

Name DataType Is Required
Access Integer Optional
Description The numeric value for the “Access” custom look up as defined by the site. See eUnitAccess for the available values.
Attribute01 Integer Optional
Description The numeric value for the “Attribute01” custom look up as defined by the site. See eUnitAttr01 for the available values.
Attribute02 Integer Optional
Description The numeric value for the “Attribute02” custom look up as defined by the site. See eUnitAttr02 for the available values.
Climate Integer Optional
Description The numeric value for the “Climate” custom look up as defined by the site. See eUnitClimate for the available values.
Depth Decimal Optional
Description The depth measurement of the rental item.
Door Integer Optional
Description The numeric value for the “Door” custom look up as defined by the site. See eUnitDoor for the available values.
Feature Integer Optional
Description The numeric value for the “Feature” custom look up as defined by the site. See eUnitFeatures for the available values.
Height Decimal Optional
Description The height of measurement the rental item.
NewRate Decimal Required
Description The new street rate for the rental items belonging to the collection of units with the attributes specified in the method parameters.
SiteID Long Optional
Description The site’s ID number. This can be found using the GetSiteList method.
Width Decimal Optional
Description The width measurement of the rental item.

Returned Parameters

Name DataType
CountFailed Integer
Description The number of rental items that failed to update.
CountPassed Integer
Description The number of rental items that were updated successfully.
CountRentUpdated Integer
Description The number of vacant rental items where the rent rate was updated to match the street rate.

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 UpdateStreetRate request object and a UpdateStreetRate response object. We will also need UpdateStreetReqData array to pass to the request object.

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

SWS.UpdateStreetReqData[] reqRateData = new SWS.UpdateStreetReqData[1];

Here’s my sample code of the Request object.

// request objects
reqRateData[0].NewRate = 55.50m;
reqRateData[0].Height = 10m;
reqRateData[0].Width = 8m;
reqRateData[0].Attribute01 = 1234;
           
request.SiteID = 123456;
request.StreetRateData = reqRateData;

For each record passed in, a corresponding record will be returned in the response object.  The first record in corresponds to the first record out and so on.
We can call the method and pass across the login object and the request object to make our payment. 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.UpdateStreetRate(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.

Categories: Rates/Pricing Tags: , , ,
  1. swsBecky
    April 5, 2017 at 1:30 pm

    Updated Sept. 3, 2015: Previously, when calling the UpdateStreetRate method, rentals which were in “Available Hold” were being updated with the new street rate. We’ve corrected this issue to no longer update rentals which are in “Available Hold”.

  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 )

Facebook photo

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

Connecting to %s