cURL
curl -X PUT "$EXSITED_BASE_URL/api/v4/accounts/ACC0001" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"account": {
"name": "Acme Pty Ltd",
"type": "CUSTOMER"
}
}'from exsited import build_client
client = build_client()
response = client.accounts.replace_account(
"ACC0001", {"account": {"name": "Acme Pty Ltd", "type": "CUSTOMER"}}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.accounts.replaceAccount('ACC0001', {account: {name: 'Acme Pty Ltd', type: 'CUSTOMER'}});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->accounts->replaceAccount('ACC0001', [
'account' => ['name' => 'Acme Pty Ltd', 'type' => 'CUSTOMER'],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.accounts.accounts_dto.AccountsDto.Account;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Account> response = client.accounts().replaceAccount(
"ACC0001",
Map.of("account", Map.of("name", "Acme Pty Ltd", "type", "CUSTOMER")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Accounts.ReplaceAccountAsync(
"ACC0001",
new Dictionary<string, object?>
{
["account"] = new Dictionary<string, object?>
{
["name"] = "Acme Pty Ltd",
["type"] = "CUSTOMER",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.accounts.replaceAccount('ACC0001', {
'account': {'name': 'Acme Pty Ltd', 'type': 'CUSTOMER'},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Accounts().ReplaceAccount(context.Background(), "ACC0001", map[string]any{
"account": map[string]any{"name": "Acme Pty Ltd", "type": "CUSTOMER"},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"account": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"status": "<string>",
"type": "<string>",
"display_name": "<string>",
"email_address": "<string>",
"description": "<string>",
"currency": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>"
},
"time_zone": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"tax": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"custom_form": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"parent_account_id": "<string>",
"image_url": "<unknown>",
"workflow_status": "<string>",
"social_links": {
"website": "<string>",
"linkedin": "<string>",
"twitter": "<string>",
"facebook": "<string>"
},
"communication_preferences": [
{
"channel": "<string>",
"enabled": true
}
],
"invoice_parent_account": true,
"portal_access": true,
"origin": "<string>",
"group": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"manager": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"sales_rep": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"user_team": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"accounting_code": {
"account_receivable": "<string>"
},
"pricing_level": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"referral_tracking": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123,
"href": "<string>",
"addresses": [
{
"object": "<string>",
"id": "<string>",
"address_line_1": "<string>",
"address_line_2": "<string>",
"address_line_3": "<string>",
"address_line_4": "<string>",
"address_line_5": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"default_billing": true,
"default_shipping": true,
"href": "<string>"
}
],
"contacts": [
{
"object": "<string>",
"id": "<string>",
"type": "<string>",
"billing_contact": true,
"shipping_contact": true,
"receives_billing_information": true,
"name": {
"salutation": "<string>",
"first": "<string>",
"middle": "<string>",
"last": "<string>",
"designation": "<string>"
},
"email": {
"address": "<string>",
"do_not_email": true,
"email_opted_out": true
},
"phone": {
"country_code": "<string>",
"area_code": "<string>",
"number": "<string>",
"do_not_call": true,
"call_opted_out": true,
"dialing_code": "<string>",
"formatted": "<string>"
},
"mobile": {
"country_code": "<string>",
"area_code": "<string>",
"number": "<string>",
"do_not_call": true,
"call_opted_out": true,
"dialing_code": "<string>",
"formatted": "<string>"
},
"fax": {
"country_code": "<string>",
"area_code": "<string>",
"number": "<string>",
"do_not_call": true,
"call_opted_out": true,
"dialing_code": "<string>",
"formatted": "<string>"
},
"address": {
"city": "<string>",
"country": "<string>",
"country_code": "<unknown>",
"line_1": "<string>",
"line_2": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"custom_attributes": [
{
"name": "<string>",
"value": "<unknown>"
}
],
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123
}
],
"payment_methods": [
{
"object": "<string>",
"id": "<string>",
"processor_type": "<string>",
"status": "<string>",
"default": true,
"restricted_to_orders": true,
"specified_order_ids": "<unknown>",
"processor": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"reference": "<string>",
"payment_count": 123,
"last_used_at": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123
}
],
"billing_preferences": {
"communication_profile": "<string>",
"invoice_mode": "<string>",
"invoice_term": "<string>",
"billing_period": "<string>",
"billing_start_date": "<string>",
"billing_start_day_of_month": 123,
"charges_aligned_to_billing": true,
"payment_processor": "<string>",
"payment_mode": "<string>",
"payment_term": "<string>",
"payment_term_alignment": "<string>",
"consolidate_invoice": true,
"fulfillment_mode": "<string>",
"fulfillment_term": "<string>",
"proforma_properties": "<unknown>",
"communication_group": "<string>",
"billing_mode": "<string>",
"charging_period": "<string>",
"charging_and_billing_alignment": "<string>",
"charging_start_date": "<string>",
"event_profile": "<string>"
},
"custom_attributes": [
{
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>",
"type": "<string>",
"value": "<unknown>"
}
],
"custom_objects": [
{
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
}
],
"inventories": "<array>",
"partial_invoices": "<array>",
"activity_logs": "<array>",
"payment_method": {
"object": "<string>",
"id": "<string>",
"processor_type": "<string>",
"status": "<string>",
"default": true,
"restricted_to_orders": true,
"specified_order_ids": "<unknown>",
"processor": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"reference": "<string>",
"payment_count": 123,
"last_used_at": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123
},
"tax_id": "<unknown>",
"tax_id_number": "<unknown>"
}
}{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Accounts
Replace an account
Rewrites an account’s fields and returns the account.
PUT
/
accounts
/
{account_id}
cURL
curl -X PUT "$EXSITED_BASE_URL/api/v4/accounts/ACC0001" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"account": {
"name": "Acme Pty Ltd",
"type": "CUSTOMER"
}
}'from exsited import build_client
client = build_client()
response = client.accounts.replace_account(
"ACC0001", {"account": {"name": "Acme Pty Ltd", "type": "CUSTOMER"}}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.accounts.replaceAccount('ACC0001', {account: {name: 'Acme Pty Ltd', type: 'CUSTOMER'}});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->accounts->replaceAccount('ACC0001', [
'account' => ['name' => 'Acme Pty Ltd', 'type' => 'CUSTOMER'],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.accounts.accounts_dto.AccountsDto.Account;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<Account> response = client.accounts().replaceAccount(
"ACC0001",
Map.of("account", Map.of("name", "Acme Pty Ltd", "type", "CUSTOMER")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Accounts.ReplaceAccountAsync(
"ACC0001",
new Dictionary<string, object?>
{
["account"] = new Dictionary<string, object?>
{
["name"] = "Acme Pty Ltd",
["type"] = "CUSTOMER",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.accounts.replaceAccount('ACC0001', {
'account': {'name': 'Acme Pty Ltd', 'type': 'CUSTOMER'},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Accounts().ReplaceAccount(context.Background(), "ACC0001", map[string]any{
"account": map[string]any{"name": "Acme Pty Ltd", "type": "CUSTOMER"},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"account": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"status": "<string>",
"type": "<string>",
"display_name": "<string>",
"email_address": "<string>",
"description": "<string>",
"currency": {
"code": "<string>",
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>"
},
"time_zone": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"tax": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"custom_form": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"parent_account_id": "<string>",
"image_url": "<unknown>",
"workflow_status": "<string>",
"social_links": {
"website": "<string>",
"linkedin": "<string>",
"twitter": "<string>",
"facebook": "<string>"
},
"communication_preferences": [
{
"channel": "<string>",
"enabled": true
}
],
"invoice_parent_account": true,
"portal_access": true,
"origin": "<string>",
"group": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"manager": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"sales_rep": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"user_team": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"accounting_code": {
"account_receivable": "<string>"
},
"pricing_level": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
},
"referral_tracking": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123,
"href": "<string>",
"addresses": [
{
"object": "<string>",
"id": "<string>",
"address_line_1": "<string>",
"address_line_2": "<string>",
"address_line_3": "<string>",
"address_line_4": "<string>",
"address_line_5": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postal_code": "<string>",
"default_billing": true,
"default_shipping": true,
"href": "<string>"
}
],
"contacts": [
{
"object": "<string>",
"id": "<string>",
"type": "<string>",
"billing_contact": true,
"shipping_contact": true,
"receives_billing_information": true,
"name": {
"salutation": "<string>",
"first": "<string>",
"middle": "<string>",
"last": "<string>",
"designation": "<string>"
},
"email": {
"address": "<string>",
"do_not_email": true,
"email_opted_out": true
},
"phone": {
"country_code": "<string>",
"area_code": "<string>",
"number": "<string>",
"do_not_call": true,
"call_opted_out": true,
"dialing_code": "<string>",
"formatted": "<string>"
},
"mobile": {
"country_code": "<string>",
"area_code": "<string>",
"number": "<string>",
"do_not_call": true,
"call_opted_out": true,
"dialing_code": "<string>",
"formatted": "<string>"
},
"fax": {
"country_code": "<string>",
"area_code": "<string>",
"number": "<string>",
"do_not_call": true,
"call_opted_out": true,
"dialing_code": "<string>",
"formatted": "<string>"
},
"address": {
"city": "<string>",
"country": "<string>",
"country_code": "<unknown>",
"line_1": "<string>",
"line_2": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"custom_attributes": [
{
"name": "<string>",
"value": "<unknown>"
}
],
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123
}
],
"payment_methods": [
{
"object": "<string>",
"id": "<string>",
"processor_type": "<string>",
"status": "<string>",
"default": true,
"restricted_to_orders": true,
"specified_order_ids": "<unknown>",
"processor": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"reference": "<string>",
"payment_count": 123,
"last_used_at": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123
}
],
"billing_preferences": {
"communication_profile": "<string>",
"invoice_mode": "<string>",
"invoice_term": "<string>",
"billing_period": "<string>",
"billing_start_date": "<string>",
"billing_start_day_of_month": 123,
"charges_aligned_to_billing": true,
"payment_processor": "<string>",
"payment_mode": "<string>",
"payment_term": "<string>",
"payment_term_alignment": "<string>",
"consolidate_invoice": true,
"fulfillment_mode": "<string>",
"fulfillment_term": "<string>",
"proforma_properties": "<unknown>",
"communication_group": "<string>",
"billing_mode": "<string>",
"charging_period": "<string>",
"charging_and_billing_alignment": "<string>",
"charging_start_date": "<string>",
"event_profile": "<string>"
},
"custom_attributes": [
{
"href": "<string>",
"id": "<string>",
"name": "<string>",
"object": "<string>",
"type": "<string>",
"value": "<unknown>"
}
],
"custom_objects": [
{
"object": "<string>",
"id": "<string>",
"name": "<string>",
"code": "<string>",
"href": "<string>",
"rate": 123
}
],
"inventories": "<array>",
"partial_invoices": "<array>",
"activity_logs": "<array>",
"payment_method": {
"object": "<string>",
"id": "<string>",
"processor_type": "<string>",
"status": "<string>",
"default": true,
"restricted_to_orders": true,
"specified_order_ids": "<unknown>",
"processor": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"href": "<string>"
},
"reference": "<string>",
"payment_count": 123,
"last_used_at": "<string>",
"created_on": "<string>",
"last_updated_on": "<string>",
"created_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"last_updated_by": {
"object": "<string>",
"id": "<string>",
"name": "<string>",
"email": "<string>",
"href": "<string>"
},
"version": 123
},
"tax_id": "<unknown>",
"tax_id_number": "<unknown>"
}
}{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Send the fields under
account. name and type are required on every call. A field the body leaves out keeps its value. status, addresses, payment_methods, grant_portal_access and grant_portal_password are refused. A contacts entry with an id updates that contact; one without an id creates a contact and needs a type.
The SDK samples get their client from credentials your app registers once when it starts, as shown in Authentication. To try the call here, click Try it, set
host to your Exsited API host name and paste an access token from Get an access token. To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its -d payload.Authorizations
An access token from POST /api/v4/oauth2/token. The SDKs get and renew it for you.
Path Parameters
The account's id, such as ACC0001. Not its uuid.
Body
application/json
Show child attributes
Show child attributes
Response
The account, under account, with the change applied.
The account, under account.
One account.
Show child attributes
Show child attributes