z900collector Posted June 21, 2017 Share Posted June 21, 2017 I have a unique requirement, some of our clients don't want to login and select "renew domain" etc, and they don't want to have auto renew enabled for their domains, but if we send an email requesting then to either click a link and renew (or click another link not to renew) they will do that and the we send them an invoice to pay. I've already built the email renewal request hook and all the associated logic which works well.... but..... I need a way to trigger invoice generation and sending as if they had logged in and pressed the "renew my domain" button. Is this possible via the API? Sid 0 Quote Link to comment Share on other sites More sharing options...
z900collector Posted June 22, 2017 Author Share Posted June 22, 2017 After much experimentation this has been solved using an AddOrder call: function add_order($clientId, $domainName, $paymentMethod,$regPeriod) { $command = 'AddOrder'; $postData = array( 'clientid' =>$clientId, 'domain[0]' =>$domainName, 'paymentmethod'=>$paymentMethod, 'domainrenewals'=>array($domainName=>$regPeriod) ); $results = localAPI($command, $postData); return $results; } 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 22, 2017 Share Posted June 22, 2017 well done for solving yourself and posting the solution - these forums would be a better resource if more posters shared their code! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.