Reinstate Affinity Warranty

Reinstate Input

  • <?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>
      • <Reinstate xmlns="http://www.consumerpriorityservice.com/services/">
        • <ReinstateWarrantyRequest>
          • <Authentication>
            • <DealerId>int</DealerId>
            • <SubAccountId>int</SubAccountId>
            • <ApiKey>string</ApiKey>
          • </Authentication>
          • <ContractNo>string</ContractNo>
        • </ReinstateWarrantyRequest>
      • </Reinstate>
    • </soap:Body>
  • </soap:Envelope>


Argument Type Details
Authentication ApiAuthenticationType
Authentication.DealerId Int Your Dealer ID
Authentication.SubAccountId Int (optional) Your SubAccount ID
Authentication.ApiKey String Your API Key
ContractNo String Contract # to be cancelled

CancelWarranty Output

  • <?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>
      • <CancelWarrantyResponse xmlns="http://www.consumerpriorityservice.com/services/">
        • <CancelWarrantyResult>
          • <Ack>string</Ack>
          • <Errors>
            • <ErrorsType>
              • <ErrorID>int</ErrorID>
              • <ErrorMessage>string</ErrorMessage>
            • </ErrorsType>
          • </Errors>
        • </CancelWarrantyResult>
      • </CancelWarrantyResponse>
    • </soap:Body>
  • </soap:Envelope>


Argument Type Details
Ack String success / fail
Errors ErrorsType
Errors.ErrorID Int Error Number
Errors.ErrorMessage String Detailed error message

Classic ASP Sample

const SoapServer = "https://www.consumerpriorityservice.com/services/affinity_api.asmx?wsdl"

set xmldom = server.CreateObject("Microsoft.XMLDOM")
set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")

xmlhttp.open "POST", SoapServer, false
xmlhttp.setRequestHeader "Man", POST & " " & SoapServer & " HTTP/1.1"
xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
xmlhttp.setRequestHeader "SOAPAction", "http://www.consumerpriorityservice.com/services/CancelWarranty"

StrSoap = StrSoap & "<?xml version=""1.0"" encoding=""utf-8""?>"
StrSoap = StrSoap & "<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/"">"
StrSoap = StrSoap & "<soap:Body>"
StrSoap = StrSoap & "<CancelWarranty xmlns=""http://www.consumerpriorityservice.com/services/"">"
StrSoap = StrSoap & "<ReinstateWarrantyRequest>"
StrSoap = StrSoap & "<ContractNo>XXXXXX</ContractNo>"
StrSoap = StrSoap & "<Authentication>"
StrSoap = StrSoap & "<DealerId>DEALERID</DealerId>"
StrSoap = StrSoap & "<SubAccountId>SUBACCOUNTID</SubAccountId>"
StrSoap = StrSoap & "<ApiKey>APIKEY</ApiKey>"
StrSoap = StrSoap & "</Authentication>"
StrSoap = StrSoap & "</ReinstateWarrantyRequest>"
StrSoap = StrSoap & "</CancelWarranty>"
StrSoap = StrSoap & "</soap:Body>"
StrSoap = StrSoap & "</soap:Envelope>"

xmlhttp.send(StrSoap)	
	
if xmlhttp.Status = 200 then	
Set xmldom = xmlhttp.responseXML
'NO SERVER ERROR
'CHECK FOR API ERROR
Response.write(xmlhttp.responseText)
Else
'SERVER ERROR
Response.Write(xmlhttp.responseText)
End if

set xmlhttp = nothing
set xmldom = nothing
    

.NET Sample

Create a Web Reference named "cpsapi" with URL https://www.consumerpriorityservice.com/services/affinity_api.asmx

Dim CancelRequest As New cpsapi.ReinstateWarrantyRequestType
CancelRequest.Authentication = New cpsapi.AuthenticationType
CancelRequest.Authentication.DealerId = DEALERID
CancelRequest.Authentication.ApiKey = "DEALERKEY"
CancelRequest.ContractNo = "XXXXXX"

Dim m4 As New cpsapi.CpsServices

Dim response4 As cpsapi.CancelWarrantyResponseType
response4 = m4.CancelWarranty(voidRequest)
If response4.Ack = "success" Then
    Response.Write("SUCCESS VOID / CANCEL WARRANTY")    
Else
    For i As Integer = 0 To response4.Errors.GetUpperBound(0)
        Response.Write("VOIDWARRANTY ERROR: " & response4.Errors(i).ErrorMessage)
    Next
End If    
    

PHP Sample


<?php
    require_once('nusoap/lib/nusoap.php');
    $soapaction = "http://www.consumerpriorityservice.com/services/CancelWarranty";
    $wsdl = "https://www.consumerpriorityservice.com/services/affinity_api.asmx";
    $namespace = "http://www.consumerpriorityservice.com/services/";
	
    $xml = '<CancelWarranty xmlns=""http://www.consumerpriorityservice.com/services/"">
        <ReinstateWarrantyRequest>
        <ContractNo>XXXXXX</ContractNo>
        <Authentication>
        <DealerId>DEALERID</DealerId>
        <SubAccountId>SUBACCOUNTID</SubAccountId>
        <ApiKey>APIKEY</ApiKey>
        </Authentication>
        </ReinstateWarrantyRequest>
        </CancelWarranty>';

    $client = new nusoap_client($wsdl);
    $err = $client->getError();
    if ($err) {
	    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    }
    $client->soap_defencoding = 'UTF-8';
    $mysoapmsg = $client->serializeEnvelope($xml);
	
    echo str_replace("><","><br/>",htmlspecialchars($client->serializeEnvelope($xml)));

    $result = $client->send($mysoapmsg, $soapaction);
	
    echo '<h2>Request</h2><pre>' . str_replace("><","><br/><",htmlspecialchars($client->request, ENT_QUOTES)) . '</pre>';
    echo '<h2>Response</h2><pre>' . str_replace("><","><br/><",htmlspecialchars($client->response, ENT_QUOTES)) . '</pre>';
    echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>