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.
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}
Unlike other endpoints, this one relies on parameters to define the statement's date range.
| Parameter | Type | Description |
start_date | Date | Required. Start date of the statement (YYYY-MM-DD). |
end_date | Date | Required. End date of the statement (YYYY-MM-DD). |
The body of the request allows you to customize the email recipients, subject line, and body text.
{
"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.
This script can be scheduled to run at the end of every month for all active customers with outstanding balances.
// 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");
}
| Error Code | Meaning | Fix for Kalki LLP Developers |
| 2 | Invalid ID | The contact_id provided is incorrect. |
| 57 | Unauthorized | Your OAuth token lacks the ZohoBooks.contacts.CREATE or UPDATE scope. |
| 1005 | Missing Dates | You forgot to include start_date or end_date in the URL query string. |
| 1002 | Transaction Error | No transactions were found for this contact within the specified date range. |
For kalkillp.com clients, automating statements leads to:
Lower Days Sales Outstanding (DSO): Regular reminders of the total balance due encourage prompt payments.
Dispute Reduction: Errors are caught early when customers review their monthly consolidated history.
Customer Self-Service: Integrating this into a portal allows customers to generate their own statements on demand.
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.