AddOrder problem in local WHMCS API
I am adding a new order using the local WHMCS API. Everything works fine except for custom fields.
$command = 'AddOrder';
$postData = array(
'clientid' => $client_id,
'pid' => array($product_id),
'billingcycle' => array('monthly'),
'customfields' => array(base64_encode(serialize(array(1 => $site_id)))),
'paymentmethod' => 'stripe',
);
return localAPI($command, $postData);
My custom field id is 53, but I set the key to 1 due to the tutorials. Also I tried 53 as a key array(base64_encode(serialize(array(53 => $site_id))))
, but nothing changed.
Do you have any suggestions?
+3
source to share
1 answer
Try the following:
$command = 'AddOrder';
$postData = array(
'clientid' => $client_id,
'pid' => array($product_id),
'billingcycle' => array('monthly'),
'customfields[0]' => array(base64_encode(serialize(array(1 => $site_id)))),//changes here
'paymentmethod' => 'stripe',
);
return localAPI($command, $postData);ode here
0
source to share