Upgrade Product Print

  • 0

upgradeproduct

Purpose

This command allows you to calculate the cost for an upgrade or downgrade of a product/service, and create an order for it.

Attributes

  • serviceid - the service ID to be upgraded
  • type - either "product" or "configoptions"
  • newproductid - if upgrade type = product, the new product ID to upgrade to
  • newproductbillingcycle - monthly, quarterly, etc...
  • configoptions - if upgrade type = configoptions, an array of config options

Optional Attributes

  • promocode - associate a promotion code with the upgrade
  • calconly - set true to just validate upgrade and get price, false to actually create order
  • ordernotes - any notes to add to the order

Example Command

$postfields = array();
$postfields["responsetype"] = "json";

$postfields["action"] = "upgradeproduct";
$postfields["serviceid"] = "1";
$postfields["type"] = "product";
$postfields["newproductid"] = "2";

$result = mikrovps_SendCommand( $postfields );

Successful Response

oldproductid = the existing product ID
oldproductname = the existing product name
newproductid = the product ID being upgraded to
newproductname = the name of the product being upgraded to
daysuntilrenewal = days until next due date of the product
totaldays = totals days in the current cycle
newproductbillingcycle = the new billing cycle being upgraded to
price = the amount due to upgrade
orderid = the order ID
order_number = the order number
invoiceid = the invoice ID for the order

Error Response

result=error
message=Service ID not found
Given service ID is not found in the database.

Was this answer helpful?

« Back