Contents
Create Account - Plugixa CRM
POST /plugixa-crm/v1/accounts
Create an account: a company you sell to, buy from or work with.
Any user with access to Plugixa CRM. With Plugixa CRM Pro roles, the user’s role must also allow creating accounts.
parent_idis not checked on create. Any number is stored, even one that is not an account. Update Account does check it.
Request
POST https://your-site.example/wp-json/plugixa-crm/v1/accounts
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | Must not be blank. |
type |
string |
No | customer, prospect, partner or supplier. Anything else, or nothing, 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. Defaults to active. |
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 | The parent account. 0 or nothing means none. |
assigned_user_id |
integer |
No | The WordPress user who owns the account. 0 or nothing means none. |
Fields not in this table are ignored.
{
"name": "Northwind Traders",
"type": "customer",
"industry": "Wholesale",
"website": "https://northwind.example",
"email": "hello@northwind.example",
"phone": "+1 202 555 0143",
"billing_city": "Seattle",
"billing_state": "WA",
"billing_postal_code": "98101",
"billing_country": "United States",
"assigned_user_id": 3
}
Responses
201 Created. data is the new account.
{
"success": true,
"data": {
"id": "12",
"name": "Northwind Traders",
"type": "customer",
"industry": "Wholesale",
"website": "https://northwind.example",
"email": "hello@northwind.example",
"phone": "+1 202 555 0143",
"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 09:30:00",
"deleted_at": null,
"sic_code": "",
"contacts": [],
"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.status |
string |
Free text, active unless you set something else |
data.parent_id |
string|null |
The parent account’s id |
data.assigned_user_id |
string|null |
The WordPress user who owns the account |
data.created_at |
string |
UTC datetime |
data.modified_at |
string |
UTC datetime of the last change |
data.deleted_at |
string|null |
UTC datetime it was moved to the trash, else null |
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 |
|---|---|---|
422 |
plugixa_crm_invalid_name |
name is missing or blank. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-crm/v1/accounts" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"name":"Northwind Traders","type":"customer","industry":"Wholesale","website":"https://northwind.example","email":"hello@northwind.example","phone":"+1 202 555 0143","billing_city":"Seattle","billing_state":"WA","billing_postal_code":"98101","billing_country":"United States","assigned_user_id":3}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/accounts');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Northwind Traders',
'type' => 'customer',
'industry' => 'Wholesale',
'website' => 'https://northwind.example',
'email' => 'hello@northwind.example',
'phone' => '+1 202 555 0143',
'billing_city' => 'Seattle',
'billing_state' => 'WA',
'billing_postal_code' => '98101',
'billing_country' => 'United States',
'assigned_user_id' => 3,
]),
]);
$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', {
method: 'POST',
headers: {
'Authorization': auth,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Northwind Traders',
type: 'customer',
industry: 'Wholesale',
website: 'https://northwind.example',
email: 'hello@northwind.example',
phone: '+1 202 555 0143',
billing_city: 'Seattle',
billing_state: 'WA',
billing_postal_code: '98101',
billing_country: 'United States',
assigned_user_id: 3,
}),
});
const { data } = await response.json();
Quick Links
Share