Create Zoho Invoices with multiple products from Notion

Hey guys,

I’m trying to fully automate invoicing and want to create new Zoho Invoices when I create an invoice in Notion.

In Notion I have an Invoices databasethat pulls data from the client database (company and contact info) and sales lines (another database, related to invoice database to fetch sales lines, including qty, price, description, line discount etc.)

When I chance the status in Notion to “Generate”, I want it to check for client records in Zoho, create a new one if it doesn’t exist and create an invoice based on data from Notion.

Now I had already a simpler automation before and it worked fine - it didn’t look for client records, and the Notion invoice only had one sales line so it wasn’t a problem. Now I am extending this automation but I’m having trouble.

This is what I built so far:

The problem already happens on the “create client” part where not all info is transfered okay. For example I have a custom field in Zoho that is not being filled with data from Notion but I don’t know why.

Then the biggest problem happens with transfering sales invoice lines to Zoho. When there are multiple sales lines, the automation breaks and throws an error.

Any thoughts on how to make it happen?

Hi @Eva

Could you please send the screenshots of your module mappings you are having problem and the error?

For any assistance related to Make.com, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

When you add line items to a Zoho Invoice (and most invoicing systems), you need to supply a structured data object. Before your Zoho Invoice module, you should have maybe a JSON aggregator (with the structure mapped to the Zoho Invoice Line Item structure). Before the aggregator you would have an Iterator or some other module that outputs multiple bundles, which in this case appears to be the Fetch Sales Lines.

4 Likes

So like this basically:

Donald I saw you had a contact under your profile so I scheduled a call with you just so I understand this better. I never used a JSON aggregator before, so a nudge in the right direction might do the thing :slight_smile: Hope that’s alright.

Sure, no problem.
The other thing about Zoho is that when you add a line item, you have to link to a product created in Zoho. So for each line item, you have to already know what is the Zoho product ID and if it doesn’t exist, create it.

3 Likes

Really? That’s odd. Because Zoho allows me to just free write the name of the product in the UI.

Is this Make automation specific that you need to first create the items?

I’ll have to take a closer look and see what the deal is. Right now I’m using the built-in module to create an invoice and the Make an API Call to add line items. I forget what kept me from just using the built-in module to create the entire invoice.

3 Likes

So when you create an invoice via the built-in Zoho module, Item ID is required when adding line items.

When you create an invoice via API (which is how Make does it), you must specify line_items and within that object you must specify item_id.

I imagine the Make module requires it because the documentation says it’s required.

When I attempted to create items by leaving item_id blank, it told me I needed to specify an item_id.
When I attempted to create items by specifying a random ID, it told me the Item didn’t exist.

So this is what I meant by item_id being required when creating invoices via API.

In the Web UI, when you create line items without actually clicking the Add New Item button shown below, that still creates an Item in the back end, you just can’t really do anything with the item.

image

When you create an actual Item on your Items page (or by click “Add New Item” when you create the invoice line), you can create reports on those items.

In this example, “Random Line Item” still has its own Item ID, but I can’t see it in my Items list.

Hope that makes sense. I tried searching for more info on this but didn’t have any luck so I reached out to Zoho support to find out more.

4 Likes

Makes sense! I’ll adjust my automation prior to our call to reflect that so that on the call we can only discuss the iterator and aggregator modules. That was really insightful!

Just to follow up on this… I heard back from Zoho.

Apparently, when adding line_items, item_id is actually optional.

They said just to specify the name and description, but didn’t say whether those two were required.
I know from experience description is optional, just not sure about name.

2 Likes

Perfect, thanks for all your help Donald!

1 Like