Sign in to participate
Be Kind, Be Helpful
Ask a question, answer a question, and get to know the fine people in the Harvest community.
Announcement: Harvest generates numbers when creating an invoice in API
Today we have added a feature to the invoices API. When creating a new invoice with no number attribute passed to it, Harvest will auto-generate a unique number for you.
Related: Invoice API documentation
Please let us know if you have any questions about this new feature. Thanks!
Barry,
That’s great and I like the new styling of the API Documentation area — it’s very clean.
Question: How is the unique number auto-generated? I’d love to have the ability to set a naming convention for each project. I have multiple projects and I use a naming convention for each project so that I can easily find them (since there is no way to search for invoices by project that I know of).
In Harvest, our invoices are on a client-by-client basis. While you can limit invoices to project-per-invoice, it’s more of a manual process.
Point being, the invoice number generation will first look for the most recent invoice for the same client and increment the number from there. Then it will look for the most recent invoice on the entire account. Unfortunately it does not attempt to look for the most recent invoice for a single project.
Hope that helps!
Thanks for the info, Barry. Will this scheme support incrementing invoice “numbers” that include non-numeric prefixes? For example, we will often create invoices that have a customer name prefix like “IBM-001”, “AMD-005”, “MSFT-013” etc. What I’d like is for the auto-incrementing algorithm to be able to find the trailing numbers and then increment that number. For example, if my last invoice is “MSFT-013”, then I’d like the next one to be “MSFT-014”.
Oh, also, will this feature in the API be trickling up to the Harvest Web User Interface? Meaning, if I create an invoice via the web, will it allow me to choose auto-numbering for the name?
Thanks,
Yes, our number generation logic should handle any invoice number that ends in numerics.
As of last week, the web UI also uses this logic to generate the default number given when you go to create a new invoice. You can change this number if you’d like. We don’t plan to offer an auto-numbering-only option for invoices, but in a practical sense the web UI should work that way today.
Barry: Sweet! I just tested it (in the web UI) and it works beautifully — it preserves zero padding and even handles a few corner cases I just tested. I was a little worried, at first, because I implemented similar invoice auto-incrementing code myself and know there are a few tricky corner cases :)
But, I’m not sure I can use this feature for invoicing clients where we have several projects, because…
We currently use a different invoice prefix for each project. For example
- MSFT-PROJA-002 (Project A)
- MSFT-PROJB-006 (Project B)
The prefix is how we tell, from a glance, which project an invoice is for (since our invoices are always for one and only one project, since we use a separate project for each purchase orders, since we need to be able to know how much funds are on each purchase order, but I digress…).
However, if I had an easy way to Report on Invoices by Project I could use the same invoice naming prefix for each project, and take full advantage of this great new feature :)
The Harvest forums seem to be not parsing links correctly, lately (it’s interpreting my quotes, for the link, as “fancy/curly quotes”). Here’s the link that got garbled in my last post:
Report on Invoices by Project
http://forum.getharvest.com/forums/feature-requ…
Sorry about that forum issue, Jim. We’ll try to get that fixed up. Meanwhile I edited your post so the link is as you intended.
Thanks for all the feedback!