Jump to: navigation, search

The WHMCS API provides an interface to allow you to access and perform actions in WHMCS both from external applications and scripts as well as internal modules and addons.

Internal API

The internal API can be used from any file within WHMCS - be it a template, action hook, addon module, anything. It allows you to call any of the API functions via a local function call to avoid needing to use CURL. For more information on this, please refer to the Internal API Page

External API

The External API supports 3 response types: Name/Value Pairs (NVP), XML & JSON (V4.5 or later)

Most calls support all response types, but certain data retrieval calls will only work under either XML or JSON due to the multi-level depth nature of their responses.

API User Setup

When creating an admin user for API use, only the API permission is required to be able to access & use all the API functions.

You must also setup the IP(s) you will be connecting from in General Settings > Security. Failure to do this will result in an "Invalid IP xx.xxx.xxx.xx" response from the API.

If IP Restricted access isn't suitable for what you're using the API for, then an alternative solution using an access key is available. For details about how to use this alternative option instead, see the API Access Keys Page.

With regards to the passwords and hashes, these are case sensitive, and should be passed accordingly.

Example Code

We have fully working PHP code samples demonstrating how you can connect to and interpret each of the supported response types of the WHMCS API in the pages below:


An alphabetical list of API Functions is available at API:Functions(A-Z).

The API currently supports the following functions.

Client Management

Add Client Update Client Delete Client
Close Client Add Client Note Get Clients
Get Clients Details Get Credits Get Emails
Get Quotes Get Clients Password Get Transactions
Add Contact Get Contacts Update Contact
Delete Contact Get Clients Products Update Client Product
Get Clients Addons Update Client Addon Get Clients Domains
Update Client Domain Add Cancel Request Upgrade Product
Validate Login Send Email

Domain Commands

Register Domain Renew Domain Transfer Domain
Release Domain Get Domain Lock Get Nameservers
Get WHOIS Request EPP Toggle ID Protect
Update Lock Update Nameservers Update WHOIS
Domain WHOIS Lookup

Module Commands

Module Create Module Suspend Module Unsuspend
Module Terminate Module Change Package Module Change Password


Open Ticket Reply Ticket Get Tickets
Get Ticket Update Ticket Delete Ticket
Add Ticket Note Get Ticket Notes Delete Ticket Note
Get Support Departments Get Support Statuses Get Ticket Predefined Categories
Get Ticket Predefined Replies Add Announcement Delete Announcement
Update Announcement Get Announcements

Order Handling

Add Order Get Orders Get Products
Get Promotions Get Order Statuses Accept Order
Pending Order Cancel Order Fraud Order
Delete Order Order Fraud Check


Get Invoices Get Invoice Create Invoice
Update Invoice Add Invoice Payment Capture Payment
Apply Credit Add Billable Item Add Credit
Add Transaction Get Transactions Update Transaction
Generate Invoice(s) Get Payment Methods


Create Quote Update Quote Delete Quote
Send Quote Accept Quote Get Quotes


List OAuth Credentials Create OAuth Credential Update OAuth Credential
Delete OAuth Credential


Get Activity Log Get Admin Details Update Admin Notes
Get Currencies Get Promotions Get Client Groups
Get Email Templates Get To-Do Items Get To-Do Item Statuses
Update To-Do Item Get Staff Online Get Stats
Encrypt Password Decrypt Password Add Banned IP
Add Product Log Activity Send Admin Email

Need something else?

The API is being continually developed and added to as features are requested. If you have a need for a feature that is not currently available, feel free to create a feature request and we'll see what we can do.