AllToolKits.com Posted August 26, 2014 Report Posted August 26, 2014 Hi,When i try to create a new invoice using,$response = $api->post("invoices", "add", $vars);it always shows error like,Internal error: Failed to retrieve the default valuestdClass Object ( [error] => stdClass Object ( [message] => An unexpected error occured. [response] => Internal error: Failed to retrieve the default value ) ) even if i hard code all the values same error comes Same problem comes in Add Acount Section also Below is the var array i used. $vars = array( 'client_id' => 1, 'date_billed' => date('2014-08-16 11:04:03'), 'date_due' => date('2014-08-120 11:04:03'), 'currency' => "USDD", 'lines' => array( array( 'description' => "Line item #1", 'amount' => "5.99" ), array( 'description' => "Line item #2", 'amount' => "3.75", 'qty' => 2 ) ), 'delivery' => array("email") ); Quote
Tyson Posted August 26, 2014 Report Posted August 26, 2014 Usually an internal error regarding a missing default value means that a required parameter is missing, i.e. the system is not receiving a 'vars' parameter. The solution would be to make sure each parameter is set: $data = array( 'vars' => array( 'client_id' => 1, ... ) ); $api->post("invoices", "add", $data); Quote
AllToolKits.com Posted August 27, 2014 Author Report Posted August 27, 2014 Tyson, Thanks a lot for the reply. your reply helped us to fix the issue. I have another issue now, When i try to create a New Package Group using the code, $data=array("vars"=>array( "company_id" => 1,"name" => $_POST['names'], "type" => $_POST['type']));$addgroup = $api->post("package_groups", "add", $data);it returns below error.stdClass Object ( [name] => stdClass Object ( [empty] => Please specify a package group name. ) ) Do you know why i am getting that error? Quote
AllToolKits.com Posted August 27, 2014 Author Report Posted August 27, 2014 Tyson, Thanks a lot for the reply. your reply helped us to fix the issue. I have another issue now, When i try to create a New Package Group using the code, $data=array("vars"=>array( "company_id" => 1,"name" => $_POST['names'], "type" => $_POST['type']));$addgroup = $api->post("package_groups", "add", $data);it returns below error.stdClass Object ( [name] => stdClass Object ( [empty] => Please specify a package group name. ) ) Do you know why i am getting that error? Quote
Tyson Posted August 27, 2014 Report Posted August 27, 2014 Sounds like $_POST['names'] is actually blank. What is the value? I notice the key is plural, perhaps your form is using "name" rather than "names"? Quote
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.