Automating Customer Statements via Email

Zoho Books API v3: Automating Customer Statements via Email

Zoho Books API v3: Automating Customer Statements via Email

Account statements provide a consolidated view of all transactions (Invoices, Payments, and Credit Notes) for a specific period. The Email Statement API allows you to programmatically trigger these documents to be sent to your customer's inbox, improving transparency and speed of collection.

At Kalki LLP, we use this endpoint to build "Monthly Auto-Statement" engines that ensure every client receives their balance summary on the 1st of every month without manual intervention.


1. The Action Request (POST)

To send a statement, you perform a POST request to the specialized /statements/email sub-resource.

Endpoint: POST /contacts/{contact_id}/statements/email?organization_id={organization_id}

Key Query Parameters

Unlike other endpoints, this one relies on parameters to define the statement's date range.

ParameterTypeDescription
start_dateDateRequired. Start date of the statement (YYYY-MM-DD).
end_dateDateRequired. End date of the statement (YYYY-MM-DD).

2. API Payload Example (JSON)

The body of the request allows you to customize the email recipients, subject line, and body text.

JSON
{
"to_mail_ids": ["finance@client.com", "owner@client.com"],
"subject": "Statement of Account from Kalki LLP Solutions",
"body": "Dear Customer, Please find attached your statement for the period of October 2023.",
"send_customer_statement_report_as_pdf": true
}

Kalki LLP Pro-Tip: Always set send_customer_statement_report_as_pdf to true to ensure the customer receives an easy-to-read attachment rather than just a plain text summary.


3. Implementation in Deluge (Kalki LLP Monthly Flow)

This script can be scheduled to run at the end of every month for all active customers with outstanding balances.

Code snippet
// Define Dates and IDs
contactID = "460000000026049";
orgID = "123456789";
startDate = "2023-10-01";
endDate = "2023-10-31";

// Construct the Payload
payload = Map();
payload.put("to_mail_ids", {"accounts@customer.com"});
payload.put("subject", "Monthly Statement - Kalki LLP");
payload.put("body", "Hi, Your monthly statement is attached.");
payload.put("send_customer_statement_report_as_pdf", true);

// Construct the URL with Date Parameters
urlPath = "https://www.zohoapis.in/books/v3/contacts/" + contactID + "/statements/email?organization_id=" + orgID + "&start_date=" + startDate + "&end_date=" + endDate;

// Execute the POST request
response = invokeurl
[
url :urlPath
type :POST
parameters :payload.toString()
connection :"kalki_books_connection"
];

if(response.get("code") == 0)
{
info "Kalki Success: Statement emailed for Customer: " + contactID;
}
else
{
info "Email failed: " + response.get("message");
}

4. Error Logs & Troubleshooting

Error CodeMeaningFix for Kalki LLP Developers
2Invalid IDThe contact_id provided is incorrect.
57UnauthorizedYour OAuth token lacks the ZohoBooks.contacts.CREATE or UPDATE scope.
1005Missing DatesYou forgot to include start_date or end_date in the URL query string.
1002Transaction ErrorNo transactions were found for this contact within the specified date range.

5. Strategic Value for Your Business

For kalkillp.com clients, automating statements leads to:

  1. Lower Days Sales Outstanding (DSO): Regular reminders of the total balance due encourage prompt payments.

  2. Dispute Reduction: Errors are caught early when customers review their monthly consolidated history.

  3. Customer Self-Service: Integrating this into a portal allows customers to generate their own statements on demand.


Automate Your Account Recievables with Kalki LLP

Sending statements manually is a drain on your accounting team's time. Kalki LLP can help you architect a fully automated notification system that keeps your customers informed and your cash flow healthy.

    • Related Articles

    • 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: Previewing Statement Email Content

      Zoho Books API v3: Previewing Statement Email Content The Get Statement Mail Content API is a diagnostic and preparation tool. It returns the rendered HTML and Subject line of a customer statement email based on the date range you provide. This is ...
    • Zoho Books API v3: Update Contact via Unique Custom Field

      Zoho Books API v3: Update Contact via Unique Custom Field Updating records via internal IDs can be a bottleneck. Zoho Books allows you to bypass the contact_id by using a Custom Field as a unique identifier. This endpoint also supports the Upsert ...
    • Zoho Books API v3: Enabling Client Portal Access

      Zoho Books API v3: Enabling Client Portal Access The Enable Portal Access API allows you to programmatically invite your customers to the Zoho Books Client Portal. This action sends an automated invitation email to the primary contact person ...