Archive

Posts Tagged ‘Auction’

SWS GetAuctionRentals Method

May 12, 2011 Leave a comment

Retrieves detailed information for rental items from a specified auction when the auction ID is provided, it will only return those rental items that are part of that auction; otherwise, all rentals assigned to any auction will be returned.

Parameters

Name DataType Is Required
AuctionID Long Optional
Description The auction’s ID number. If no AuctionID is specified, all auctions will be returned. The AuctionID can be retrieved using the GetAuctions method.
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
Acct_ID Long
Description The account’s ID number.
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.
Auction_Date String
Description The date and time of the auction.
Auction_ID Long
Description The auction’s ID number.
Auction_Obj_ID Long
Description The auction’s item ID number.
Auction_Time String
Description The formatted time of the auction.
Del_Rental_ID Long
Description The rental item’s ID number.
Icon String
Description The URL for the site revenue class icon that displays in the Store application.
Last_Payment_Amount Decimal
Description The amount of the last payment made.
Last_Payment_Date DateTime
Description The date the last payment was made on the rental item.
Lien_State Integer
Description The state/province for the address.
LTD DateTime
Description The lease-thru-date (LTD).
Notes String
Description The free text note as to the auction’s proceedings.
PTD DateTime
Description The paid-thru-date (PTD).
Rental_ID Long
Description The rental item’s ID number.
Site_ID Long
Description The site’s ID number.
Total_Due Decimal
Description The total amount of funds not paid to date.
Unit_Contents String
Description The free text note as to the rental item’s auction status.
Unit_Number String
Description The unit’s number as assigned by the organization. This is not the UnitID.
Unit_Status Integer
Description The rental item’s rental status.

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

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

Here’s my sample code of the Request object.

// GetAuctionRentals Request
request.SiteID = 123456;
request.AuctionID = 123456;

Finally we can call the method and pass across the login object and the request object to get our auction 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.GetAuctionRentals(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.

SWS CreateAuction Method

April 28, 2011 Leave a comment

Creates a rental auction so that rental items can be placed in auction, including date, time, auctioneer and auction status.

Parameters

Name DataType Is Required
AuctionDateTime dateTime Required
Description The date and time the auction will take place. If no time is supplied, the default is 12:00am.
AuctioneerName String Required
Description The auctioneer’s name. Max string length of 100.
AuctionNotes String Optional
Description The free text note as to the rental item’s auction status. Max string length of 4000.
SiteID Long Required
Description The site’s ID number where the auction will take place. This can be found using the GetSiteList method.

Returned Parameters

Name DataType
AuctionID Long
Description Returns the auction’s ID number. This is a system generated number.
Auction_Date dateTime
Description Returns the date and time when the auction will occur.
Auction_Time dateTime
Description Returns just the time when the auction will occur.
Created_By Long
Description Returns the Store user’s ID number that created the auction.
Notes String
Description Returns the auctions notes.
Site_ID Long
Description Returns the sites ID number where the auction is scheduled.
Status Integer
Description Returns the auction’s status.
Available values:

  • 1 – Scheduled
  • 2 – Completed
  • 3 – Cancelled
Updated_By Long
Description Returns the Store user’s ID number that last updated the field.

Examples

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

// Create request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.CreateAuction_Request request = new SWS.CreateAuction_Request();
SWS.CreateAuction_Response response;

Here’s my sample code of the Request object.

// new auction request
request.SiteID = 123456;
request.AuctionDateTime = DateTime.Now.AddDays(7);
request.AuctioneerName = "Joe Auctioneer";
request.AuctionNotes = "This will be the only auction this month.";

Finally we can call the method and pass across the login object and the request object to create our auction. 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.CreateAuction(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.

SWS AuctionEndRental Method

April 26, 2011 Leave a comment

Terminates a rental item and processes a payment for the amount collected from the auction. The PaymentData object is required when making a payment. When making a payment, either the Credit Card Info, Check Info or Cash Info must be set and the TotalAmountPaid should be equal to the sum of any/all of those amounts used. If site rules are configured to refund auction overage amounts to tenant, a refund request will be automatically generated. Important: Any amount paid through this method cannot be reversed. Make sure to confirm this is a valid action.

Parameters

Name DataType Is Required
Request AuctionEndRentalInfo Required
Description Object containing the required information to end the rental.

Returned Parameters

Name DataType
AuctionID Long
Description The auction’s ID number.
ErrorMessage String
Description A message about any problem that occurred during the process, including details to locate errant code.
RentalID Long
Description The rental item’s ID number.
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, an AuctionEndRental request object and an AuctionEndRental response object.  We can define and create those like this:

// Create request and response objects 
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.AuctionEndRental_Request request = new SWS.AuctionEndRental_Request();
SWS.AuctionEndRental_Response response;

Here’s my sample code of the Request object.

// Fill in the request data
request.SiteID = 123456;
request.AuctionDetail[0].AuctionID = 123456;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].AcctID = 123456;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].RentalID = 123456;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].Status = SWS.AuctionObjsStatusValues.SOLD_AT_AUCTION;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].SoldAmount = 155;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].Tax = 15.5m;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].BuyerName = "First Buyer";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].BuyerAddress = "123 Main St, My Town, UT  84000";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].BuyerPhone = "800-555-1212";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].Notes = "Will pick later this week.";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.SiteID = 123456;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.AcctID = 123456;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.RentalIDs = new long[] { 123456 };
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.Cycles = new int[] { 1 };
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.TotalAmtDue = 170.5m;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.TotalAmtPaid = 170.5m;
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.CreditCardInfo[0].CardHolderName = "First Buyer";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.CreditCardInfo[0].CardNumber = "4000111122223333";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.CreditCardInfo[0].ExpireMonth  = "08";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.CreditCardInfo[0].ExpireYear = "2018";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.CreditCardInfo[0].CVV2 = "111";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.CreditCardInfo[0].Address = "123 Main St";
request.AuctionDetail[0].AuctionRentalsPayInfo[0].PaymentData.CreditCardInfo[0].PostalCode = "84000";

Finally we can call the method and pass across the login object and the request object for ending rentals from an auction. 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.AuctionEndRental(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.


UPDATED 08/23/2012

This method has been updated to automatically refund the tenant’s credit card when auction proceeds exceed the total amount due for the rental. The following criteria must be met in order for the credit card to be automatically refunded:

1)      The ‘Auto-Refund Auction’ rule must be set to ‘TRUE’ in the applications site rules.
2)      The tenant’s last payment must have been charged to a credit card and the amount charged must be >= the amount to be refunded; Otherwise, a check refund will be created.
3)      The amount to be refunded must be less than the amount defined in the ‘Auto-Approval Threshold’ in the applications site rules; Otherwise, the refund will require secondary approval before the refund can be completed.