RenewWarranty

RenewWarranty 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>
      • <RenewWarranty xmlns="http://www.consumerpriorityservice.com/services/">
        • <RenewWarrantyRequest>
          • <Authentication>
            • <DealerId>int</DealerId>
            • <SubAccountId>int</SubAccountId>
            • <ApiKey>string</ApiKey>
          • </Authentication>
          • <ContractNo>string</ContractNo>
        • </RenewWarrantyRequest>
      • </RenewWarranty>
    • </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 renewed

RenewWarranty 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>
      • <RenewWarrantyResponse xmlns="http://www.consumerpriorityservice.com/services/">
        • <RenewWarrantyResult>
          • <Ack>string</Ack>
          • <Errors>
            • <ErrorsType>
              • <ErrorID>int</ErrorID>
              • <ErrorMessage>string</ErrorMessage>
            • </ErrorsType>
          • </Errors>
          • <WarrantyExpiredDate>Date</WarrantyExpiredDate>
          • <OrderAmt>Dec</OrderAmt>
          • <MonthCharge>int</MonthCharge>
        • </RenewWarrantyResult>
      • </RenewWarrantyResponse>
    • </soap:Body>
  • </soap:Envelope>


Argument Type Details
Ack String success / fail
Errors ErrorsType
Errors.ErrorID Int Error Number
Errors.ErrorMessage String Detailed error message
WarrantyExpiredDate Date success (date warranty expire) / fail (default '1/1/1990')
OrderAmt Decmial success (renew order total) / fail (0)
MonthCharge int success (total month chrage) / fail (0)

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/RenewWarranty"

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 & "<RenewWarranty xmlns=""http://www.consumerpriorityservice.com/services/"">"
StrSoap = StrSoap & "<RenewWarrantyRequest>"
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 & "</RenewWarrantyRequest>"
StrSoap = StrSoap & "</RenewWarranty>"
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 RenewRequest As New cpsapi.RenewWarrantyRequestType
RenewRequest.Authentication = New cpsapi.AuthenticationType
RenewRequest.Authentication.DealerId = DEALERID
RenewRequest.Authentication.ApiKey = "DEALERKEY"
RenewRequest.ContractNo = "XXXXXX"

Dim m4 As New cpsapi.CpsServices

Dim response4 As cpsapi.RenewWarrantyResponseType
response4 = m4.VoidWarranty(RenewRequest)
If response4.Ack = "success" Then
    Response.Write("SUCCESS RENEW 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/RenewWarranty";
    $wsdl = "https://www.consumerpriorityservice.com/services/affinity_api.asmx";
    $namespace = "http://www.consumerpriorityservice.com/services/";
	
    $xml = '<RenewWarranty xmlns=""http://www.consumerpriorityservice.com/services/"">
        <RenewWarrantyRequest>
        <ContractNo>XXXXXX</ContractNo>
        <Authentication>
        <DealerId>DEALERID</DealerId>
        <SubAccountId>SUBACCOUNTID</SubAccountId>
        <ApiKey>APIKEY</ApiKey>
        </Authentication>
        </RenewWarrantyRequest>
        </RenewWarranty>';

    $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>';
?>