Skip to content

Update account details

PATCH/account

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 'Accept: application/json' \
  --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": ""
}'
{
  "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"
}

Authorization

Authorizationstringheaderrequired

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.

Send it as Bearer <token>.

Body

application/json
first_namestringrequired

The account holder's first name.

1 to 64 characters

Must match ^[^\p{C}]*$

last_namestringrequired

The account holder's last name.

1 to 64 characters

Must match ^[^\p{C}]*$

company_namestring | nullrequired

The company name for billing, or null or an empty string to clear it.

At most 128 characters

Must match ^[^\p{C}]*$

address1stringrequired

The first line of the billing address.

1 to 255 characters

Must match ^[^\p{C}]*$

address2string | nullrequired

The second line of the billing address, or null or an empty string to clear it.

At most 255 characters

Must match ^[^\p{C}]*$

citystringrequired

The city for the billing address.

1 to 128 characters

Must match ^[^\p{C}]*$

statestring | nullrequired

The billing state, province, or region, or null or an empty string to clear it.

At most 128 characters

Must match ^[^\p{C}]*$

postcodestringrequired

The postal code for the billing address.

1 to 32 characters

Must match ^[^\p{C}]*$

countrystringrequired

The ISO 3166-1 alpha-2 country code.

Exactly 2 characters

phone_numberstringrequired

The phone number, including its country calling code.

4 to 32 characters

Must match ^\+[1-9][\d\s().-]*\d$

tax_idstring | nullrequired

The tax identification number, or null or an empty string to clear it.

At most 64 characters

Must match ^[^\p{C}]*$

Response 200

application/json

The record, as a JSON object. There is no envelope.

profileobjectrequired

The name and address used for billing. Missing values are null, not empty strings.

Show child attributes
first_namestring | nullrequired

The account holder's first name, or null when it is not provided.

last_namestring | nullrequired

The account holder's last name, or null when it is not provided.

company_namestring | nullrequired

The company name used for billing, or null when it is not provided.

address1string | nullrequired

The first line of the billing address, or null when it is not provided.

address2string | nullrequired

The second line of the billing address, or null when it is not provided.

citystring | nullrequired

The billing address city, or null when it is not provided.

statestring | nullrequired

The billing address state, province, or region, or null when it is not provided.

postcodestring | nullrequired

The billing address postal code, or null when it is not provided.

countrystring | nullrequired

An ISO 3166-1 alpha-2 code, or null where the stored value is not one.

country_namestring | nullrequired

The country display name, or null when the stored country code is not recognized.

phone_numberstring | nullrequired

The billing contact phone number, or null when it is not provided.

tax_idstring | nullrequired

The tax identification number, or null when it is not provided.

balanceobjectrequired

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
duestring | nullrequired

The total unpaid balance, formatted for display, or null when unavailable.

overduestring | nullrequired

The overdue balance, formatted for display, or null when unavailable.

creditstring | nullrequired

The available account credit, formatted for display, or null when unavailable.

unpaid_invoicesintegerrequired

The number of invoices with an outstanding balance.

overdue_invoicesintegerrequired

The number of overdue invoices.

has_duebooleanrequired

Whether the account has an unpaid balance.

has_overduebooleanrequired

Whether the account has an overdue balance.

currencystring | nullrequired

The three-letter billing currency code, or null when it is not known.

currencystring | nullrequired

The currency the account is billed in, or null when it is not known.

emailstring<email>required

The account email address. It cannot be changed through this endpoint.

email_verifiedboolean | nullrequired

Whether the email address is verified. Null means the billing record does not provide this information; it does not mean false.

portal_urlstring | nullrequired

A link to the external account portal, or null if no portal is configured.

Errors

400
The account's billing record could not be reached, this installation has none behind it, or the change was refused with a reason of its own. The message says which.
401
The key was missing, malformed, revoked, or belongs to an account that no longer exists.
403
Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
422
A field is missing or invalid, or the resource cannot accept this change in its current state. Check message for details. Field validation also includes an errors object keyed by field name.
429
Too many requests. The Retry-After header says how many seconds to wait. Limits are per account, so several keys on one account share them.