Jump to content

3.6.1 API Bug - AddOrder


Recommended Posts



I seem to have encountered an issue with the AddOrder command when using the API. After creating a client, I try to use the function to add an order with a product, but for some reason the product is never added and a blank order is created. Consequently, no invoice is generated.


The code I am using below:

$postfields["action"] = "addorder";
$postfields["clientid"] = "56";
$postfields["pid"] = "1";
$postfields["domain"] = "mytestdomain.com";
$postfields["billingcycle"] = "monthly";
$postfields["paymentmethod"] = "authorize";
$postfields["username"] = $whmcsuser;
$postfields["password"] = md5($whmcspass);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);


When I do a var_dump, I get the following:


result=success;orderid=[new order id];invoiceid=


I tried changing the postfiel name to 'product' and 'productid' and neither worked.


Please advice, and thanks in advance!

Link to comment
Share on other sites

  • 10 months later...

Join the conversation

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

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