Pergunta

I need some help to think. I got cPanel API, WHMCS API and Mailgun API.

My cPanel 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?

I just need a starting point. Each of my customers will have a mailgun account that will be the same account name as their cpanel account.

Foi útil?

Solução

A little late I know...

I use the WHMCS API to insert a Billable Item for each quantity based charge that I need to invoice to a client.

Eg: A client sends 1447 SMS's during the month. On the 1st of the next month, a cron job makes a call to the SMS server, retrieves the number of SMS's sent during the previous month, then adds a Billable Item in WHMCS for the client.

The reason I use Billable Items is that it can be set to be added to the next invoice for the client. Doing it this ways allows me to invoice in advance for the flat monthly fee, and in-arrears for usage on the same invoice.

More information on WHMCS API:Add Billable Item is here http://docs.whmcs.com/API:Add_Billable_Item and overall info on the WHMCS API is here http://docs.whmcs.com/API:About .

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top