README.md 3.1 KB
Newer Older
Pedro Cavaleiro committed
1 2 3 4 5
# WHMCS API C# Wrapper

This is an library to comunicate with the WHMCS API<br/>
Currently these functions are already implemented

Pedro Cavaleiro committed
6 7 8 9 10 11 12 13 14
* [Add Client](https://github.com/hitmanpt/whmcs-api/wiki/AddClient%28%29)
* [Domain WhoIs](https://github.com/hitmanpt/whmcs-api/wiki/DomainWhoIs%28%29)
* [Get Clients Details](https://github.com/hitmanpt/whmcs-api/wiki/GetClientsDetails%28%29)
* [Get Clients Domains](https://github.com/hitmanpt/whmcs-api/wiki/GetClientsDomains%28%29)
* [Get Clients Products](https://github.com/hitmanpt/whmcs-api/wiki/GetClientsProducts%28%29)
* [Get Invoice](https://github.com/hitmanpt/whmcs-api/wiki/GetInvoice%28%29)
* [Get Invoices](https://github.com/hitmanpt/whmcs-api/wiki/GetInvoices%28%29)
* [Get Orders](https://github.com/hitmanpt/whmcs-api/wiki/GetOrders%28%29)
* [Get Transactions](https://github.com/hitmanpt/whmcs-api/wiki/GetTransactions%28%29)
Pedro Cavaleiro committed
15 16
* [Module Change Password](https://github.com/hitmanpt/whmcs-api/wiki/ModuleChangePassword%28%29)
* [Module Custom Command](https://github.com/hitmanpt/whmcs-api/wiki/ModuleCustomCommand%28%29)
Pedro Cavaleiro committed
17
* [Validate Login](https://github.com/hitmanpt/whmcs-api/wiki/ValidateLogin%28%29)
Pedro Cavaleiro committed
18

Pedro Cavaleiro committed
19 20
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A3JFH2WA6U9YU)

Pedro Cavaleiro committed
21 22 23 24 25
How to install<br />
[NuGet](https://www.nuget.org/packages/WHMCS_API) Packet Manager Console on VisualStudio `Install-Package WHMCS_API`
<br />or<br />
<a href="https://github.com/hitmanpt/whmcs-api/releases">Releases</a> project page (need to also download Newtonsoft.Json if not already included on your project)

Pedro Cavaleiro committed
26
The implemented functions are designed to be very easy to use
Pedro Cavaleiro committed
27 28
The following code demonstrates to to implement the GetClientDetails on an ASP.net MVC app<br />
More information on the project Wiki <a href="https://github.com/hitmanpt/whmcs-api/wiki/Getting-Started">Getting Started</a>
Pedro Cavaleiro committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

```
using WHMCS-API;
namespace YOUR_APP
{
    public class YOUR_CLASS
    {
        [HttpPost]
        public ActionResult ClientDetails(int clientID)
        {
            string username = "WHMCS_USERNAME";
            string password = "WHMCS_PASSWORD";
            string accessKey = "WHNMCS_ACCESS_KEY";
            string whmcsUrl = "WHMCS_USERFRONTEND_URL"; //ex: https://example.com/client
            API api = new API(username, password, accessKey, whmcsUrl);
            ViewBag.UserDetails = api.GetClientsDetails(clientID, Stats: true); //The model passed is of type GetClientsDetails
            return View();
        }
    }
}
```

Pedro Cavaleiro committed
51 52
You can still use this library to call non implemented<br />
Read more at the project Wiki <a href="https://github.com/hitmanpt/whmcs-api/wiki/%5BAdvanced-Usage%5D-Unsuported-Actions">[Advanced Usage] Unsuported Actions</a>
Pedro Cavaleiro committed
53 54 55


You can also create custom functions of already implemented functions.<br />
Pedro Cavaleiro committed
56
Read more at the project Wiki <a href="https://github.com/hitmanpt/whmcs-api/wiki/%5BAdvanced-Usage%5D-Supported-Actions">[Advanced Usage] Supported Actions</a>
Pedro Cavaleiro committed
57

Pedro Cavaleiro committed
58

Pedro Cavaleiro committed
59
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A3JFH2WA6U9YU)