Click or drag to resize

PointOfSaleClientSaleTransaction Method

Submit a Sale Transaction.

The updated Card Ponts Balance is returned.

Remarks
  • TransactionID is optional. If no TransactionID is submitted, then a unique TransactionID is returned by the Service
  • The submitted Transaction Date must be Greater Than or Equal to the current Date and Time
Syntax
C#
public ResultOfTransactionProduct SaleTransaction(
	RequestOfSaleTransaction request
)

Parameters

request
Type: PointOfSaleServiceRequestOfSaleTransaction

Return Value

Type: ResultOfTransactionProduct
Examples
C#
using (var svc = new PointOfSaleService.PointOfSaleClient())
{
  var request = new PointOfSaleService.RequestOfSaleTransaction();
  request.Token = "Token";//Required - Token returned from PointOfSaleService.Authenticate

  var saleTransaction = new PointOfSaleService.SaleTransaction();
  saleTransaction.TransactionID = "Transaction ID"; //Optional - Must be unique. Will be generated if not supplied
  saleTransaction.TerminalID = "Terminal_ID_1"; //Optional
  saleTransaction.CashierCode = "Cashier_Code_1"; //Optional
  saleTransaction.ClientVersion = "Client_Version"; //Optional
  saleTransaction.CardNumber = "21000005"; //Required
  saleTransaction.TransactionDate = DateTime.Now; //Required - cannot be a future date
  saleTransaction.TransactionSaleValue = 1234.56M; //Required - must be a value between -100000.00 and 100000.00
  saleTransaction.TransactionNotes = "Please process transaction with haste"; //Optional
  saleTransaction.CustomerAccountID = "CA_123";//Optional - links the transaction to a customer account

  //Optionally one or more transaction line items
  var lineItem = new PointOfSaleService.SaleTransactionLine();
  lineItem.ProductCode = "Product_123"; //Optional
  lineItem.ItemDescription = "Red Bag"; //Optional
  lineItem.Quantity = 2; //Optional
  lineItem.Department = "Bags"; //Optional
  lineItem.DiscountReason = "Loyal customer"; //Optional
  lineItem.Category = "Products";//Optional
  lineItem.LineID = "RedBag_123";//Optional
  lineItem.LineValue = 50.0m;//Optional
  lineItem.ProductBrand = "Bag Makers";//Optional
  lineItem.UnitValue = 25.0m;//Optional

  //add line item to transaction
  saleTransaction.TransactionLines = new PointOfSaleService.SaleTransactionLine[] { lineItem };//Required

  //add one of the transactions to the request
  request.Value = saleTransaction;//Required

  PointOfSaleService.ResultOfTransactionProduct result = svc.SaleTransaction(request);

  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed
    throw new Exception(result.FaultDescription);
  }
}
See Also