'whmcs: run function when an invoice for a new order is paid

I'm new to whmcs, and I'm developing my first "Provisioning Modules" if you have any good resources kindly post the link.

What I want: run a function when the user pays for the module (that is a service). Why? to run specific API for that services.

I found those functions: https://developers.whmcs.com/provisioning-modules/supported-functions/



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source