Create a Rule

Now that the Publisher and the Event Function are configured, let us define how the events should be processed and delivered by setting up a Rule.

Follow these steps to create the Rule:

  1. In the Developer Console, select your project: InvoiceNotifier.

  2. Go to Catalyst Signals and click on Rules in the left navigation.

Add Rule
  1. Click Add Rule, then provide a name and description for your rule.
Provide name and description for the Rule

Define Event Source

  1. Under Source, click Choose Event, and select the Zoho Books Publisher you added earlier.

  2. From the list of available events, choose Customer Payment Created, then click Done.

Configure the publisher and event for the rule

Define Event Filter

  1. In the Filter section, click the edit icon and choose Events matching certain conditions.
Select Events matching certain conditions
  1. Create a filter condition to include only events where the invoice status is Paid:
  • In the Path dropdown, select the JSON path that corresponds to the payment_status field.
  • Define the condition to match Paid.
  1. Click Save to apply the filter.
Configure filter for the rule

Configure Target Settings

  1. Click Choose Target and give your target a name.

  2. Under Consumer Type, select the Event Function we created earlier using the CLI.

  3. Set the Dispatch Policy to Batch by Interval:

  • Choose an interval of one hour.
  • Set the Retry Count to five.
Configure target settings

Transform the Payload

  1. In the Target Input section, choose Transform.

  2. From the default event payload of the Customer Payment Created event, select only the required data and structure them as shown below.

    
Expected Event Payload
copy
{ "data" : [ [ { "Customer" : "test", "Invoice Number" : "Customer opening balance", "Amount" : "₹3,24,244.00", "Paid On" : "31/10/2023", "Invoice Id" : "275557000000158181" } ] ] }
View more
    
Data Mapping for Template Compiler
copy
{ "data" : $.events.forEach((event)-> event.data.payment.invoices.forEach((invoice)-> { "Customer" : event.data.payment.customer_name, "Invoice Number" : invoice.invoice_number, "Amount" : invoice.total_formatted, "Paid On" : event.data.payment.date_formatted, "Invoice Id" : invoice.invoice_id } ) ) }
View more

Paste this structure into the template compiler to extract the required fields and click Generate Output.

Event Body Transformation

Check out the Even Body Transformation help guide to learn how to customize event payloads in detail.

  1. Save the target configurations, then click Save again to finalize the rule.

Now, whenever a customer completes a payment, the corresponding invoice in Zoho Books is updated. This update triggers an event that is processed every hour in Catalyst Signals and automatically sends a summarized message to the Zoho Cliq channel.

Invoice Notifier

Last Updated 2025-06-10 18:26:01 +0530 +0530