sharktek Posted August 13, 2014 Report Posted August 13, 2014 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 Quote
sharktek Posted August 13, 2014 Author Report Posted August 13, 2014 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? Quote
Tyson Posted August 13, 2014 Report Posted August 13, 2014 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. sharktek 1 Quote
sharktek Posted August 13, 2014 Author Report Posted August 13, 2014 Thank you so much Tyson, I really appreciate the info. 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.