Integrations / Zoho Books

Zoho Books logo

CRM & ERP · Workflow custom function (Deluge)

Zoho Books + Sendjade

Send invoices and payment reminders to customers from Zoho Books workflows.

Works with the live API

What you can automate

  • Send the invoice PDF when an invoice is sent
  • Send a reminder when an invoice becomes overdue
  • Thank customers when a payment is recorded

Before you start

  • A Sendjade account with a connected instance (status Authorized). See Getting started.
  • Your **idInstance** (shown on the instance page in the console) and **apiTokenInstance** (shown once when you created the instance; press Generate new token if you lost it). Use a spare number while testing.
  • Zoho Books with Workflow Rules and Custom Functions available on your plan.

Set it up

  1. Create a workflow rule

    In Settings, Automation, Workflow Rules create a rule on Invoices (for example "when an invoice is created"), then add the action Custom Function.

  2. Paste the function

    Add invoice as an argument. Keep the idInstance and token in a Zoho connection or constants, not in the function body.

    Deluge
    phone = invoice.get("phone");
    payload = Map();
    payload.put("chatId", phone);
    payload.put("message", "Hi " + invoice.get("customer_name") + ", invoice " + invoice.get("invoice_number") + " for " + invoice.get("total") + " is ready. Due " + invoice.get("due_date") + ".");
    
    headers = Map();
    headers.put("Content-Type", "application/json");
    headers.put("Idempotency-Key", "zb-" + invoice.get("invoice_id"));
    
    resp = invokeurl
    [
      url :"https://api.sendjade.com/waInstanceYOUR_ID_INSTANCE/sendMessage/YOUR_API_TOKEN_INSTANCE"
      type :POST
      parameters :payload.toString()
      headers :headers
    ];
    info resp;
  3. Send the PDF too (optional)

    Use sendFileByUrl with urlFile set to a link where the invoice PDF can be downloaded without signing in, fileName set to the invoice number and the invoice text as caption. The customer receives a real attachment.

    URL
    https://api.sendjade.com/waInstanceYOUR_ID_INSTANCE/sendFileByUrl/YOUR_API_TOKEN_INSTANCE

Test it

Create a draft invoice for a customer with your own number. Check **Info logs** in the function run for the idMessage response.

Troubleshooting

The customer has no phone on the invoice

Read the phone from the contact record (customer_id) or add a custom field, and skip the call when it is empty.

I get 401 unauthorized

The idInstance or token in the URL is wrong. Copy both again from the console. Generating a new token makes the old one stop working immediately.

I get 409 instance_not_connected

The instance is not Authorized yet. Open it in the console, press Connect and scan the QR code.

I get 400 invalid_chat_id

Use international format with digits only, e.g. 2348012345678 (or 2348012345678@c.us). Remove spaces, dashes and the leading zero of the local number.

I get 422 recipient_opted_out

That person replied STOP (or was added to the opt-out list). Sendjade refuses to message them. Remove the number from Opt-outs only if they asked to hear from you again.

I get 429 daily_limit_reached or rate_limited

The number reached its 24-hour sending cap (default 500) or you are calling too fast. The cap protects your number from restriction. Slow down, and raise the cap only if your volume is genuine.

Ask AI to help me integrate Zoho Books

Copy this prompt into ChatGPT, Claude or any assistant. It already knows Sendjade’s API, so the answer matches our endpoints.

The prompt is plain text that you copy yourself. Never paste real keys into an assistant; use placeholders.