I have implemented 45% of the methods from the documentation at https://billing.time4vps.com/userapi. I plan to implement all the available functions in the near future. Please support me with your interest if you find this package useful.
composer require i-kostiuk/time4vps-api
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
use Time4Vps\Time4Vps;
require __DIR__ . "/vendor/autoload.php";
$client = new Time4Vps($username, $password);
Return registration details for my account
- documentation: https://billing.time4vps.com/userapi#user-details-1
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$details = $client->getDetails();
Update registration details under my account
- documentation: https://billing.time4vps.com/userapi#update-user-details-2
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$details = $client->setDetails([
"type" => "typeValue",
"companyname" => "companynameValue",
"companyregistrationnumber" => "companyregistrationnumberValue",
"vateu" => "vateuValue",
"email" => "emailValue",
"firstname" => "firstnameValue",
"lastname" => "lastnameValue",
"country" => "countryValue",
"address1" => "address1Value",
"city" => "cityValue",
"state" => "stateValue",
"postcode" => "postcodeValue",
"phonenumber" => "phonenumberValue",
"emarketing" => "emarketingValue"
]);
Return a list of contacts on this account
- documentation: https://billing.time4vps.com/userapi#list-contacts-9
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$contacts = $client->getContacts();
Return array with contact details
- documentation: https://billing.time4vps.com/userapi#get-contacts-details-12
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$contact = $client->getContactDetails($contact_id);
Return a list of all portal notifications.
- documentation: https://billing.time4vps.com/userapi#list-all-portal-notifications-37
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$notifications = $client->getNotifications();
Return only new portal notifications.
- documentation: https://billing.time4vps.com/userapi#list-new-portal-notifications-38
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$notifications = $client->getNotificationsNew();
Marks the notification as read
- documentation: https://billing.time4vps.com/userapi#acknowledge-notification-39
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$notification = $client->markNotificationsAsRead($notification_id);
Get current account balance(unpaid invoices total), account credit
- documentation: https://billing.time4vps.com/userapi#account-balance-4
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$balance = $client->getBalance();
List all invoices under my account
- documentation: https://billing.time4vps.com/userapi#list-invoices-6
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$invoices = $client->getInvoices();
Get invoice details
- documentation: https://billing.time4vps.com/userapi#invoice-details-8
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$invoice = $client->getInvoice($invoice_id);
List available payment methods
- documentation: https://billing.time4vps.com/userapi#payment-methods-14
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$payments = $client->getPayments();
List available payment methods with fees
- documentation: https://billing.time4vps.com/userapi#payment-methods-fees-15
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$payments = $client->getPaymentsFees();
List all services under your account
- documentation: https://billing.time4vps.com/userapi#list-services-17
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$services = $client->getServices();
Show current service label
- documentation: https://billing.time4vps.com/userapi#service-label-27
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$service_label = $client->getServiceLabel($service_id);
Set new custom label to identify this service
- documentation: https://billing.time4vps.com/userapi#change-service-label-28
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$response = $client->setServiceLabel($service_id, $new_label);
Return a list of product categories.
- documentation: https://billing.time4vps.com/userapi#list-product-categories-21
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$categories = $client->getProductCategories();
Return a list of product available for purchase under requested category
- documentation: https://billing.time4vps.com/userapi#list-products-in-category-22
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$products = $client->getProductsInCategory($category_id);
Return product details with form configuration, addons and subproducts if available.
- documentation: https://billing.time4vps.com/userapi#get-product-configuration-details-23
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$product = $client->getProductDetails($product_id);
List all available virtual private server products
- documentation: https://billing.time4vps.com/userapi#get-available-vps-products-66
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$vps_products = $client->getAvailableVps();
Returns a list of all DNS
- documentation: https://billing.time4vps.com/userapi#list-dns-30
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$dns = $client->getDns();
Returns details of the DNS zone
- documentation: https://billing.time4vps.com/userapi#get-dns-details-32
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$dns = $client->getDnsDetails($service_id, $zone_id);
List all ssl services under your account
- documentation: https://billing.time4vps.com/userapi#list-ssl-certificates-41
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$certificates = $client->getCertificates();
Lists all active servers. Results includes only the brief information about the server. Call is synchronous - result returned immediately.
- documentation: https://billing.time4vps.com/userapi#list-all-servers-51
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$servers = $client->getServers();
Particular server details: configuration, installed OS, resource usage and etc. Call is synchronous - result returned immediately.
- documentation: https://billing.time4vps.com/userapi#server-details-52
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$server = $client->getServerDetails($server_id);
List of available OS templates for a server. Call is synchronous - result returned immediately.
- documentation: https://billing.time4vps.com/userapi#available-os-list-62
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$server_os = $client->getServerAvailableOsList($server_id);
List of additional IPs. Call is synchronous - result returned immediately.
- documentation: https://billing.time4vps.com/userapi#get-additional-ips-63
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$server_ips = $client->getServerAdditionalIps($server_id);
Displays the bandwidth usage of a server. Call is synchronous - result returned immediately.
- documentation: https://billing.time4vps.com/userapi#get-usage-history-65
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$history = $client->getServerUsageHistory($server_id);
Script content is not included
- documentation: https://billing.time4vps.com/userapi#get-available-init-scripts-69
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$scripts = $client->getScripts();
Script content is included
- documentation: https://billing.time4vps.com/userapi#get-init-script-by-id-70
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$script = $client->getScript($script_id);
Returns all available (including servers in maintenance) VPN servers.
- documentation: https://billing.time4vps.com/userapi#list-vpn-servers-74
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$vpn_servers = $client->getVpnServers();
- documentation: https://billing.time4vps.com/userapi#list-vpn-clients-75
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$vpn_clients = $client->getVpnClients();
Returns oldest VPN plan login details, such as username, password, pre-shared key.
- documentation: https://billing.time4vps.com/userapi#vpn-login-details-77
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$vpn_login_details = $client->getVpnLoginDetails();
Displays the bandwidth usage of a VPN service.
- documentation: https://billing.time4vps.com/userapi#get-usage-history-8083
- example:
use Time4Vps\Time4Vps;
$client = new Time4Vps($username, $password);
$vpn_usage_history = $client->getVpnUsageHistory($id);