Billing interaction
Last modified by Hostkey Admin on 2022/07/14 11:26
Billing actions:
Resource | Action | Description |
---|---|---|
whmcs.php | get_client | Get customer information |
whmcs.php | create_addfunds | Create add funds invoice |
whmcs.php | getpaymentgw | Get information how to pay this invoice |
whmcs.php | get_billing_data | This call retrieve billing information for the server. |
Whmcs/Get_client
HOSTKEY is using WHMCS as billing software. With get_client you will have necessary customer data from billing. Important keys are in bold.
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | get_client | Main action - Get customer information |
token | * | string | Your session token |
curl -s "https://invapi.hostkey.com/whmcs.php" -X POST \
--data "action=get_client" \
--data "token=" \
--data "action=get_client" \
--data "token=" \
Whmcs/Create_addfunds
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | create_addfundst | Main action - Create add funds invoice |
amount | * | int | Replenishment amount | |
token | * | string | Your session token |
curl -s "https://invapi.hostkey.com/whmcs.php" -X POST \
--data "action=create_addfunds" \
--data "amount=" \
--data "token=" \
--data "action=create_addfunds" \
--data "amount=" \
--data "token=" \
Whmcs/Getpaymentgw
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | getpaymentgw | Main action - Get information how to pay this invoice |
invoice_id | * | int | Invoice id number | |
token | * | string | Your session token |
curl -s "https://invapi.hostkey.com/whmcs.php" -X POST \
--data "action=getpaymentgw" \
--data "invoice_id=" \
--data "token=" \
--data "action=getpaymentgw" \
--data "invoice_id=" \
--data "token=" \
In order to proceed with this invoice, you should show HTML from the "call" key to the customer. It contains all the necessary form data to proceed with payment. When customer's pay, it will increase account credit. You could check the actual credit amount with whmcs/get_client call
Whmcs/Get_billing_data
HTTP Method - POST
Parameter | Required | Type | Value/default | Description | |
---|---|---|---|---|---|
action | * | string | get_billing_data | Main action - this call retrieve billing information for the server. | |
id | * | int | Server token | ||
token | * | string | Your access token |
curl -s "https://invapi.hostkey.com/whmcs.php" -X POST \
--data "action=get_billing_data" \
--data "token=" \
--data "id=" \
--data "action=get_billing_data" \
--data "token=" \
--data "id=" \