U32Frank Posted July 11, 2018 Share Posted July 11, 2018 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 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst II WHMCS Lawrence Posted July 11, 2018 WHMCS Technical Analyst II Share Posted July 11, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
U32Frank Posted July 11, 2018 Author Share Posted July 11, 2018 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? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst II WHMCS Lawrence Posted July 11, 2018 WHMCS Technical Analyst II Share Posted July 11, 2018 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! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 11, 2018 Share Posted July 11, 2018 (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 July 11, 2018 by Kian 0 Quote Link to comment Share on other sites More sharing options...
U32Frank Posted July 12, 2018 Author Share Posted July 12, 2018 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, 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 12, 2018 Share Posted July 12, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.