sharktek Posted December 5, 2014 Report Posted December 5, 2014 Hello, Using the API, I am creating a service then generating an invoice for that service using: createFromServices( integer $client_id, array $service_ids, string $currency, string $due_date, boolean $allow_pro_rata = true, boolean $services_renew = false ) We generate this invoice because the initial service created is marked as "pending" and we don't want the service activated until successful payment. Our issue, however, is that when we generate this invoice (createFromServices) there is no option to disable delivery of the invoice via email. We are only able to do this by disabling delivery of unpaid invoices as a system-wide setting. Do you have any suggestions as to how we can generate this invoice from service without delivering it via email? Quote
Tyson Posted December 5, 2014 Report Posted December 5, 2014 The invoice isn't delivered after it's created, rather it is queued for delivery and later delivered when the cron runs. While you can't stop the invoice from being queued for delivery, you can instead remove it from the queue. After the invoice is created, you can fetch each of the delivery methods that were created from Invoices::getDelivery, and then delete each one via Invoices::deleteDelivery. Quote
sharktek Posted December 15, 2014 Author Report Posted December 15, 2014 Thanks Tyson, This seems like a temporary fix to my problem. Is there any way to disable sending invoices based on a service id all together, but not system wide. Quote
Tyson Posted December 15, 2014 Report Posted December 15, 2014 Is there any way to disable sending invoices based on a service id all together, but not system wide. Not from Invoices::createFromServices. Delivery options are based on invoices, so there isn't a method by which to remove an option by service ID besides what I already mentioned above. The other way to go about it is to create the invoice from Invoices::add, but you would need to manually create your own line items. 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.