Jump to content

Local API Priceoverride


dotnetrix

Recommended Posts

Hi all,

 

I am using the Local API to add a new order, for domain renewal at a different price.

 

The information I am using is coming from https://developers.whmcs.com/api-reference/addorder/

 

The order gets added to the cart, it generates an invoice etc.

 

BUT, the "domainrenewoverride" parameter is not working, so the renewal price is not getting updated.

 

	$command = 'AddOrder';
$adminUsername = 'Admin';

$postData["clientid"] = $uid;
$postData["paymentmethod"] = 'offlinecc';

$postData["domainrenewals"] = array();

foreach ($_POST['renewthesedomains'] as $key => $value) {

   		$postData["domainrenewals"][$value]  = "1";
}

$postData["domainrenewoverride"] = 285.00;

var_dump ($postData);

$results = localAPI($command, $postData, $adminUsername);
print_r($results);

 

The var_dump shows:

 

array(4) { ["clientid"]=> int(1) ["paymentmethod"]=> string(12) "offlinecc" ["domainrenewals"]=> array(2) { ["domain1.com"]=> string(1) "1" ["domain2.com"]=> string(1) "1" } ["domainrenewoverride"]=> array(1) { [0]=> float(285) } }

 

But the actual renewal price for the domains do not get adjusted to 285.00

 

Any ideas would be appreciated.

Link to comment
Share on other sites

can you add an order for a domain renewal.... for a new registration or transfer, yes - but a renewal?

 

my reading of that documentation is that it's to be used to register/transfer a domain and domainrenewoverride can optionally be used to set the renewal price (e.g the recurring price) to be used when the domain is due for renewal in the future. :?:

Link to comment
Share on other sites

Indeed the code worked and I place successful orders for the renewals. As you know from my previous posts I am trying to solve a Closed Redemption issue and proceeded to write a Addon Module which lists expired domains for clients, more than 45 day ago. I can successfully place a domain renewal order for selected domains from a addon module page. Only issue now is is using the "domainrenewoverride" parameter to change the price for each domain to 285.00 float.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated