Jump to content
  • 0

API Question: Services->add then Invoices->createFromServices - how to bill for the current month, not next month


Question

Posted

I add a service to a client account for today's date and when i run Invoices->createFromServices it will show on the invoice lines <ITEM_NAME> (Jan 05, 2018 - Feb 05, 2018). How can i generate the very first bill when adding a service via the API i.e (Dec 05, 2017 - Jan 05, 2018)?

5 answers to this question

Recommended Posts

  • 0
Posted

I would actually expect that to be the default behavior.  Are you for any reason submitting true for the $services_renew parameter?  That would explain the behavior you're seeing.

  • 0
Posted

Hi Jono, the $services_renew parameter is set to false, although i had tried it as true. Im wondering do i need to explicitly set the date_renews or the date_last_renewed when adding the service? Am i following the typical workflow for this? should the $packages parameter contain anything if i'm not using coupons? is it something to do with the due_date? does it need to be set to before the service creation or something?

  • 0
Posted

Hmm, I just tried Services::add(['pricing_id' => 595, 'client_id' => 1]) then Invoices::createFromServices(1, [549], 'USD', date('c')).  The invoice created had the line with (Dec 05, 2017 - Jan 05, 2018).   Can I get more invoice on the parameters you are passing?

  • 0
Posted

Hi Jono, 

I have tried your basic example and indeed it does work as expected which means it must be something im doing. Ill keep investigating and post a solution here when i find it.

Thanks!

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...