Jump to content

API date search?


U32Frank

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

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

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.

Link to comment
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?

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

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!

Link to comment
Share on other sites

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
Link to comment
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,

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated