Search code examples
api-designwhmcs

How to add URL hook to WHMCS order?


I have a panel developed in Laravel 5 and I need to integrate this software with WHMCS.

My idea is to make a system that allows users to buy a custom service throught WHMCS and when the order is successfully completed, to make WHMCS calling an URL and passing it some data. I will receive this data with my Laravel application and I will use it to register a new user.

Is there a way to make something like this in WHMCS?

PS: To explain myself better, I want to make an example.

  • User A has bought service X from WHMCS
  • WHMCS calls www.mysoftware.local/register/[username]/[password]/etc
  • User A is succesfully registered on my local platform.

Solution

  • WHMCS has Provisioning modules for such functionality, you add the code to contact your Laravel app in the provisioningmodule_CreateAccount function.

    To connect your module, you create a Product in Products/Services, then edit that product to assign the module you wrote to this product in Module Settings tab. You can choose when to setup the service in this tab as well.