CreateCYAOrder 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>
<CreateCYAOrder xmlns="http://www.cpscorporation.com/services/">
<CreateCYAOrderRequestType>
<Authentication>
<DealerID>Int</DealerID>
<DealerKey>String</DealerKey>
</Authentication>
<isYearly>Boolean</isYearly>
<CouponCode>String</CouponCode>
<CustomerType>
<Fname>String</Fname>
<Lname>String</Lname>
<Address1>String</Address1>
<Address2>String</Address2>
<City>String</City>
<State>String</State>
<Zip>String</Zip>
<Country>String</Country>
<Email>String</Email>
<Phone>String</Phone>
</CustomerType>
<CreateCYAOrderItemRequestType>
<ModelId>Int</ModelId>
<index>Int</index>
<PurchaseDate>Date</PurchaseDate>
<Manufacturer>String</Manufacturer>
<Model>String</Model>
<Serial>String</Serial>
<ItemRetailPrice>Decimal</ItemRetailPrice>
</CreateCYAOrderItemRequestType>
<CreditCard>String</CreditCard>
<CC_ExpireDate>Date</CC_ExpireDate>
<CVV>String</CVV>
</CreateCYAOrderRequestType>
</CreateCYAOrder>
</soap:Body>
</soap:Envelope>
Argument |
Required |
Type |
Details |
Authentication |
yes |
AuthenticationType |
|
Authentication.DealerID |
yes |
Int |
Your dealer number |
Authentication.DealerKey |
yes |
String |
Your dealer key |
CouponCode |
no |
String |
Coupon Code |
isYearly |
yes |
Boolean |
Is plan Yearly or Monthly (default is False) |
Customer |
yes |
CustomerType |
|
Customer.Fname |
yes |
String |
Customer First Name, Max 50 Char. |
Customer.Lname |
yes |
String |
Customer Last Name, Max 50 Char. |
Customer.Address1 |
yes |
String |
Customer Address1, Max 50 Char. |
Customer.Address2 |
no |
String |
Customer Address2, Max 50 Char. |
Customer.City |
yes |
String |
Customer City, Max 50 Char. |
Customer.State |
yes |
String |
Customer State, Expected 2 Char - Max 50 Char |
Customer.Zip |
yes |
String |
Customer Zip, Max 50 Char. |
Customer.Country |
yes |
String |
Two-letter ISO 3166 country code.
For a complete list, click here |
Customer.Email |
yes |
String |
Customer Email, Max 50 Char. |
Customer.Phone |
no |
String |
Customer Email, Max 50 Char. |
Items |
yes |
CreateCYAOrderItemRequestType |
|
Items.ModelId |
yes |
Int |
Model ID |
Items.index |
yes |
Int |
Order Item index |
Items.PurchaseDate |
no |
Date |
Item Purchase Date, if Empty, default is Buy Warranty Date |
Items.Manufacturer |
yes |
String |
Item Manufacturer |
Items.Model |
yes |
String |
Item Model |
Items.Serial |
yes |
String |
Item Serial Number |
Items.ItemRetailPrice |
yes |
Decimal |
Item Retail Price |
CreditCard |
yes |
String |
CreditCard |
CVV |
yes |
String |
Credit Card CVV |
CC_ExpireDate |
yes |
Date |
Credit Card Expire Date |
CreateCYAOrder 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>
<CreateCYAOrder xmlns="http://www.cpscorporation.com/services/">
<CreateCYAOrderResponseType>
<Errors>
<ErrorID>int</ErrorID>
<ErrorMessage>string</ErrorMessage>
</Errors>
<warrantySerial>String</warrantySerial>
<Ack>String</Ack>
<SubTotal>decimal</SubTotal>
<TotalTax>decimal</TotalTax>
<TotalYearlyDiscount>decimal</TotalYearlyDiscount>
<TotalDiscount>decimal</TotalDiscount>
<Total>decimal</Total>
<CouponType>
<ID>int</ID>
<CouponType>int</CouponType>
<Amount>decimal</Amount>
<ExpireDate>Date</ExpireDate>
<CouponCode>string</CouponCode>
</CouponType>
<CreateCYAOrderItemReponseType>
<ModelId>int</ModelId>
<Index>int</Index>
<PlaceOrderIndex>int</PlaceOrderIndex>
<Deductible>Decimal</Deductible>
<RegItemPrice>decimal</RegItemPrice>
<Price>decimal</Price>
<Tax>decimal</Tax>
<Coupon>decimal</Coupon>
<YearlyDiscount>decimal</YearlyDiscount>
<SubTotal>decimal</SubTotal>
<status>string</status>
<Manufacturer>string</Manufacturer>
<Model>string</Model>
<Serial>string</Serial>
<ItemRetailPrice>decimal</ItemRetailPrice>
<StartPayDate>Date</StartPayDate>
</CreateCYAOrderItemReponseType>
</CreateCYAOrderResponseType>
</CreateCYAOrder>
</soap:Body>
</soap:Envelope>
Argument |
Type |
Details |
Errors |
ErrorsType |
|
Errors.ErrorID |
Int |
Error Number |
Errors.ErrorMessage |
String |
Detailed error message |
warrantySerial |
string |
Warranty Serial Number, if success Process
|
Ack |
string |
return success or error
|
CouponResponse |
CouponType |
|
CouponResponse.ID |
Int |
Coupon ID |
CouponResponse.CouponType |
int |
Coupon Type |
CouponResponse.Amount |
Decimal |
Coupon Amount |
CouponResponse.ExpireDate |
Date |
Coupon Valid Date |
CouponResponse.CouponCode |
String |
Coupon Code |
Items |
CreateCYAOrderItemReponseType |
|
Items.ModelId |
Int |
Model ID |
Items.Index |
Int |
Request Index Order |
Items.TransactionID |
Int |
If a line Transaction success, return a Transaction ID, else 0 |
Items.PlaceOrderIndex |
Int |
If a line Transaction success, return a Transaction place Order Index, else 0 |
Items.Deductible |
Decimal |
Deductible |
Items.RegItemPrice |
Decimal |
Item Warranty Regular Price |
Items.Price |
Decimal |
Item Warranty Price |
Items.Tax |
Decimal |
Item Warranty Tax |
Items.Coupon |
Decimal |
Item Warranty Coupon Amount |
Items.YearlyDiscount |
Decimal |
Item Warranty Yearly Discount Amount |
Items.SubTotal |
Decimal |
Item SubTotal |
Items.status |
Decimal |
Line Item status, (success or error) |
Items.Manufacturer |
string |
Item Manufacture |
Items.Serial |
string |
Item Serial |
Items.Model |
string |
Item Model |
Items.ItemRetailPrice |
Decimal |
Item Retail Price |
Items.StartPayDate |
Date |
Pay Start Date |
SubTotal |
Decimal |
Order SubTotal
|
TotalTax |
Decimal |
Order Total Tax
|
TotalDiscount |
Decimal |
Total Coupon Discount
|
Total |
Decimal |
Order Total Amount
|
C#.NET Sample
Create a Web Reference named "cpsapi" with URL https://www.consumerpriorityservice.com/services/cya_api.asmx
cya_api api = new cya_api();
CreateCYAOrderRequestType request = new CreateCYAOrderRequestType();
request.Authentication = new ApiAuthenticationType() { ApiKey = "Your Key", DealerId = YourID, SubAccountId = 0 };
request.CC_ExpireDate = CARD EXPIRE DATE;
request.CVV = "CARD CVV CODE";
request.CreditCard = "CREDIT CARD NUMBER";
request.CouponCode = string.Empty;
request.Customer = new CustomerType() { Address1 = "20 main St", Address2 = "", City = "New York", State = "NY", Country = "US", Email = "Your Email", Fname = "FIRSTNAME", Lname = "LASTNAME", Phone = "9999999999", Zip = "10002" };
request.isYearly = false;
List<CreateCYAOrderItemRequestType> items = new List<CreateCYAOrderItemRequestType>();
items.Add(new CreateCYAOrderItemRequestType() { index = 1, ItemRetailPrice = Convert.ToDecimal(199.25), Manufacturer = "", Model = "", ModelId = 432901, PurchaseDate = Convert.ToDateTime("2/1/2019"), Serial = "", FriendName ="A" });
items.Add(new CreateCYAOrderItemRequestType() { index = 2, ItemRetailPrice = Convert.ToDecimal(125.25), Manufacturer = "", Model = "", ModelId = 432904, PurchaseDate = Convert.ToDateTime("2/1/2019"), Serial = "", FriendName = "B" });
items.Add(new CreateCYAOrderItemRequestType() { index = 3, ItemRetailPrice = Convert.ToDecimal(145.62), Manufacturer = "", Model = "", ModelId = 326683, PurchaseDate = Convert.ToDateTime("2/1/2019"), Serial = "", FriendName = "C" });
items.Add(new CreateCYAOrderItemRequestType() { index = 4, ItemRetailPrice = Convert.ToDecimal(125.25), Manufacturer = "", Model = "", ModelId = 216994, PurchaseDate = Convert.ToDateTime("2/1/2019"), Serial = "", FriendName = "D" });
request.Items = items.ToArray();
CreateCYAOrderResponseType response = api.CreateCYAOrder(request);