caygri Posted December 5, 2021 Share Posted December 5, 2021 Hello, is there someone who can connect whmcs with api fattureincloud https://api.fattureincloud.it/v1/documentation/dist/ 0 Quote Link to comment Share on other sites More sharing options...
Remitur Posted December 6, 2021 Share Posted December 6, 2021 It should be not very complicated... create a hook for InvoicePaidPreEmail ( https://developers.whmcs.com/hooks-reference/invoices-and-quotes/#invoicepaidpreemail ) and recover all required invoicedata in the hook, just create a call to https://api.fattureincloud.it/v1/documentation/dist/#!/Documenti_emessi/DocNuovo to create the new electronic invoice (Note: I'm not offering myself to do it, just a simple tip to help 😉 0 Quote Link to comment Share on other sites More sharing options...
caygri Posted December 6, 2021 Author Share Posted December 6, 2021 do you think? i'm not capable....and i dont know if whmcs it's for me... 1 Quote Link to comment Share on other sites More sharing options...
Remitur Posted December 7, 2021 Share Posted December 7, 2021 13 hours ago, caygri said: do you think? i'm not capable....and i dont know if whmcs it's for me... Sometimes it's harder to explain than doing it... 😉 First step should be something like that (warning: unchecked code!) add_hook('InvoicePaidPreEmail', 1, function ($vars) { $command = 'GetInvoice'; $postData = array( 'invoiceid' => $invoiceid, ); $results = localAPI($command, $postData); $myinvoice = json_decode($results); logActivity(print_r($myinvoice, true)); // do here whatever necessary to call external billing system }); Note: with that "logactivity" statement, you'll find in your WHMCS activity log a single row with all the recovered data about your invoice. The recovered fields are reported here: https://developers.whmcs.com/api-reference/getinvoice/ You'll need to re-format the invoice data, in order to comply to your external software requirements, and then calling it somehow (CURL ?) 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.