Jump to content
U32Frank

API date search?

Recommended Posts

Hello everyone,

Let me first start by saying, I am quite new to working with API requests so if this is something obvious please forgive me.

I am trying to create an API call that returns all the invoices between specific dates. So far I can return all invoices, but I don't know how to add the date restriction. 

Thanks in advance

 

Frank

Share this post


Link to post
Share on other sites

Hello,

I am afraid that there isn't an API that does exactly this. GetInvoices will get a list of invoices that meet the criteria sent to it, but that doesn't currently include date ranges: https://developers.whmcs.com/api-reference/getinvoices/

I can see how this could be useful and recommend submitting a feature request at https://requests.whmcs.com/ to get this considered for inclusion in a future release.

Share this post


Link to post
Share on other sites

Great thanks. I bet we have well over a million invoices in our WHMCS, it would be pretty restrictive If we have to return them all every time.

We have an enterprise contract with you guys, not to sound ungrateful, or impatient but if we requested this feature as a ticket would it help to get it done any quicker?

Share this post


Link to post
Share on other sites

All feature requests are handled through the provided system and have a number of potential factors that determine their priority and when they may be implemented. I am afraid that submitting a ticket wouldn't change that, however we may be able to discuss a potential solution for your particular case. Please feel free to open a ticket and we can go from there. Thanks!

Share this post


Link to post
Share on other sites
Posted (edited)
1 hour ago, U32Frank said:

would it help to get it done any quicker?

I don't know what kind of structure you're dealing therefore don't bite me if my question sounds stupid 😀

Why don't you simply query the database to select all invoices between a specific date range? It's 10 times more flexible than dealing with an API call. Alternatively you can create a custom report to export the invoices on CSV based on your criteria.

Edited by Kian

Share this post


Link to post
Share on other sites

I don't have access to the database is the quick answer, however, i could get it I guess.  How does WHCMS feel about you jumping in the DB?  In my experience application vendors don't really want you accessing the DB, especially when there is an API.

The report has is made of data from multiple systems, not just WHMCS,

Share this post


Link to post
Share on other sites

There's nothing wrong in reading contents from a database. You can't break anything by selecting records from tables since you're just reading. Things change if you perform update/delete queries randomly but this is not your case. For extra safety you could create a MySQL user just with SELECT privilege and use it to run your queries.

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines