In Zoho Books, you cannot delete a contact that has associated transactions (Invoices, Bills, or Payments). Instead, the best practice is to mark them as Inactive. This hides the contact from search results and dropdowns, preventing accidental new transactions while maintaining historical integrity.
At Kalki LLP, we implement deactivation logic for clients who need to automatically "sunset" customers who haven't placed an order in over 24 months.
To deactivate a contact, you send a POST request to the specialized /inactive sub-resource.
Endpoint: POST /contacts/{contact_id}/inactive?organization_id={organization_id}
Method: POST
Authentication: Requires a valid OAuth token with ZohoBooks.contacts.UPDATE scope.
Body: This request does not require a JSON payload.
A successful deactivation returns a code: 0 and a confirmation message.
Sample JSON Response:
{
"code": 0,
"message": "The contact has been marked as inactive."
}
This script is useful for "cleanup" routines. For example, if a contact is marked as "Lost" or "Churned" in Zoho CRM, you can trigger this script to deactivate them in Zoho Books.
// Contact ID to deactivate
contactID = "460000000026049";
orgID = "123456789";
// Construct the Action URL
urlPath = "https://www.zohoapis.in/books/v3/contacts/" + contactID + "/inactive?organization_id=" + orgID;
// Execute the POST request via invokeurl
response = invokeurl
[
url :urlPath
type :POST
connection :"kalki_books_link"
];
if(response.get("code") == 0)
{
info "Kalki Success: Customer " + contactID + " is now hidden from active lists.";
}
else
{
info "Deactivation failed: " + response.get("message");
}
| Error Code | Meaning | Fix for Kalki LLP Developers |
| 2 | Invalid ID | The contact_id provided is incorrect or has already been deleted. |
| 57 | Unauthorized | Your OAuth token has expired or is missing the UPDATE scope. |
| 3032 | Already Inactive | The contact is already in an inactive state. |
| 6024 | Invalid Org | The organization_id does not match the account context. |
For kalkillp.com clients, we recommend the Inactive status for the following reasons:
Reporting Consistency: Inactive contacts still appear in historical Profit & Loss and Sales by Customer reports.
Reversibility: Unlike deletion, an inactive contact can be restored instantly using the Mark as Active API (Step 11 of our guide).
API Safety: Deleting a record is permanent; deactivating a record is a safe way to manage data lifecycle in automated syncs.
Is your Zoho Books cluttered with thousands of old, unused contact records? Kalki LLP can build automated "Bulk Deactivation" tools that identify inactive customers based on custom criteria and clean up your database without losing a single cent of financial history.