Jump to content

API:Add Order


erikk

Recommended Posts

Hi,

 

Currently i'm working on a standalone customerpanel based on the API of WHMCS for this i've created some things standard WHMCS doesn't offer.

When creating a new order i've got a few config options to pass to WHMCS in order to get the correct information about that order.

 

When viewing code, i'm building it in CodeIgniter

 

Posting fields:

$postfields = array();
$postfields["responsetype"] = "json";
$postfields["action"]       = "addOrder";
$postfields["clientid"]     = (int)$this->client_id;
$postfields["pid"]          = (int)$this->input->get("pid");
$postfields["billincycle"]  = "monthly";
$postfields["noemail"]      = TRUE;
$postfields["noinvoice"]    = TRUE;
$postfields["clientip"]     = $_SERVER["REMOTE_ADDR"];
$postfields["configoptions"]= base64_encode(
serialize(
	array(
		$this->input->post("configoption[1]")	=> 1,
		$this->input->post("configoption[2]")	=> 1,
		$this->input->post("configoption[3]")	=> 1,
	)
)
);
$postfields["hostname"]     = $this->input->post("hostname");
$postfields["ns1prefix"]    = $this->input->post("ns1");
$postfields["ns2prefix"]    = $this->input->post("ns2");
$postfields["rootpw"]       = $this->input->post("rootpasswd");
$postfields["paymentmethod"]= "banktransfer";

 

The only problem sending this order is that the config options is not being set through the API, WHMCS support already told me the array should look like:

array( x => 999 ) where X is the config option value ID and 999 stands for quantity, but when sending this WHMCS will set all set items to standard values.

 

Is this in someway still wrong, do I miss something in here, kinda stuck at this point with a unclear documentation from WHMCS.

Link to comment
Share on other sites

  • 3 years later...

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