Contents
On this page
Update Account - Plugixa CRM
PUT /plugixa-crm/v1/accounts/{id}
Change some of an account’s fields. Only the fields you send change. PATCH works the same way.
Any user with access to Plugixa CRM. With Plugixa CRM Pro roles, the user’s role must also allow editing this account.
Request
PUT https://your-site.example/wp-json/plugixa-crm/v1/accounts/12
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The account’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank. |
type |
string |
No | customer, prospect, partner or supplier. Anything else is stored as customer. |
industry |
string |
No | Free text. |
sic_code |
string |
No | Free text. |
website |
string |
No | A URL. A value without a scheme gets http:// in front. |
email |
string |
No | An e-mail address. A value that is not one is stored empty. |
phone |
string |
No | Free text. |
status |
string |
No | Free text. |
billing_street |
string |
No | Billing address. |
billing_city |
string |
No | Billing address. |
billing_state |
string |
No | Billing address. |
billing_postal_code |
string |
No | Billing address. |
billing_country |
string |
No | Billing address. |
shipping_street |
string |
No | Shipping address. |
shipping_city |
string |
No | Shipping address. |
shipping_state |
string |
No | Shipping address. |
shipping_postal_code |
string |
No | Shipping address. |
shipping_country |
string |
No | Shipping address. |
description |
string |
No | HTML. Tags not allowed in post content are stripped. |
parent_id |
integer |
No | Must be an existing account, not this one, and must not make the hierarchy circular. 0 removes the parent. |
assigned_user_id |
integer |
No | The WordPress user who owns the account. 0 or nothing means none. |
modified_at |
string |
No | The modified_at you read. When sent, the update is refused if the account changed since: see Avoiding lost updates. |
A field you leave out keeps its value. A field you send empty is stored empty.
{
"type": "partner",
"phone": "+1 202 555 0199",
"modified_at": "2026-11-12 09:30:00"
}
Responses
200 OK. data is the updated account.
{
"success": true,
"data": {
"id": "12",
"name": "Northwind Traders",
"type": "partner",
"industry": "Wholesale",
"website": "https://northwind.example",
"email": "hello@northwind.example",
"phone": "+1 202 555 0199",
"billing_street": "",
"billing_city": "Seattle",
"billing_state": "WA",
"billing_postal_code": "98101",
"billing_country": "United States",
"shipping_street": "",
"shipping_city": "",
"shipping_state": "",
"shipping_postal_code": "",
"shipping_country": "",
"parent_id": null,
"description": "",
"status": "active",
"assigned_user_id": "3",
"created_by": "1",
"modified_by": "1",
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 10:15:00",
"deleted_at": null,
"sic_code": "",
"contacts": [
{
"id": 7,
"account_id": 12,
"contact_id": 31,
"role": "Buyer",
"is_primary": 1,
"is_inactive": 0,
"created_at": "2026-11-12 09:30:00",
"full_name": "Maria Anders",
"title": "Purchasing manager",
"email": "maria@northwind.example"
}
],
"children": []
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
string |
The account’s id. Account fields come back as strings, numbers included |
data.name |
string |
The account’s name |
data.type |
string |
customer, prospect, partner or supplier |
data.modified_at |
string |
UTC datetime of the last change |
data.contacts |
array |
The contacts linked to the account, primary links first: the link (id, role, is_primary) plus the contact’s full_name, title and email |
data.children |
array |
Live accounts whose parent is this one, by name, at most 200 |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_crm_not_found |
No account with that id, or it is in the trash. |
422 |
plugixa_crm_invalid_parent |
parent_id is this account, is not an existing account, or would make the hierarchy circular. |
409 |
plugixa_crm_conflict |
You sent modified_at and the account changed since. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-crm/v1/accounts/12" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"type":"partner","phone":"+1 202 555 0199","modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/accounts/12');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'type' => 'partner',
'phone' => '+1 202 555 0199',
'modified_at' => '2026-11-12 09:30:00',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-crm/v1/accounts/12', {
method: 'PUT',
headers: {
'Authorization': auth,
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'partner',
phone: '+1 202 555 0199',
modified_at: '2026-11-12 09:30:00',
}),
});
const { data } = await response.json();
Quick Links
Share