POST
Customer.Delete
Move a customer to dashboard trash (folder 5) when the active user has permission. Matches Admin delete_client_details: sets folders to ["5"], blocks customers that have documents (except order_proposals), and sends customer.deleted.
Permissions
- User must be allowed to remove this customer.
- Permanent delete from trash requires delete-from-trash permission.
Action
- Moves the customer to dashboard trash by setting folders to ["5"] and archive = 1.
- Keeps the customer id so Customer.Restore can put the customer back in folder 1.
- If the customer is already in trash (folder 5) or spam (folder 6), send confirm_delete_forever=1 for a permanent delete.
Push Service
Pushes the removed customer id to team members so active lists can refresh.
Automation
Runs automation event customer.deleted with customer_id when enabled.
Special Instructions
- Dashboard trash is folder 5, not archive-only. Response customer_id is the database id of the row that was updated.
- Customers with documents (except order_proposals) cannot be deleted, same as the dashboard.
- Permanent delete from trash requires owner/member-admin and confirm_delete_forever=1.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
customer_idpost | int | 123 | Customer id to delete. You may also send id. |
Optional Parameters
No optional body parameters are defined for this function.
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Customer.Delete",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": [],
"url_user": "https:\/\/{user}.bull36.com\/app\/Customer.Delete",
"url_domain": "https:\/\/{domain}\/app\/Customer.Delete"
}Endpoint
POST /app/Customer.Delete
POST https://{user}.bull36.com/app/Customer.Delete
POST https://{domain}/app/Customer.DeleteSample Output
{
"success": 1,
"message": "Customer moved to trash",
"customer_id": 123,
"automation_event": "customer.deleted",
"socket_event": "customer.deleted"
}Fail Response
{
"success": 0,
"message": "You have no permission to delete customer"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
// Fill body fields from the Sample Request JSON above.
const res = await fetch('/app/Customer.Delete', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": 0,
"message": "You have no permission to delete customer"
}