Cancel Request
The Cancel Request method is used to cancel a previous web request tax calculation process. Only valid web requests for the current and prior calendar months can be cancelled. Transactions older than 60 days cannot be cancelled.
Caution
After a successful Cancel Request method is performed, all reporting data associated with the cancelled web request is removed from the system and will no longer be included on any reports.
For development and testing with HTTPS POST, please use the following URL: https://testapi.taxrating.net/Services/V01/Energy/SureTax.asmx/CancelPostRequest
Request Record
FIELD NAME | POST FIELD | DESCRIPTION |
---|---|---|
Client Number | ClientNumber | Client ID Number – provided by CCH SureTax. |
Client Tracking Field | ClientTracking | Optional. Field for client transaction tracking. |
Transaction ID | TransId | Transaction ID of web request to be cancelled. |
Validation Key | ValidationKey | Validation Key provided by CCH SureTax. Required for client access to API function. |
Request Examples
HTTPS POST - JSON cancel request format with sample data
{
"ClientNumber":"000000000",
"ClientTracking":"test",
"TransId":"999",
"ValidationKey":"13290031-F004-4F00-BMN3-E979D6749B88"
}
HTTPS POST - XML cancel request format with sample data
<?xml version="1.0" encoding="utf-8"?>
<CancelRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ClientNumber>000000000</ClientNumber>
<ClientTracking>test</ClientTracking>
<TransId>999</TransId>
<ValidationKey>13290031-F004-4F00-BMN3-E979D6749B88</ValidationKey>
</CancelRequest>
SOAP 1.1 cancel request format sample
POST /V07/SureTax.asmx HTTP/1.1
Host: testapi.taxrating.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/CancelSoapRequest"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CancelSoapRequest xmlns="http://tempuri.org/">
<requestCancel>
<ClientNumber>string</ClientNumber>
<ClientTracking>string</ClientTracking>
<TransId>int</TransId>
<ValidationKey>string</ValidationKey>
</requestCancel>
</CancelSoapRequest>
</soap:Body>
</soap:Envelope>
SOAP 1.2 cancel request format sample
POST /V07/SureTax.asmx HTTP/1.1
Host: testapi.taxrating.net
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<CancelSoapRequest xmlns="http://tempuri.org/">
<requestCancel>
<ClientNumber>string</ClientNumber>
<ClientTracking>string</ClientTracking>
<TransId>int</TransId>
<ValidationKey>string</ValidationKey>
</requestCancel>
</CancelSoapRequest>
</soap12:Body>
</soap12:Envelope>
Response Message
FIELD NAME | DESCRIPTION |
---|---|
Successful | Response will be either ‘Y' or ‘N' : Y = Success / Success with errors N = Failure |
ResponseCode | ResponseCode: 9999 – Cancel Request was successful. 1101-1600 – Range of values for a failed request (no processing occurred). Values include: 1150 - Failure - Validation Key Required. 1151 - Failure - Invalid Validation Key. 1510 - Failure - Transaction is more than 60 days old. 9410 - Failure - Transaction is already cancelled. |
HeaderMessage | Response message: For ResponseCode 9999 – “Success” For ResponseCode 9001 – “Success with Item errors”. See the ItemMessages field above for a list of items / errors. For ResponseCode 1100-1600 – Unsuccessful / declined web request. See above or (Appendix I) for a list. |
ClientTracking | Field for client transaction tracking. |
TransId | Transaction ID (integer) – provided by CCH SureTax |
Response Examples
JSON cancel - response format with sample data
{
"Successful":"Y",
"ResponseCode":"9999",
"HeaderMessage":"Success",
"ClientTracking":"test",
"TransId":0
}
XML cancel - response format with sample data
<?xml version="1.0"?>
<CancelResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Successful>Y</Successful>
<ResponseCode>9999</ResponseCode>
<HeaderMessage>Success</HeaderMessage>
<ClientTracking>test</ClientTracking>
<TransId>0</TransId>
</CancelResponse>
SOAP 1.1 cancel - response format with sample data
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CancelSoapRequestResponse xmlns="http://tempuri.org/">
<CancelSoapRequestResult>
<Successful>string</Successful>
<ResponseCode>string</ResponseCode>
<HeaderMessage>string</HeaderMessage>
<ClientTracking>string</ClientTracking>
<TransId>int</TransId>
</CancelSoapRequestResult>
</CancelSoapRequestResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2 cancel - response format with sample data
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soapenvelope">
<soap12:Body>
<CancelSoapRequestResponse xmlns="http://tempuri.org/">
<CancelSoapRequestResult>
<Successful>string</Successful>
<ResponseCode>string</ResponseCode>
<HeaderMessage>string</HeaderMessage>
<ClientTracking>string</ClientTracking>
<TransId>int</TransId>
</CancelSoapRequestResult>
</CancelSoapRequestResponse>
</soap12:Body>
</soap12:Envelope>
Cancel Request with Invoice Layout
Cancel request with Invoice will cancel a transaction where the transaction id and the invoice number match the values sent in the request. Field names formatted in BOLD are required fields that must be passed to SureTax API. All Field Names are case-sensitive. Field values are required unless otherwise noted in their description below.
Request Record
FIELD | FIELD NAME | DESCRIPTION |
---|---|---|
Client Number | ClientNumber | Client ID Number provided by CCH SureTax. |
Client Tracking Field | ClientTracking | Optional. Field for client transaction tracking. |
Transaction ID | TransId | Transaction ID of web request to be cancelled. |
Validation Key | ValidationKey | Validation Key provided by CCH SureTax. |
Invoice Number | InvoiceNumber | Invoice Number that was sent with the transaction that needs to be canceled. |
Examples
requestCancel={
"ClientNumber": "<CLIENTNUMBER>",
"ValidationKey": "<VALIDATIONKEY>",
"ClientTracking": "<CLIENTTRACKING>",
"TransId": 841901824,
"InvoiceNumber": "TESTINV1000"
}
Cancel Response with Invoice Layout
Cancel Response Message
FIELD NAME | DESCRIPTION |
---|---|
Successful | Response will be either "Y" or "N": Y = Success / Success with Item error N = Failure |
ResponseCode | ResponseCode: 9999 - Request was successful. 1101-1600 - Range of values for a failed request (no processing occurred). 1150 - Failure - Validation Key Required. 1151 - Failure - Invalid Validation Key. 1510 - Failure - Transaction is more than 60 days old. 9010 -Failure - Transaction is already cancelled. |
HeaderMessage | Response message: For ResponseCode 9999 - "Success" For ResponseCode 9001 - "Success with Item errors". See the ItemMessages field for a list of items / errors. For ResponseCode 1100-1600 - Unsuccessful / declined web request. See Appendix D - Response Code and Messages for a list. |
ClientTracking | Client transaction tracking provided in web request. |
TransId | Transaction ID (integer) - Unique identifier for your transaction provided by CCH SureTax |
Examples
{
"HeaderMessage": "Success",
"ResponseCode": "9999",
"Successful": "Y",
"TransId": 841901824
}
Implementation Examples
PHP
Cancel Request using HTTPS POST and cURL
$CancelRequest["ClientNumber"] = "000000000";
$CancelRequest["ClientTracking"] = "test";
$CancelRequest["TransID"] = "999";
$CancelRequest["ValidationKey"] = "13290031-F004-4F00-BMN3-E979D6749B88";
// $post_type determines what encoding type – either XML or JSON
if( $post_type == 'xml' ) {
//XML
$xmlclass = 'CancelRequest';
$url1 = "http://www.w3.org/2001/XMLSchema-instance";
$url2 = "http://www.w3.org/2001/XMLSchema";
$xml = '<?xml version="1.0" encoding="utf-8"?>';
$xml .= "<" . $xmlclass . ' xmlns:xsi="' .$url1 .'" ';
$xml .= ' xmlns:xsd="' .$url2 .'">';
foreach( $postfields as $x => $y) {
$xml .= "<$x>".htmlentities( strval($y) ) . "</$x>";
}
$xml .= "</" . $xmlclass . ">";
$curl_data = $xml;
} else {
// JSON
$json = json_encode($postfields);
$curl_data = $json;
}
// Initiate cURL request
$ch = curl_init();
// SureTax Cancel request URL
$suretax_url = https://testapi.taxrating.net/Services/V07/SureTax.asmx?op=CancelPostRequest';
// Set Headers
curl_setopt($ch, CURLOPT_POSTFIELDS, "requestCancel=$curl_data" ); // Assign POST Data
curl_setopt($ch, CURLOPT_POST, 1); // Select POST as transfer type
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_URL,$ suretax_url); // The Web service URL
curl_setopt($ch, CURLOPT_TIMEOUT, 9); // Set timeout
$response = curl_getinfo($ch);
curl_close($ch);
Note
No HTTP header should be provided (no need to supply the cURL CURLOPT_HTTPHEADER option.
Response
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">JSON or XML string</string>
.NET
Cancel Request
POST /V07/SureTax.asmx/CancelPostRequest HTTP/1.1
Host: testapi.taxrating.net
Content-Type: application/x-www-form-urlencoded
Content-Length: length requestCancel=string
Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">string</string>