Archive

Posts Tagged ‘Retail’

SWS SellRetailNoAccountMultiple Method

Creates an assessment for the sale of multiple retail items without having a Store account. Once you have a response, you will need to call the GetTotalDue method. To add multiple different items to the account you will need to have an array of “SellRetailNoAccount” for each item that should be added to the account. You will need to contact SWS support in order to get the organizations “non-account sale” AcctID as this is currently not available in SWS.

Parameters

Name DataType Is Required
Item AVAIL_SITE_RETAIL_ITEMS Required
Description The object containing the required item information.
OrgID Long Required
Description The organization’s ID number.
Quantity Integer Required
Description The total number of items to be sold.
TaxExemptNumber String Optional
Description If the company or individual is tax exempt, enter their tax ID number here.

Returned Parameters

Name DataType
AssessmentID Long
Description An assessment ID is created for every assessment set up in store.
ErrorString String
Description If the creation of the assessment failed this will give details as to why.
RetailItemID Long
Description The retail item’s ID number.
Successful Boolean
Description Indicates if the item was successfully assessed to the account (“True”) or not (“False”).

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

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, a SellRetailNoAccountMultiple request object, and a SellRetailMultiple response object. We will also need SellRetailNoAccount request object as an array of these objects is what the above request object uses. You will also need results from the GetAvailableRetailItems methods. We can define and create those like this:

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

SWS.SellRetailNoAccount_Request[] requestItems = 
                                new SWS.SellRetailNoAccount_Request[1];
SWS.GetAvailableRetailItems_Request retailItemReq = 
                                new SWS.GetAvailableRetailItems_Request();

Here is a sample code of the request object (including some optional parameters):

// SellRetailNoAccountMultiple Request
retailItemReq.SiteID = 123456;

requestItems[0].OrgID = 123456;
requestItems[0].Quantity = 2;
requestItems[0].Item = service.GetAvailableRetailItems(user_request, retailItemReq).Details[0];

request.RetailItems = requestItems;

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.SellRetailNoAccountMultiple(user_request, request);
}
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.

SWS SellRetailNoAccount Method

Creates an assessment for the sale of a retail item without having a Store account. Once you have a response, you will need to call the GetTotalDue method. This will provide the total amount that needs to be paid using the MakePayment method.

Parameters

Name DataType Is Required
Item AVAIL_SITE_RETAIL_ITEMS Required
Description The object containing the required item information.
OrgID Long Required
Description The organization’s ID number.
Quantity Integer Required
Description The total number of items to be sold.
TaxExemptNumber String Optional
Description If the company or individual is tax exempt, enter their tax ID number here.

Returned Parameters

Name DataType
AccountID Long
Description The account’s ID number.
AssessmentID Long
Description An assessment ID is created for every assessment set up in store.

Example

As with every method we need to pass in credentials. We do this with the LookupUser request object.

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, a SellRetailNoAccount request object, and a SellRetailNoAccount response object. You will also need an item from the GetAvailablRetailItems method. We can define and create those like this:

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

SWS.GetAvailableRetailItems_Request retailItemReq = 
                             new SWS.GetAvailableRetailItems_Request();

Here is a sample code of the request object (including some optional parameters):

// SellRetailNoAccount Request
retailItemReq.SiteID = 123456;
            
request.OrgID = 123456;
request.Quantity = 2;
request.Item = service.GetAvailableRetailItems
               (user_request, retailItemReq).Details[0];

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.SellRetailNoAccount(user_request, request);
}
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.

SWS GetTransactionRentals Method

May 23, 2011 Leave a comment

Retrieves information regarding rentals and retail related to a specified transaction.

Parameters

Name DataType Is Required
SiteID Long Required
Description The site’s ID number. This can be found using the GetSiteList method.
TranID ArrayOfLong Required
Description The transaction’s ID number. Transaction IDs are system generated for each monetary transaction that occurs in the system. If there is no transaction ID the transaction failed. The transaction ID is returned when any MakePayment method is used.

Returned Parameters

Name DataType
RENTAL_ID Decimal
Description The rental item’s ID number.
TNX_DATE DateTime
Description The date the transaction occurred.
TNX_ID Long
Description The transaction’s ID number.Transaction IDs are system generated for each monetary transaction that occurs in the system.
HasRetail Boolean
Description Indicates if the transaction included retail assessments (“True”) or not (“False”).
TranID Long
Description The transaction’s ID number. Transaction IDs are system generated for each monetary transaction that occurs in the system. This reiterates the first transaction ID.

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

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

Here’s my sample code of the Request object.

// GetTransactionRentals Request
request.SiteID = 123456;
request.TranID = new long[] { 123456 };

Finally we can call the method and pass across the login object and the request object to get our transaction rentals. 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.GetTransactionRentals(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 GetRetailReceiptItems Method

May 23, 2011 Leave a comment

Retrieves the list of assessments for a specific transaction ID for retail sales only.

Parameters

Name Data Type Is Required
SiteID  Long  Required
Description  The site’s ID. This can be found using the GetSiteList method.
TransactionID  Long Required
Description The transaction’s ID number. Transaction IDs are system generated for each payment transaction that occurs in the system. If there is no transaction ID the transaction failed. The transaction ID is returned when any MakePayment method is used.

Returned Parameters

 Name Data Type
TNX_ID Long
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.
SITE_ID Long
Description The site’s ID number.
ACCT_ID Long
Description The account’s ID associated with the transaction.
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.
ACCT_TYPE Integer
Description A numerical value identifying the type of account.
Available values:

  • 1 – Personal
  • 2 – Business
RETAIL_ID Long
Description The ID of the retail item.
TNX_DETAIL_ID Long
Description The ID of the transaction detail
RETAIL_OBJECT_ID Long
Description The ID of the individual retail object.
TNX_DATE DateTime
Description The date of the transaction.
AMT Decimal
Description The amount of the transaction.
ITEM_PRICE Decimal
Description The price of the item.
TAX_CHARGED String
Description Indicates if tax was charged (“Y”) or not (“N”). Default is “Y”.
TAX Decimal
Description The amount of tax that was charged.
EXTENDED Decimal
Description The extended amount.
FULFILLED Decimal
Description The fulfilled amount.
ASS_ID Long
Description The assessment ID.
ASS_REF Long
Description The assessment reference number.
ICON String
Description The processed function for the transaction.
CLASS_DESC String
Description The description of the retail class.
ITEM_NAME String
Description The name of the item.
DESCRIPTION String
Description The description of the item sold.
QTY Decimal
Description The quantity of the item sold.
RETURNED Decimal
Description A numerical value displaying whether the item is returned.
PART_NUMBER String
Description The part number of the item.
SKU String
Description The individual SKU of the item sold.
BARCODE String
Description A numerical value assigned for an item type.
ITEM_TYPE Integer
Description The ID assigned to the tax group.
TAX_GROUP_ID Decimal
Description The ID for the tax group applicable to the retail revenue class.
STATUS Integer
Description A numerical value for the status of the transaction.

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

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

Here’s my sample code of the Request object.

// GetRetailReceiptItems Request
request.SiteID = 123456;
request.TransactionID = 123456;

Finally we can call the method and pass across the login object and the request object to get items for our retail receipt. 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.GetRetailReceiptItems(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.