vmunich Posted June 29, 2013 Share Posted June 29, 2013 I need some help to think. I got WHMCS API and Mailgun API. My server uses Mailgun to send out emails. I want to bill my customers based on the amount of emails they've sent. With Mailgun's API I can get the amount of emails my customers sent, but how would I make WHMCS get this information and bill them? Any help will be appreciated. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted June 29, 2013 Share Posted June 29, 2013 You could write a script that pulls from the mailgun api and then bill the customer by adding a billable item via whmcs api. http://docs.whmcs.com/API:Add_Billable_Item You could also use the api to create an invoice with the charge as a line item http://docs.whmcs.com/API:Create_Invoice 0 Quote Link to comment Share on other sites More sharing options...
vmunich Posted June 29, 2013 Author Share Posted June 29, 2013 (edited) Thank you jclarke, that gave me a place to start. I would make this script as a cron job then? So let's suppose, at the end of every month, the script would run and add the billable item + generate an invoice. Am I correct? Thanks. Edited June 29, 2013 by vmunich 0 Quote Link to comment Share on other sites More sharing options...
DavidBee Posted June 30, 2013 Share Posted June 30, 2013 I would maybe update clients every day on how many emails they have sent. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted June 30, 2013 Share Posted June 30, 2013 Yes, I would set it up as a cron to run one a month and generate the invoice. 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.