mmagpayo Posted June 15, 2008 Share Posted June 15, 2008 Hello, 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); curl_close($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! 0 Quote Link to comment Share on other sites More sharing options...
jim0406 Posted April 22, 2009 Share Posted April 22, 2009 I have the same problem. Any help? 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.