miguelacabtrera Posted January 21, 2018 Share Posted January 21, 2018 Hi good dayIn my system, add a Hook that is executed when you mark an invoice as paid.I already have the "invoiceid" how can I get user information? Thanks Link to comment Share on other sites More sharing options...
sentq Posted January 21, 2018 Share Posted January 21, 2018 first you need to get client id from invoice information, then run extra API to return all client information <?php add_hook("InvoicePaid", 1, function($vars){ $adminUsername = ""; //optional for WHMCS v7.2 and later // Invoice Info $invoice = localAPI("GetInvoice", array('invoiceid' => $vars['invoiceid']), $adminUsername); // Client Info $client = localAPI("GetClientsDetails", array('clientid' => $invoice['userid']), $adminUsername); // Add your logic here }); Link to comment Share on other sites More sharing options...
Recommended Posts