Marking a Contact as Inactive

Zoho Books API v3: Marking a Contact as Inactive

Zoho Books API v3: Marking a Contact as Inactive

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.


1. The Action Request (POST)

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}

Request Requirements:

  • Method: POST

  • Authentication: Requires a valid OAuth token with ZohoBooks.contacts.UPDATE scope.

  • Body: This request does not require a JSON payload.


2. API Response

A successful deactivation returns a code: 0 and a confirmation message.

Sample JSON Response:

JSON
{
"code": 0,
"message": "The contact has been marked as inactive."
}

3. Implementation in Deluge (Kalki LLP Logic)

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.

Code snippet
// 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");
}

4. Troubleshooting & Error Logs

Error CodeMeaningFix for Kalki LLP Developers
2Invalid IDThe contact_id provided is incorrect or has already been deleted.
57UnauthorizedYour OAuth token has expired or is missing the UPDATE scope.
3032Already InactiveThe contact is already in an inactive state.
6024Invalid OrgThe organization_id does not match the account context.

5. Strategic Advantage: Why "Inactive" over "Delete"?

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.


Clean Up Your Ledger with Kalki LLP

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.

    • Related Articles

    • Zoho Books API v3: Marking a Contact as Active

      Zoho Books API v3: Marking a Contact as Active When a contact is inactive in Zoho Books, they are hidden from the primary list and cannot be selected for new Invoices, Sales Orders, or Bills. The Mark as Active API is a specific "action" endpoint ...
    • Zoho Books vs Tally: Which is Right for Your Business in 2025?

      Overview: Why Compare Zoho Books and Tally in 2025? In 2025, modern businesses are moving fast—and their accounting software needs to keep up. Two widely used solutions in India are Tally and Zoho Books, but they differ significantly in approach, ...
    • Trigger Assignment and Workflow Rules in Zoho CRM via Deluge & API

      How to Trigger Workflow Rules in Zoho CRM Using Deluge When working with Zoho CRM automation, records created, updated, or deleted via Deluge do not trigger workflow or assignment rules automatically. This is expected behavior. Zoho CRM separates ...
    • Zoho Books API v3: Updating Contact Information

      Zoho Books API v3: Updating Contact Information Business relationships are dynamic—addresses change, contact persons move, and tax statuses get updated. The Update a Contact API allows you to programmatically modify any attribute of an existing ...
    • Zoho Books API v3: Retrieving Contact Comments and History

      Zoho Books API v3: Retrieving Contact Comments and History The List Comments API is a powerful auditing tool. It returns a chronological list of all interactions and internal notes associated with a specific customer or vendor. This is essential for ...