{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Core Module Functions","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"core-module-functions","__idx":0},"children":["Core Module Functions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The core module functions are ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Suspend"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Unsuspend"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Terminate"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Renew"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ChangePassword"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ChangePackage"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These 7 functions all operate in a similar manner. They can run both manually and automatically."," ","Each expected to return either a success or error response."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response-handling","__idx":1},"children":["Response Handling ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"response-handling"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each of these functions after running actions must either return a success or error."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a successful result the code must actually return the word \"",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["success"]},"\" to end the function."," ","When WHMCS receives \"",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["success"]},"\" it knows the function completed and continues on that basis."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Should the function fail, the return should be a user understandable error message, as it will display to staff users."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"action-events","__idx":2},"children":["Action Events ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"action-events"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a function is successful, there are various actions that run as follows:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["CreateAccount"]}," - Changes status to Active + Sends Product Welcome Email"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SuspendAccount"]}," - Changes status to Suspended"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["UnsuspendAccount"]}," - Changes status to Active"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TerminateAccount"]}," - Changes status to Terminated"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ChangePassword"]}," - Updates password in database"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Besides the above actions, admin users receive a confirmation of functions completing, or errors in the case of failure."," ","Functions invoked through automation, such as payment of a new order, that notification can be via email."," ","In the case of ChangePassword, any errors returned are also displayed to client users."]}]},"headings":[{"value":"Core Module Functions","id":"core-module-functions","depth":1},{"value":"Response Handling","id":"response-handling","depth":2},{"value":"Action Events","id":"action-events","depth":2}],"frontmatter":{"title":"Core Module Functions","seo":{"title":"Core Module Functions"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/provisioning-modules/core-module-functions","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}