Jump to content
  • 0
shaneharris

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

Question

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)?

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×