CreateOrder

CreateOrder 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>
      • <CreateOrder xmlns="http://www.consumerpriorityservice.com/services/">
        • <Order>
          • <Authentication>
            • <DealerId>int</DealerId>
            • <SubAccountId>int</SubAccountId>
            • <ApiKey>string</ApiKey>
          • </Authentication>
          • <StoreName>string</StoreName>
          • <StoreId>string</StoreId>
          • <OrderPO>string</OrderPO>
          • <Items>
            • <CreateOrderItemsRequestType>
              • <PurchaseDate>string</PurchaseDate>
              • <Manufacturer>string</Manufacturer>
              • <Model>string</Model>
              • <Serial>string</Serial>
              • <Price>double</Price>
              • <WarrantySKU>string</WarrantySKU>
            • </CreateOrderItemsRequestType>
          • </Items>
          • <Customer>
            • <Company>string</Company>
            • <Email>string</Email>
            • <Phone>string</Phone>
            • <FirstName>string</FirstName>
            • <LastName>string</LastName>
            • <Address1>string</Address1>
            • <Address2>string</Address2>
            • <City>string</City>
            • <State>string</State>
            • <Zip>string</Zip>
            • <Country>string</Country>
          • </Customer>
          • <Notification>string</Notification>
        • </Order>
      • </CreateOrder>
    • </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
StoreName String Desired Store Name to be displayed on customer registration
StoreId Int Store Id, leave as 0 if unknown
OrderPO String Customer's PO #
Items.ItemsRequestType CreateOrderItemsRequestType (repeatable)
Items.CreateOrderItemsRequestType.PurchaseDate String Item's purchase date
Items.CreateOrderItemsRequestType.Manufacturer String Manufacturer of product to be covered
Items.CreateOrderItemsRequestType.Model String Model of product to be covered
Items.CreateOrderItemsRequestType.Serial String Product's serial #
Items.CreateOrderItemsRequestType.Price double Purchase price of product to be covered
Items.CreateOrderItemsRequestType.WarrantySKU String VALID CPS SKU
Customer CustomerType
Customer.Company String
Customer.Email String
Customer.Phone String Phone Number - Only numerical values; no dashes or spaces
Customer.FirstName String
Customer.LastName String
Customer.Address1 String
Customer.Address2 String
Customer.City String
Customer.State String
Customer.Zip String
Customer.Country String Two-letter ISO 3166 country code.

For a complete list, click here
Notification String "None" or "Letter" or "Email".
Defaults to Email if no argument provided.

CreateOrder 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>
      • <CreateOrderResponse xmlns="http://www.consumerpriorityservice.com/services/">
        • <CreateOrderResult>
          • <Customer>
            • <CustomerID>int</CustomerID>
          • </Customer>
          • <Errors>
            • <ErrorsType>
              • <ErrorID>int</ErrorID>
              • <ErrorMessage>string</ErrorMessage>
            • </ErrorsType>
          • </Errors>
          • <Items>
            • <CreateOrderItemsResponseType>
              • <ProductId>int</ProductId>
              • <WarrantySKU>string</WarrantySKU>
              • <Price>double</Price>
              • <WarrantySerial>string</WarrantySerial>
              • <Description>string</Description>
              • <LinePrice>double</LinePrice>
              • <CoveragePartsYear>int</CoveragePartsYear>
              • <CoveragePartsMonth>int</CoveragePartsMonth>
              • <CoveragePartsDay>int</CoveragePartsDay>
              • <CoverageLaborYear>int</CoverageLaborYear>
              • <CoverageLaborMonth>int</CoverageLaborMonth>
              • <CoverageLaborDay>int</CoverageLaborDay>
              • <ForceDOP>boolean</ForceDOP>
            • </CreateOrderItemsResponseType>
          • </Items>
          • <Invoice>
            • <OrderId>int</OrderId>
            • <OrderPO>string</OrderPO>
            • <Total>double</Total>
            • <OrderTerms>int</OrderTerms>
            • <Fee_Service>double</Fee_Service>
            • <Fee_Shipping>double</Fee_Shipping>
            • <Subtotal>double</Subtotal>
            • <Items>
              • <CreateOrderInvoiceItemsResponseType>
                • <ProductId>int</ProductId>
                • <CategoryId>int</CategoryId>
                • <Quantity>int</Quantity>
                • <WarrantySKU>string</WarrantySKU>
                • <UnitPrice>double</UnitPrice>
                • <LinePrice>double</LinePrice>
                • <ForceDOP>boolean</ForceDOP>
              • </CreateOrderInvoiceItemsResponseType>
            • </Items>
          • </Invoice>
          • <Notification>string</Notification>
        • </CreateOrderResult>
      • </CreateOrderResponse>
    • </soap:Body>
  • </soap:Envelope>


Argument Type Details
Customer CustomerType
Customer.CustomerID Int Customer ID
Errors ErrorsType
Errors.ErrorID Int Error Number
Errors.ErrorMessage String Detailed error message
Items.CreateOrderItemsResponseType CreateOrderItemsResponseType (Repeatable)
Items.CreateOrderItemsResponseType.ProductId Int Product ID
Items.CreateOrderItemsResponseType.WarrantySKU String VALID CPS SKU
Items.CreateOrderItemsResponseType.Price double Unit price of warranty. Unit price is zeroed out for sub accounts!
Items.CreateOrderItemsResponseType.WarrantySerial String Serial number of warranty issued
Items.CreateOrderItemsResponseType.Description String Warranty description
Items.CreateOrderItemsResponseType.LinePrice double Warranty line price. Line price is zeroed out for sub accounts!
Items.CreateOrderItemsResponseType.CoveragePartsYear Int Years of warranty parts coverage
Items.CreateOrderItemsResponseType.CoveragePartsMonth Int Months of warranty parts coverage
Items.CreateOrderItemsResponseType.CoveragePartsDay Int Days of warranty parts coverage
Items.CreateOrderItemsResponseType.CoverageLaborYear Int Years of warranty labor coverage
Items.CreateOrderItemsResponseType.CoverageLaborMonth Int Months of warranty labor coverage
Items.CreateOrderItemsResponseType.CoverageLaborDay Int Days of warranty labor coverage
Items.CreateOrderItemsResponseType.ForceDOP boolean Date of purchase flag
Invoice InvoiceType Invoice is NOT returned for sub accounts!
Invoice.OrderId Int Order #
Invoice.OrderPO String Your PO
Invoice.Total double Order total
Invoice.Fee_Service double Order service fees
Invoice.Fee_Shipping double Order shipping fees
Invoice.Subtotal double Order subtotal
Invoice.Items.CreateOrderInvoiceItemsResponseType CreateOrderInvoiceItemsResponseType (repeatable)
Invoice.Items.CreateOrderInvoiceItemsResponseType.ProductId Int Product ID
Invoice.Items.CreateOrderInvoiceItemsResponseType.CategoryId Int Category ID
Invoice.Items.CreateOrderInvoiceItemsResponseType.Quantity Int Quantity ordered
Invoice.Items.CreateOrderInvoiceItemsResponseType.WarrantySKU String Warranty SKU
Invoice.Items.CreateOrderInvoiceItemsResponseType.UnitPrice double Warranty unit price
Invoice.Items.CreateOrderInvoiceItemsResponseType.LinePrice double Warranty line price
Invoice.Items.CreateOrderInvoiceItemsResponseType.ForceDOP boolean Date of purchase flag
Notification String "None" or "Letter" or "Email".
Defaults to Email if no argument provided.

Classic ASP Sample

const SoapServer = "https://www.consumerpriorityservice.com/services/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/CreateOrder"

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 & "<CreateOrder  xmlns=""http://www.consumerpriorityservice.com/services/"">"
StrSoap = StrSoap & "<Order>"
StrSoap = StrSoap & "<StoreName>Test Store</StoreName>"
StrSoap = StrSoap & "<StoreId>0</StoreId>"
StrSoap = StrSoap & "<OrderPO>TESTPO</OrderPO>"
StrSoap = StrSoap & "<Items>"
StrSoap = StrSoap & "<CreateOrderItemsRequestType>"
StrSoap = StrSoap & "<PurchaseDate>05/24/2010 15:50</PurchaseDate>"
StrSoap = StrSoap & "<Manufacturer>HP</Manufacturer>"
StrSoap = StrSoap & "<Model>LaserJet P2035n</Model>"
StrSoap = StrSoap & "<Price>224.99</Price>"
StrSoap = StrSoap & "<WarrantySKU>MLT3-250</WarrantySKU>"
StrSoap = StrSoap & "</CreateOrderItemsRequestType>"
StrSoap = StrSoap & "</Items>"
StrSoap = StrSoap & "<Customer>"
StrSoap = StrSoap & "<Company></Company>"
StrSoap = StrSoap & "<Email>email@cpscentral.com</Email>"
StrSoap = StrSoap & "<Phone>9175551212</Phone>"
StrSoap = StrSoap & "<FirstName>John</FirstName>"
StrSoap = StrSoap & "<LastName>Doe</LastName>"
StrSoap = StrSoap & "<Address1>3101 Emmons Avenue</Address1>"
StrSoap = StrSoap & "<Address2></Address2>"
StrSoap = StrSoap & "<City>Brooklyn</City>"
StrSoap = StrSoap & "<State>NY</State>"
StrSoap = StrSoap & "<Zip>11235</Zip>"
StrSoap = StrSoap & "<Country>US</Country>"
StrSoap = StrSoap & "</Customer>"
StrSoap = StrSoap & "<Notification>None or Letter or Email</Notification>"
StrSoap = StrSoap & "<Authentication>"
StrSoap = StrSoap & "<DealerId>DEALERID</DealerId>"
StrSoap = StrSoap & "<SubAccountId>SUBACCOUNTID</SubAccountId>"
StrSoap = StrSoap & "<ApiKey>APIKEY</ApiKey>"
StrSoap = StrSoap & "</Authentication>"
StrSoap = StrSoap & "</Order>"
StrSoap = StrSoap & "</CreateOrder>"
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/api.asmx

Dim cpsorder As New cpsapi.CreateOrderRequestType
cpsorder.Authentication = New cpsapi.AuthenticationType
cpsorder.Authentication.DealerId = DEALERID
cpsorder.Authentication.ApiKey = "DEALERKEY"
cpsorder.StoreName = "TEST STORE"
cpsorder.StoreId = 0
cpsorder.OrderPO = "PO"
cpsorder.Customer = New cpsapi.CreateOrderCustomerRequestType
cpsorder.Customer.Company = ""
cpsorder.Customer.FirstName = "John"
cpsorder.Customer.LastName = "Doe"
cpsorder.Customer.Address1 = "3101 Emmons Avenue"
cpsorder.Customer.Address2 = ""
cpsorder.Customer.City = "Brooklyn"
cpsorder.Customer.State = "NY"
cpsorder.Customer.Zip = "11235"
cpsorder.Customer.Country = "US"
cpsorder.Customer.Phone = "9175551212"
cpsorder.Customer.Email = "email@cpscentral.com"
cpsorder.Notification = "Email"

ReDim cpsorder.Items(0)
cpsorder.Items(0) = New cpsapi.CreateOrderItemsRequestType
cpsorder.Items(0).WarrantySKU = "CMP3-2000"
cpsorder.Items(0).Manufacturer = "Sony"
cpsorder.Items(0).Model = "Laptop"
cpsorder.Items(0).Serial = "SERIAL1"
cpsorder.Items(0).Price = 240

Dim m4 As New cpsapi.CpsServices

Dim response4 As cpsapi.CreateOrderResponseType
response4 = m4.CreateOrder(po4)
If response4.Errors Is Nothing Then
    Response.Write("SUCCESS PLACEORDER4")
    For i As Integer = 0 To response4.Items.GetUpperBound(0)
        Response.Write(response4.Items(i).WarrantySerial)
    Next
Else
    For i As Integer = 0 To response4.Errors.GetUpperBound(0)
        Response.Write("PLACEORDER4 ERROR: " & response4.Errors(i).ErrorMessage)
    Next
End If    
    

PHP Sample


<?php
    require_once('nusoap/lib/nusoap.php');
    $soapaction = "http://www.consumerpriorityservice.com/services/CreateOrder";
    $wsdl = "https://www.consumerpriorityservice.com/services/api.asmx";
    $namespace = "http://www.consumerpriorityservice.com/services/";
	
    $xml = '<CreateOrder xmlns="http://www.consumerpriorityservice.com/services/">
                    <Order>
                        <StoreName>Test Store</StoreName>
                        <StoreId>0</StoreId>
                        <OrderPO>TESTPO</OrderPO>
                        <Items>
                            <CreateOrderItemsRequestType>
                                <PurchaseDate>05/24/2010</PurchaseDate>
                                <Manufacturer>HP</Manufacturer>
                                <Model>LaserJet P2035n</Model>
                                <Price>224.99</Price>
                                <WarrantySKU>MLT3-250</WarrantySKU>
                            </CreateOrderItemsRequestType>
                        </Items>
                        <Customer>
                            <Company></Company>
                            <Email>email@cpscentral.com</Email>
                            <Phone>9175551212</Phone>
                            <FirstName>John</FirstName>
                            <LastName>Doe</LastName>
                            <Address1>3101 Emmons Avenue</Address1>
                            <Address2></Address2>
                            <City>Brooklyn</City>
                            <State>NY</State>
                            <Zip>11235</Zip>
                            <Country>US</Country>
                        </Customer>
                        <Notification>None or Letter or Email</Notification>
                        <Authentication>
                            <DealerId>DEALERID</DealerId>
                            <SubAccountId>SUBACCOUNTID</SubAccountId>
                            <ApiKey>APIKEY</ApiKey>
                        </Authentication>
                    </Order>
                </CreateOrder>';

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