curl --request PATCH \
--url https://console.advinservers.com/api/v1/client/account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Gordon",
"last_name": "Freeman",
"company_name": "Black Mesa Research Facility",
"address1": "1 Mesa Road",
"address2": "Sector C, Anomalous Materials Laboratory",
"city": "Socorro",
"state": "New Mexico",
"postcode": "87801",
"country": "US",
"phone_number": "+1 575 555 0198",
"tax_id": ""
}
'import requests
url = "https://console.advinservers.com/api/v1/client/account"
payload = {
"first_name": "Gordon",
"last_name": "Freeman",
"company_name": "Black Mesa Research Facility",
"address1": "1 Mesa Road",
"address2": "Sector C, Anomalous Materials Laboratory",
"city": "Socorro",
"state": "New Mexico",
"postcode": "87801",
"country": "US",
"phone_number": "+1 575 555 0198",
"tax_id": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'Gordon',
last_name: 'Freeman',
company_name: 'Black Mesa Research Facility',
address1: '1 Mesa Road',
address2: 'Sector C, Anomalous Materials Laboratory',
city: 'Socorro',
state: 'New Mexico',
postcode: '87801',
country: 'US',
phone_number: '+1 575 555 0198',
tax_id: ''
})
};
fetch('https://console.advinservers.com/api/v1/client/account', 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://console.advinservers.com/api/v1/client/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => 'Gordon',
'last_name' => 'Freeman',
'company_name' => 'Black Mesa Research Facility',
'address1' => '1 Mesa Road',
'address2' => 'Sector C, Anomalous Materials Laboratory',
'city' => 'Socorro',
'state' => 'New Mexico',
'postcode' => '87801',
'country' => 'US',
'phone_number' => '+1 575 555 0198',
'tax_id' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.advinservers.com/api/v1/client/account"
payload := strings.NewReader("{\n \"first_name\": \"Gordon\",\n \"last_name\": \"Freeman\",\n \"company_name\": \"Black Mesa Research Facility\",\n \"address1\": \"1 Mesa Road\",\n \"address2\": \"Sector C, Anomalous Materials Laboratory\",\n \"city\": \"Socorro\",\n \"state\": \"New Mexico\",\n \"postcode\": \"87801\",\n \"country\": \"US\",\n \"phone_number\": \"+1 575 555 0198\",\n \"tax_id\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://console.advinservers.com/api/v1/client/account")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Gordon\",\n \"last_name\": \"Freeman\",\n \"company_name\": \"Black Mesa Research Facility\",\n \"address1\": \"1 Mesa Road\",\n \"address2\": \"Sector C, Anomalous Materials Laboratory\",\n \"city\": \"Socorro\",\n \"state\": \"New Mexico\",\n \"postcode\": \"87801\",\n \"country\": \"US\",\n \"phone_number\": \"+1 575 555 0198\",\n \"tax_id\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"Gordon\",\n \"last_name\": \"Freeman\",\n \"company_name\": \"Black Mesa Research Facility\",\n \"address1\": \"1 Mesa Road\",\n \"address2\": \"Sector C, Anomalous Materials Laboratory\",\n \"city\": \"Socorro\",\n \"state\": \"New Mexico\",\n \"postcode\": \"87801\",\n \"country\": \"US\",\n \"phone_number\": \"+1 575 555 0198\",\n \"tax_id\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"profile": {
"first_name": "Gordon",
"last_name": "Freeman",
"company_name": "Black Mesa Research Facility",
"address1": "1 Mesa Road",
"address2": "Sector C, Anomalous Materials Laboratory",
"city": "Socorro",
"state": "New Mexico",
"postcode": "87801",
"country": "US",
"country_name": "United States",
"phone_number": "+1 575 555 0198",
"tax_id": null
},
"balance": {
"due": "$42.00",
"overdue": "$12.00",
"credit": "$10.00",
"unpaid_invoices": 2,
"overdue_invoices": 1,
"has_due": true,
"has_overdue": true,
"currency": "USD"
},
"currency": "USD",
"email": "gordon.freeman@blackmesa.example.com",
"email_verified": true,
"portal_url": "https://clients.advinservers.com"
}{
"message": "The request could not be carried out."
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "The name field is required.",
"errors": {}
}{
"message": "Too Many Attempts."
}Update account details
Overview
Updates billing contact details and returns the full account response. Send every profile field. first_name, last_name, address1, city, postcode, country and phone_number need values. Send empty strings to clear company_name, address2, state or tax_id. Use a two-letter country code and a phone number starting with + and the country code. Other fields are ignored. Contact support to change the account email. Returns 400 with an explanation if billing rejects the change.
Permissions
Requires the account permission account.update (Change the account).
curl --request PATCH \
--url https://console.advinservers.com/api/v1/client/account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Gordon",
"last_name": "Freeman",
"company_name": "Black Mesa Research Facility",
"address1": "1 Mesa Road",
"address2": "Sector C, Anomalous Materials Laboratory",
"city": "Socorro",
"state": "New Mexico",
"postcode": "87801",
"country": "US",
"phone_number": "+1 575 555 0198",
"tax_id": ""
}
'import requests
url = "https://console.advinservers.com/api/v1/client/account"
payload = {
"first_name": "Gordon",
"last_name": "Freeman",
"company_name": "Black Mesa Research Facility",
"address1": "1 Mesa Road",
"address2": "Sector C, Anomalous Materials Laboratory",
"city": "Socorro",
"state": "New Mexico",
"postcode": "87801",
"country": "US",
"phone_number": "+1 575 555 0198",
"tax_id": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'Gordon',
last_name: 'Freeman',
company_name: 'Black Mesa Research Facility',
address1: '1 Mesa Road',
address2: 'Sector C, Anomalous Materials Laboratory',
city: 'Socorro',
state: 'New Mexico',
postcode: '87801',
country: 'US',
phone_number: '+1 575 555 0198',
tax_id: ''
})
};
fetch('https://console.advinservers.com/api/v1/client/account', 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://console.advinservers.com/api/v1/client/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => 'Gordon',
'last_name' => 'Freeman',
'company_name' => 'Black Mesa Research Facility',
'address1' => '1 Mesa Road',
'address2' => 'Sector C, Anomalous Materials Laboratory',
'city' => 'Socorro',
'state' => 'New Mexico',
'postcode' => '87801',
'country' => 'US',
'phone_number' => '+1 575 555 0198',
'tax_id' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.advinservers.com/api/v1/client/account"
payload := strings.NewReader("{\n \"first_name\": \"Gordon\",\n \"last_name\": \"Freeman\",\n \"company_name\": \"Black Mesa Research Facility\",\n \"address1\": \"1 Mesa Road\",\n \"address2\": \"Sector C, Anomalous Materials Laboratory\",\n \"city\": \"Socorro\",\n \"state\": \"New Mexico\",\n \"postcode\": \"87801\",\n \"country\": \"US\",\n \"phone_number\": \"+1 575 555 0198\",\n \"tax_id\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://console.advinservers.com/api/v1/client/account")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Gordon\",\n \"last_name\": \"Freeman\",\n \"company_name\": \"Black Mesa Research Facility\",\n \"address1\": \"1 Mesa Road\",\n \"address2\": \"Sector C, Anomalous Materials Laboratory\",\n \"city\": \"Socorro\",\n \"state\": \"New Mexico\",\n \"postcode\": \"87801\",\n \"country\": \"US\",\n \"phone_number\": \"+1 575 555 0198\",\n \"tax_id\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"Gordon\",\n \"last_name\": \"Freeman\",\n \"company_name\": \"Black Mesa Research Facility\",\n \"address1\": \"1 Mesa Road\",\n \"address2\": \"Sector C, Anomalous Materials Laboratory\",\n \"city\": \"Socorro\",\n \"state\": \"New Mexico\",\n \"postcode\": \"87801\",\n \"country\": \"US\",\n \"phone_number\": \"+1 575 555 0198\",\n \"tax_id\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"profile": {
"first_name": "Gordon",
"last_name": "Freeman",
"company_name": "Black Mesa Research Facility",
"address1": "1 Mesa Road",
"address2": "Sector C, Anomalous Materials Laboratory",
"city": "Socorro",
"state": "New Mexico",
"postcode": "87801",
"country": "US",
"country_name": "United States",
"phone_number": "+1 575 555 0198",
"tax_id": null
},
"balance": {
"due": "$42.00",
"overdue": "$12.00",
"credit": "$10.00",
"unpaid_invoices": 2,
"overdue_invoices": 1,
"has_due": true,
"has_overdue": true,
"currency": "USD"
},
"currency": "USD",
"email": "gordon.freeman@blackmesa.example.com",
"email_verified": true,
"portal_url": "https://clients.advinservers.com"
}{
"message": "The request could not be carried out."
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "The name field is required.",
"errors": {}
}{
"message": "Too Many Attempts."
}Authorizations
Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.
Body
Send a JSON object containing the fields below. Required fields are marked in the schema.
The account holder's first name.
1 - 64^[^\p{C}]*$The account holder's last name.
1 - 64^[^\p{C}]*$The company name for billing, or null or an empty string to clear it.
128^[^\p{C}]*$The first line of the billing address.
1 - 255^[^\p{C}]*$The second line of the billing address, or null or an empty string to clear it.
255^[^\p{C}]*$The city for the billing address.
1 - 128^[^\p{C}]*$The billing state, province, or region, or null or an empty string to clear it.
128^[^\p{C}]*$The postal code for the billing address.
1 - 32^[^\p{C}]*$The ISO 3166-1 alpha-2 country code.
2The phone number, including its country calling code.
4 - 32^\+[1-9][\d\s().-]*\d$The tax identification number, or null or an empty string to clear it.
64^[^\p{C}]*$Response
The record, as a JSON object. There is no envelope.
The name and address used for billing. Missing values are null, not empty strings.
Show child attributes
Show child attributes
{
"first_name": "Gordon",
"last_name": "Freeman",
"company_name": "Black Mesa Research Facility",
"address1": "1 Mesa Road",
"address2": "Sector C, Anomalous Materials Laboratory",
"city": "Socorro",
"state": "New Mexico",
"postcode": "87801",
"country": "US",
"country_name": "United States",
"phone_number": "+1 575 555 0198",
"tax_id": null
}
The current outstanding balance, including partial payments. Amounts include currency symbols and digit separators. Display these strings directly; do not parse them as numbers.
Show child attributes
Show child attributes
{
"due": "$42.00",
"overdue": "$12.00",
"credit": "$10.00",
"unpaid_invoices": 2,
"overdue_invoices": 1,
"has_due": true,
"has_overdue": true,
"currency": "USD"
}
The currency the account is billed in, or null when it is not known.
"USD"
The account email address. It cannot be changed through this endpoint.
"gordon.freeman@blackmesa.example.com"
Whether the email address is verified. Null means the billing record does not provide this information; it does not mean false.
true
A link to the external account portal, or null if no portal is configured.
"https://clients.advinservers.com"