SeanP Posted May 20, 2021 Share Posted May 20, 2021 So, we have a client that has a lot of services will all different due dates. They requested a way to minimize the number of credit transactions each month, and we recommended the "Add Funds" feature. So, they have added a bunch of credit to their account to be used for their reoccurring invoices. The problem is, they want the credit to be applied to the invoice when the invoice is due, not when it is created. I have disabled the "Automatic Credit Use" option, as that only works to apply the credit when the invoice is generated. Is there a way (with a hook or cron script) to pay invoices with credit on their due date, if the client has credit in their account? I assume this was how WHMCS worked by default. 0 Quote Link to comment Share on other sites More sharing options...
SeanP Posted May 20, 2021 Author Share Posted May 20, 2021 I see the "Apply Credit" API call (https://developers.whmcs.com/api-reference/applycredit). Maybe a script running as a cron job that applies credit to invoices on the day they are due? At this time, I only need it for one client. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted May 21, 2021 Share Posted May 21, 2021 Using the DailyCronJob hook would do the trick but you would need to go through all accounts, or the accounts you want, and check their available credit and then apply credit via that API call for the invoice to be paid in full. 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.