LoyaltyClientNonSaleTransaction Method |
Submit a Non Sale Transaction. A Non Sale Transaction can result in the Member earning Points, where the Transaction is not generated from a Sale.
The updated Card Ponts Balance is returned.
public ResultOfTransactionProduct NonSaleTransaction( ManagementGroupRequestOfNonSaleTransaction request )
using (var svc = new LoyaltyService.LoyaltyClient()) { var request = new LoyaltyService.ManagementGroupRequestOfNonSaleTransaction(); request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin var nonSaleTransaction = new LoyaltyService.NonSaleTransaction(); nonSaleTransaction.TransactionID = "Transaction ID"; //Optional - Must be unique. Will be generated if not supplied nonSaleTransaction.PartnerID = ""; //Required - Must be a valid Partner ID. Defaults to partner associated with request token if not supplied. If no partner associated with token error returned nonSaleTransaction.TerminalID = "Terminal_ID_1"; //Optional nonSaleTransaction.CashierCode = "Cashier_Code_1"; //Optional nonSaleTransaction.ClientVersion = "Client_Version"; //Optional nonSaleTransaction.CardNumber = "33293857"; //Required nonSaleTransaction.TransactionDate = DateTime.Now; //Required - cannot be a future date nonSaleTransaction.TransactionSaleValue = 1234.56M; //Required - must be a value between -100000.00 and 100000.00 nonSaleTransaction.TransactionNotes = "Please process transaction with haste"; //Optional nonSaleTransaction.CustomerAccountID = "CA_123";//Optional - links the transaction to a customer account //Optionally one or more transaction line items var lineItem = new LoyaltyService.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 nonSaleTransaction.TransactionLines = new LoyaltyService.SaleTransactionLine[] { lineItem }; //add transaction to request request.Value = nonSaleTransaction; LoyaltyService.ResultOfTransactionProduct result = svc.NonSaleTransaction(request); if (result.FaultCode == 0) { //Request succeeded } else { //Request failed throw new Exception(result.FaultDescription); } }