I need to connect the invoicing system of the WHMCS to a einvoicing provider according the new laws of our country, they told me that the response type have to be in a POST method in JSON to a specific url they give us, after that the authority of the goverment will receive and approve the invoice trought them and later the final response that we will receive on a xml encoded in Base64. I ask to the WHMCS support and they say this:
Thanks for contacting WHMCS! I'm afraid we are unable to assist with specific coding issues like this. I'd be happy to point out some API/hooks that would be useful. According to this document, you need to hook into THEIR API in a JSON response. In this case, you would likely need to use WHMCS hookpoints to grab the data, format it in the manner they want, and then send it off to their API. [url removed, login to view]
In this case, you would likely need WHMCS to generate an invoice to get the provider the data they need, then send that off to them. For this I would recommend utilizing the InvoiceCreation hookpoint combined with the API functions GetInvoice and GetClients. These look like they will pull the required data that you can format and send off.
So, talking with the einvoicing provider we get to the conclusion that the JSON have to be send after payment received, invoice creation pre email, or better way invoices paid, this is the ways what WHMCS recomend in our case according this documentation:
Hooks info: [url removed, login to view]
API info: [url removed, login to view]
[url removed, login to view]
We for sure sent to WHMCS support the documentation give it by the einvoincing provider to us, I attached on this to get help making the conection with this kind of web services.
The other thing is to acomodate the fields needed by them that they have to receive to validate the official invoice in XML.
Aaron Barboza T.