Code Samples
Programming Language
C#
//Request
System.Collections.Specialized.NameValueCollection
MyPost = new System.Collections.Specialized.NameValueCollection();
MyPost.Add("xKey", ""); // Credential
MyPost.Add("xVersion", "4.5.5"); // API version
MyPost.Add("xSoftwareName", My.Application.Info.Title); // Name of your software
MyPost.Add("xSoftwareVersion", My.Application.Info.Version.ToString); // Version of your software
MyPost.Add("xCommand", "cc:sale");
MyPost.Add("xCardNum", "");
MyPost.Add("xExp", "");
MyPost.Add("xName", "");
MyPost.Add("xAmount", "");
MyPost.Add("xAccount", "");
MyPost.Add("xMagstripe", "");
MyPost.Add("xToken", "");
MyPost.Add("xCustom01", "");
MyPost.Add("xCVV", "");
MyPost.Add("xStreet", "");
MyPost.Add("xZip", "");
MyPost.Add("xBillFirstName", "");
MyPost.Add("xBillMiddleName", "");
MyPost.Add("xBillLastName", "");
MyPost.Add("xBillCompany", "");
MyPost.Add("xBillStreet", "");
MyPost.Add("xBillStreet2", "");
MyPost.Add("xBillCity", "");
MyPost.Add("xBillZip", "");
MyPost.Add("xBillCountry", "");
MyPost.Add("xBillPhone", "");
MyPost.Add("xBillMobile", "");
MyPost.Add("xShipFirstName", "");
MyPost.Add("xShipMiddleName", "");
MyPost.Add("xShipLastName", "");
MyPost.Add("xShipCompany", "");
MyPost.Add("xShipStreet", "");
MyPost.Add("xShipStreet2", "");
MyPost.Add("xShipCity", "");
MyPost.Add("xShipState", "");
MyPost.Add("xShipZip", "");
MyPost.Add("xShipCountry", "");
MyPost.Add("xShipPhone", "");
MyPost.Add("xShipMobile", "");
MyPost.Add("xRefNum", "");
MyPost.Add("xAuthCode", "");
MyPost.Add("xIP", "");
MyPost.Add("xRouting", "");
MyPost.Add("xCardpresent", "");
MyPost.Add("xDUKPT", "");
MyPost.Add("xTax", "");
MyPost.Add("xTip", "");
MyPost.Add("xInvoice", "");
MyPost.Add("xPONum", "");
MyPost.Add("xComments", "");
MyPost.Add("xDescription", "");
MyPost.Add("xEmail", "");
MyPost.Add("xFax", "");
MyPost.Add("xBillState", "");
MyPost.Add("xAllowPartialAuth", "");
MyPost.Add("xRxAmount", "");
MyPost.Add("xDentalAmount", "");
MyPost.Add("xVisionAmount", "");
MyPost.Add("xTransitAmount", "");
MyPost.Add("xCopayAmount", "");
MyPost.Add("xClinicalAmount", "");
MyPost.Add("xOrderID", "");
MyPost.Add("xExistingCustomer", "");
MyPost.Add("xAllowDuplicate", "");
MyPost.Add("xMICR", "");
MyPost.Add("xCheckNum", "");
MyPost.Add("xCheckImageFront", "");
MyPost.Add("xCheckImageBack", "");
MyPost.Add("xVoucherApproval", "");
MyPost.Add("xVoucherSerial", "");
MyPost.Add("xGatewayRefNum", "");
MyPost.Add("xGatewayResult", "");
MyPost.Add("xGatewayError", "");
MyPost.Add("xGatewayCVV", "");
MyPost.Add("xGatewayAVS", "");
MyPost.Add("xOrderItems", "");
MyPost.Add("xOrderType", "");
MyPost.Add("xCustomerComments", "");
MyPost.Add("xShipMethod", "");
MyPost.Add("xShipAmount", "");
System.Net.WebClient MyClient = new System.Net.WebClient();
string MyResponse = System.Text.UTF8Encoding.ASCII.GetString(MyClient.UploadValues("https://x1.cardknox.com/gateway", MyPost));
// Response
System.Collections.Specialized.NameValueCollection MyResponseData = System.Web.HttpUtility.ParseQueryString(MyResponse); // If necessary, add reference to System.Web
string MyResult = "";
if (MyResponseData.AllKeys.Contains("xResult"))
MyResult = MyResponseData["xResult"];
string MyStatus = "";
if (MyResponseData.AllKeys.Contains("xStatus"))
MyStatus = MyResponseData["xStatus"];
string MyError = "";
if (MyResponseData.AllKeys.Contains("xError"))
MyError = MyResponseData["xError"];
string MyRefNum = "";
if (MyResponseData.AllKeys.Contains("xRefNum"))
MyRefNum = MyResponseData["xRefNum"];Java/Android
Node.js
PHP
Python 2
Python 3
VB.NET
Last updated
Was this helpful?

