Get Credits
curl --request GET \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits \
--header 'token: <token>' \
--header 'username: <username>'import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits"
headers = {
"username": "<username>",
"token": "<token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {username: '<username>', token: '<token>'}};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"token: <token>",
"username: <username>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("username", "<username>")
req.Header.Add("token", "<token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits")
.header("username", "<username>")
.header("token", "<token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["username"] = '<username>'
request["token"] = '<token>'
response = http.request(request)
puts response.read_body"150.50"{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}Billing
Get Credits
Retrieves the reseller account credit balance. Returns the numeric value directly as a string.
GET
/
billing
/
credits
Get Credits
curl --request GET \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits \
--header 'token: <token>' \
--header 'username: <username>'import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits"
headers = {
"username": "<username>",
"token": "<token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {username: '<username>', token: '<token>'}};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"token: <token>",
"username: <username>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("username", "<username>")
req.Header.Add("token", "<token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits")
.header("username", "<username>")
.header("token", "<token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/billing/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["username"] = '<username>'
request["token"] = '<token>'
response = http.request(request)
puts response.read_body"150.50"{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}Headers
Reseller email address registered in WHMCS
Example:
HMAC-SHA256 authentication token.
PHP formula: base64_encode(hash_hmac('sha256', $apiKey, $email . ':' . gmdate('y-m-d H')))
Important: hash_hmac without the 3rd parameter true (returns hex, not binary), then base64_encode of the hex result. The token is 88 characters long.
An optional timestamp header (Unix timestamp, 60-second tolerance) can be sent to synchronize time.
Example:
"YTk4YjRmNjI..."
Response
Success - Returns the credit balance (string, e.g. "150.50")
The response is of type string.
Example:
"150.50"
⌘I