Jump to content

Recommended Posts

Posted

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?

Posted

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.

  • 2 weeks later...
Posted

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.

Posted

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.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...