Jump to content

Adding Service To Client Does Not Generate Invoice


sharktek

Recommended Posts

Using the API, I am trying to dynamically add a service as active and create an invoice.

The service should be renewable and invoice recurring as a result.

//Add service to client

$data = array(
    'vars' => array(
        'package_group_id' => "8",
        'pricing_id' => "6",
        'client_id' => "31",
	'module_row_id' => "5",
	'status' => "active"
    )
);

$response = $api->post("services", "add", $data);

When I log into the admin portal, the service is there yet no invoice is generated.

 

As such, I attempted to generate an invoice using 

Add Invoice from Service
$data = array(
        'client_id' => 31,
		'service_ids' => array('service_ids' => 6),
        'currency' => "USD",
        'due_date' => "2014-09-13 10:54:30",
);


//Create Invoice for service
$response = $api->post("invoices", "createFromServices", $data);

The invoice then appears, yet I do not know if this will automatically create an invoice after every renewal period as it was not generated on its own before calling this function.

 

Please advise

Link to comment
Share on other sites

You do not need to create an initial invoice for the service, as you can append it to an existing invoice, or choose not to generate one at all.

 

Invoice generation for service renewal is handled by the cron and related cron tasks. By default, yes, the Create Invoices cron task will generate invoices from services that are renewing. Whether a service is set to renew depends on the associated package and its term/period settings.

Link to comment
Share on other sites

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.

Loading...
×
×
  • Create New...