This module allows you to remotely manage your WHMCS installation(s) using Node.
npm install whmcs-js
Reminder: You need to whitelist the IP from which you are making API calls in WHMCS. Otherwise you will get an error.
You can do this under Setup > General Settings > Security. More info
You can remotely identify on the API using two methods: Note that you will always need to declare serverUrl
const config = {
username: 'api_username',
password: 'password_as_md5',
serverUrl: 'http://127.0.0.1/includes/api.php' // Remember to point to the api.php file
}
You can generate these under Setup > Staff Management > Manage API Credentials. More info
const config = {
identifier: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
secret: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
serverUrl: 'http://127.0.0.1/includes/api.php' // Remember to point to the api.php file
}
Every request returns a Promise with JSON data, so you can do:
const { Billing } = require('whmcs-js')
const myBilling = new Billing(config)
const invoices = await myBilling.getInvoices()
See a list of available Modules and their methods here: https://damageesp.github.io/whmcs-js/
VÃctor Campos - @DamageESP
Licensed under the Apache license, version 2.0 (the "license"); You may not use this file except in compliance with the license. You may obtain a copy of the license at:
http://www.apache.org/licenses/LICENSE-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. See the license for the specific language governing permissions and limitations under the license.
The contents in this repository are based on the repository node-whmcs, which is licensed under the Apache license, version 2.0 by Pedro Dias - @pedromdias, but include major modifications to it.
Original repository: https://github.com/apocas/node-whmcs