Jump to content

Trigger Invoice Generation via an API call


Recommended Posts

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

Link to comment
Share on other sites

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;
}

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