Jump to content

Adding Service To Client Does Not Generate Invoice


Recommended Posts

Posted

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

Posted

BUMP---

 

My question is -- if I dynamically create a client, add a service to that client, and generate an invoice for that service-- will it continue to generate an invoice when the service is up for renewal?

Posted

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.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...