Account - Endpoints

GET
/v2/account
Account Details
Main Account Information
Request URL
/v2/account
Example Response
{
	success: true,
	results: 17,
	-result: {
		id: "CLIENT_ID",
		firstname: "FIRSTNAME ",
		lastname: "LASTNAME",
		fullname: "FIRSTNAME LASTNAME",
		companyname: "COMPANY_NAME",
		email: "EMAIL_ADDRESS",
		address1: "ADDRESS 1",
		address2: "ADDRESS 2",
		city: "CITY",
		state: "STATE",
		postcode: "POSTAL_CODE",
		countrycode: "COUNTRY_CODE",
		phonenumber: "PHONE_NUMBER",
		status: "Active",
		balance: "0.00",
		lastlogin: "Date: TIMESTAMP
IP Address: IP_ADDRESS
Host: REVERSE_PTR_RECORD", currency: "USD" } }
Example Code

<?php

require('api.class.php');

$account = new api("YOUR_API_KEY");
$account $this->api->call("v2""account""""get""");

?>
GET
/v2/account/balance
Account Balance
Get the current account balance.
Request URL
/v2/account/balance
Example Response
{
	success: true,
	results: 1,
	result: "0.00"
}
                      
Example Code

<?php

require('api.class.php');

$account = new api("YOUR_API_KEY");
$account $this->api->call("v2""account""balance""get""");

?>
GET
/v2/account/invoice
View Invoices
Return Invoices associated with account and optional status or Specific Invoice.
Request URL
/v2/account/invoice
Parameters
  • @param {status} (enum) Optional Specify to filter by status.
    • Paid
    • Unpaid
    • Overdue
    • Cancelled
  • @param {invoice} (int) Optional Invoice ID
      Required Regex Validation
    • [0-9]
Example Response
Invoice List
{
	success: true,
	results: 1,
	-result: [
		-{
			id: "INVOICE_ID",
			userid: "CLIENT_ID",
			firstname: "CLIENT_FIRSTNAME ",
			lastname: "CLIENT_LASTNAME",
			companyname: "CLIENT_COMPANY_NAME",
			invoicenum: "INVOICE_NUMBER",
			date: "DATE_GENERATED",
			duedate: "DATE_DUE",
			datepaid: "DATE_PAID",
			subtotal: "0.00",
			credit: "0.00",
			tax: "0.00",
			tax2: "0.00",
			total: "0.00",
			taxrate: "0.00",
			taxrate2: "0.00",
			status: "Paid",
			paymentmethod: "PAYMENT_GATEWAY",
			notes: "",
			currencycode: "USD",
			currencyprefix: "$",
			currencysuffix: " USD"
		}
	]
}
Specific Invoice
{
	success: true,
	results: 20,
	-result: {
		invoiceid: "INVOICE_ID",
		invoicenum: "INVOICE_NUMBER",
		userid: "CLIENT_ID",
		date: "DATE_GENERATED",
		duedate: "DATE_DUE",
		datepaid: "DATE_PAID",
		subtotal: "0.00",
		credit: "0.00",
		tax: "0.00",
		tax2: "0.00",
		total: "0.00",
		balance: "0.00",
		taxrate: "0.00",
		taxrate2: "0.00",
		status: "Paid",
		paymentmethod: "PAYMENT_GATEWAY",
		notes: "",
		ccgateway: true,
		-items: {
			-item: [
					-{
						id: "LINE_ITEM_NUMBER",
						type: "Hosting",
						relid: "SERVICE_ID",
						description: "SERVICE_DESCRIPTION",
						amount: "0.00",
						taxed: "0"
					}
				]
		},
		transactions: ""
	}
}
                      
Example Code

<?php

require('api.class.php');

$account = new api("YOUR_API_KEY");

// You can only specify one of the following Options.
$var->post->invoice "INVOICE_ID"// Optional - Invoice ID to get a specific Invoice
$var->post->status     "FILTER_TYPE"// Optional - Invoice Type to return (Paid, Unpaid, Overdue, Cancelled)

$account $this->api->call("v2""account""invoice""get"$var);

?>
GET
/v2/account/contact
Account Contacts
Account contact list, or returned detailed information for a single contact.
Request URL
/v2/account/contact
Parameters
  • @param {id} (int) Optional ID to get detailed information about a specific contact.
      Required Regex Validation
    • [0-9]
Example Response
{
success: true,
results: 1,
-result: [
		-{
			id: "CONTACT_ID",
			firstname: "FIRSTNAME ",
			lastname: "LASTNAME",
			companyname: "COMPANY_NAME",
			email: "EMAIL_ADDRESS",
			address1: "ADDRESS 1",
			address2: "ADDRESS 2",
			city: "CITY",
			state: "STATE",
			postcode: "POSTCODE",
			country: "COUNTRY_CODE",
			phonenumber: "PHONE_NUMBER",
			subaccount: "0",
			permissions: "",
			domainemails: "0",
			generalemails: "0",
			invoiceemails: "0",
			productemails: "0",
			supportemails: "0",
			affiliateemails: "0",
			status: "0"
		}
	]
}
                      
Example Code

<?php

require('api.class.php');

$account = new api("YOUR_API_KEY");
$var->post->id "CONTACT_ID"// Optional Value
$account $this->api->call("v2""account""contact""get"$var);

?>
POST
/v2/account/contact
Add Contact
Create a new account contact.
Request URL
/v2/account/contact
Parameters
  • @param {firstname} (string) REQUIRED Contact Firstname
      Required Regex Validation
    • ([a-zA-Z]{3,30}\s*)+
  • @param {lastname} (string) REQUIRED Contact Lastname
      Required Regex Validation
    • ([a-zA-Z]{3,30}\s*)+
  • @param {company} (string) Optional Company Name
      Required Regex Validation
    • [^A-Za-z0-9\-._]
  • @param {phone} (string) Optional Phone Number
  • @param {email} (string) REQUIRED Email Address
      Required Regex Validation
    • ^([^.@]+)(\.[^.@]+)*@([^.@]+\.)+([^.@]+)$
  • @param {password} (string) REQUIRED Desired Password
  • @param {address1} (string) REQUIRED Address
      Required Regex Validation
    • [A-Za-z0-9'\.\-\s\,]
  • @param {address2} (string) Optional Address
      Required Regex Validation
    • [A-Za-z0-9'\.\-\s\,]
  • @param {city} (string) REQUIRED City
      Required Regex Validation
    • ([a-zA-Z]{3,50}\s*)+
  • @param {state} (string) REQUIRED State
      Required Regex Validation
    • ([a-zA-Z]{3,30}\s*)+
  • @param {zipcode} (string) REQUIRED Zipcode
      Required Regex Validation
    • ([a-zA-Z0-9]{3,30}\s*)+
  • @param {country} (string) REQUIRED 2 Character Country Code
      Required Regex Validation
    • ([a-zA-Z]{2}\s*)+
Example Response
{
	"success":true,
	"results":1,
	"result":{
		"contactid":"CONTACT_ID"
	}
}
                      
Example Code

<?php

require('api.class.php');

$account = new api("YOUR_API_KEY");

$var->post->firstname    "FIRSTNAME"
$var->post->lastname     "LASTNAME"
$var->post->companyname  "COMPANY_NAME";
$var->post->phone        "PHONE_NUMBER";  
$var->post->email        "EMAIL_ADDRESS"
$var->post->password     "PASSWORD"
$var->post->address1     "ADDRESS_1"
$var->post->address2     "ADDRESS_2"
$var->post->city         "CITY"
$var->post->state        "STATE"
$var->post->zipcode      "ZIPCODE"
$var->post->country      "COUNTRY_CODE"

$account $this->api->call("v2""account""contact""post"$var);

?>
PUT
/v2/account/contact
Update Contact
Update Account contact.
Request URL
/v2/account/contact
Parameters
  • @param {id} (int) REQUIRED Contact ID to update.
      Required Regex Validation
    • [0-9]
  • @param {firstname} (string) Optional
      Required Regex Validation
    • ([a-zA-Z]{3,30}\s*)+
  • @param {lastname} (string) Optional
      Required Regex Validation
    • ([a-zA-Z]{3,30}\s*)+
  • @param {company} (string) Optional
      Required Regex Validation
    • [^A-Za-z0-9\-._]
  • @param {phone} (string) Optional
  • @param {email} (string) Optional
      Required Regex Validation
    • ^([^.@]+)(\.[^.@]+)*@([^.@]+\.)+([^.@]+)$
  • @param {password} (string) Optional
  • @param {address1} (string) Optional
      Required Regex Validation
    • [A-Za-z0-9'\.\-\s\,]
  • @param {address2} (string) Optional
      Required Regex Validation
    • [A-Za-z0-9'\.\-\s\,]
  • @param {city} (string) Optional
      Required Regex Validation
    • ([a-zA-Z]{3,50}\s*)+
  • @param {state} (string) Optional
      Required Regex Validation
    • ([a-zA-Z]{3,30}\s*)+
  • @param {zipcode} (string) Optional
      Required Regex Validation
    • ([a-zA-Z0-9]{3,30}\s*)+
  • @param {country} (string) Optional 2 Character Country Code
      Required Regex Validation
    • ([a-zA-Z]{2}\s*)+
Example Response
{
	success: true,
	results: 1,
	result: "Contact Updated"
}
                      
Example Code

<?php

require('api.class.php');

$account = new api("YOUR_API_KEY");
$var->post->id           "CONTACT_ID"// Required
$var->post->firstname    "FIRSTNAME"// Optional, only specify if you wish to update.
$var->post->lastname     "LASTNAME"// Optional, only specify if you wish to update.
$var->post->companyname  "COMPANY_NAME"// Optional, only specify if you wish to update.
$var->post->phone        "PHONE_NUMBER"// Optional, only specify if you wish to update.
$var->post->email        "EMAIL_ADDRESS"// Optional, only specify if you wish to update.
$var->post->password     "PASSWORD"// Optional, only specify if you wish to update.
$var->post->address1     "ADDRESS_1"// Optional, only specify if you wish to update.
$var->post->address2     "ADDRESS_2"// Optional, only specify if you wish to update.
$var->post->city         "CITY"// Optional, only specify if you wish to update.
$var->post->state        "STATE"// Optional, only specify if you wish to update.
$var->post->zipcode      "ZIPCODE"// Optional, only specify if you wish to update.
$var->post->country      "COUNTRY_CODE"// Optional, only specify if you wish to update.

$account $this->api->call("v2""account""contact""put"$var);

?>
DELETE
/v2/account/contact
Delete Contact
Delete Account Contact.
Request URL
/v2/account/contact
Parameters
  • @param {id} (int) REQUIRED Contact ID to delete.
      Required Regex Validation
    • [0-9]
Example Response
{
	success: true,
	results: 1,
	result: "Contact Deleted"
}
                      
Example Code

<?php

require('api.class.php');

$account = new api("YOUR_API_KEY");

$var->post->contactid    "CONTACT_ID"

$account $this->api->call("v2""account""contact""delete"$var);

?>