Tip #1 Automating online sales order to invoice conversions in Zoho Inventory

Tip #1 Automating online sales order to invoice conversions in Zoho Inventory


Hello,
 
Hope the day is treating you well.
We've been getting more than a few requests from online sellers who use Zoho Inventory to help them automate invoice generation for all online orders that drop into Zoho Inventory automatically from a sales channel or a shopping cart that they have integrated. Are you an online seller like them? Then we've got some exciting news for you. You can do it with the help of a few simple things that we'll see here today.

So how do we go about this?
If you have integrated online sales channels like Amazon, Etsy and Ebay or a shopping cart like Shopify to Zoho Inventory, then you will be aware of sales orders being automatically generated inside of Zoho Inventory whenever your online customers buy something from you through these integrated channels. Since invoices are generated and automatically sent to your clients by the channel, you have little need of the invoices inside of Zoho Inventory apart from accounting purposes. Depending on the amount of online orders you get per day, it can get tricky to convert these orders into invoices manually. So we are going to automate this part for you with the help of a simple custom function. 
 
Wondering what custom functions are? They are one of the automation tools at your disposal inside of Zoho Inventory and can be accessed inside of Settings. To know more about custom functions in general, please refer to our help document.
 
Now let's see how we can write one to automatically convert all online sales orders into invoices as soon as they are generated within Zoho Inventory. 
 
Log in to your Zoho account and click on this link to generate an Auth Token which is required to make this work.
 
1) Open your Zoho Inventory organization.
2) Navigate to Settings using the gear icon from the top-right corner.
3) Select Automation from the sidebar. Click on the +New Workflow Rule button that is found at the top-right corner.
4) Out of the four tabs within Automation, select Custom Functions.
5) Now let's add a name for this workflow rule. (Note: Name cannot contain spaces)
6) The module to be chosen is Sales Orders.
7) Add a description if you need one.
8) Now, the workflow type is going to be Event Based.
9) And for the trigger, choose the option - "When a Sales Order is" "Created".
10) In the deluge pane, copy and paste the following code snippet:
 
salesorderID = salesorder.get("salesorder_id");
salesorderdate = salesorder.get("date").toDate();
organizationID = organization.get("organization_id");
authtoken = "
Copy and Paste your auth token in place of this text";
sal = invokeurl
[
url :"
https://inventory.zoho.com/api/v1/salesorders/" + salesorderID + "?authtoken=" + authtoken + "&organization_id=" + organizationID
type :GET
];
temp = sal.get("salesorder");
// info temp;
new = temp.get("sales_channel");
if(!new.equalsIgnoreCase("direct_sales"))
{
bson = Map();
customerID = salesorder.get("customer_id").toString();
salesoderdate = salesorder.get("date").toDate();
//invoice_number = salesorder.get("salesorder_number").replaceFirst("SO","INV");
//bson.put("invoice_number",);
bson.put("customer_id",customerID);
bson.put("date",salesorder.get("date"));
lineItems = salesorder.get("line_items").toList();
newLineItems = List();
for each lineItem in lineItems
{
lineItemMap = Map();
solineitemID = lineItem.get("line_item_id");
lineItemMap.put("salesorder_item_id",solineitemID);
id = lineItem.get("item_id");
lineItemMap.put("item_id",id);
des = lineItem.get("description");
lineItemMap.put("description",des);
wh = lineItem.get("warehouse_id");
lineItemMap.put("warehouse_id",wh);
quantity = lineItem.get("quantity");
lineItemMap.put("quantity",quantity);
r = lineItem.get("rate");
lineItemMap.put("rate",r);
d = lineItem.get("discount");
lineItemMap.put("discount",d);
tidd = lineItem.get("tax_id");
lineItemMap.put("tax_id",tidd);
tex = lineItem.get("tax_exemption_code");
lineItemMap.put("tax_exemption_code",tex);
newLineItems.add(lineItemMap);
}
bson.put("line_items",newLineItems);
if(temp.get("is_taxable").equalsIgnoreCase("true"))
{
bson.put("tax_id",temp.get("tax_id"));
}
else
{
bson.put("tax_exemption_id",temp.get("tax_exemption_id"));
bson.put("tax_authority_id",temp.get("tax_authority_id"));
}
response = zoho.inventory.createRecord("Invoices",organizationID,bson);
info bson;
info response.toMap().get("message");
inv = response.get("invoice");
info inv.get("invoice_id");
//marking as sent//
invoiceID = inv.get("invoice_id");
invoicedate = inv.get("date").toDate();
respond = invokeurl
[
url :"
https://inventory.zoho.com/api/v1/invoices/" + invoiceID + "/status/sent?authtoken=" + authtoken + "&organization_id=" + organizationID
type :POST
];
info respond.toMap().get("message");
}
else
{
info "Order is not from a Marketplace";
}
 
11) Before you save, you are required to copy and paste your auth token inside the quotes in the 4th line that says: authtoken = "Copy and Paste your auth token in place of this text";
Note: The auth token is a critical piece of information that helps the system identify you, so keep yours safe and confidential. Do not share it with anyone, not even with folks from Zoho.
12) Now, hit Save to finish.
 
Henceforth, all your online sales orders that are auto-generated from Amazon, Etsy, Ebay or Shopify will be automatically converted to invoices. And the status of these invoices inside of Zoho Inventory will be Sent. If you wish to auto-generate invoices of Paid status, then it can be made possible with a few changes. You can either experiment that part by yourself or contact us at support@zoho-inventory.com
 
Note: If you need this automation only for one channel, say for Shopify alone and not other channels, then you need to make a few changes to line 13 that originally says - if(!new.equalsIgnoreCase("direct_sales")) to if(new.equalsIgnoreCase("shopify"))
 
Hope this helps you in your online selling endeavors. Oh and by the way, have you ever dabbled with the custom functions module by yourself? You can share your discoveries, questions and suggestions with us anytime. We look forward to hearing from you. (Email us: support@zoho-inventory.com)
 
Until next time.
 
Your everyday end user,
Ajay Aadhithya Chandrasekaran
Zoho Inventory


    • Recent Topics

    • Zoho Workplace gets yet another security boost: The addition of Zoho Vault

      Hello Community, Passwords are often the first line of defense, yet they're also one of the most common weak points. We're thrilled to announce that Zoho Vault is now integrated with Zoho Workplace! Zoho Vault Standard is now included at no extra cost
    • Where is the customization and extendibility of zoho inventory?

      After delving into zoho one subscription to test out systems we need for our business, I'm really disappointed after working in Zoho Inventory. Its features and customizability are extremely lacking compared to the other tools like CRM. In our case we
    • Deleted message in SPAM

      In one of my gmail accounts (getnickifit@gmail.com) I had an email from PayPal in the SPAM folder. I thought I was moving the message to the inbox from the zoho mobile but it looks like it was deleted. It is no where to be found--inbox, trash, etc. Can it be restored?
    • How to send binary data in invokeurl task?

      Hello, I am using Adobe's Protect PDF API. Source: https://developer.adobe.com/document-services/docs/overview/pdf-services-api/ Everything works fine in Postman. But for some reason after encrypting the file, it is empty after password protecting the
    • "notes"-field in a task to full width?

      Hi, Is there someone that can tell me how to adjust the "notes"-field in a task, to full width? I already played around with 1 or 2 columns, but this has nu effect on the standard width. Thx in advance for your help. Cheers, Ralph.
    • Search function not working anymore

      Hi! The search function is not working anymore. How can we solve this problem?
    • Set up multiple IMAP email addresses

      Hi, I just started using CRM and its great, but I just found out I can only add one imap email address for incoming mail in the included salesinbox ...this is ridiculous. All companies have different email such as sales@domain, info@domain , personal@domain
    • How to download Job Sheets in Zoho FSM?

      Hello, I'd like to download copies of completed job sheets as PDF's for upload to a workdrive to keep an audit record of completed Job checkout sheets. I do not see download of this file type as an option - any help is appreciated!
    • Custom service report or Zoho forms integration

      Hello, So far the experience with Zoho FSM and the integration with Books has been good, however there are limitations with service reports. As with my business, many organisations send technicians to different types of jobs that call for a different
    • JOB Sheet can not send PDF as service rapports and more info needed other topic

      Goedendag, - Jullie hebben nu job sheet erin gedaan en dar is echt super goed, enkel kunnen we de werkbon ( JOB sheet) nu niet verzenden als PDF als een service rapport naar onze hoofdaannemer hoe we dat nu doen als bewijs van de levering van het werk
    • Zoho One not working

      I'm having several issues accessing Zoho One. Some pages don't load (for example, Zoho Directory) and the labels are all messed-up (oz.account.directory.display.shorname, oz.settings...., etc.)
    • Dialing Microsoft Teams Phone Service via Zoho CRM

      I am using the VOIP option in Microsoft teams for my office phone system. I was hoping to have a way to dial numbers directly from Zoho CRM, but don't see anything in the Teams Integration or in the Telephony integration that will enable this. Does anyone
    • [Webinar] Zoho Writer for law firms and legal professionals

      Are manual processes slowing down your legal practice? Are you ready to simplify document management and free up more time for your team to focus on what truly matters? Join us on January 16, 2025, for an exclusive Zoho Writer webinar designed specifically
    • Introducing Bin Locations In Zoho Inventory

      Hello users, We are excited to let you know that your wait for the Bin Locations feature has now come to an end! Yes, you heard us right! We are here to introduce the much-awaited Bin Locations now in Zoho Inventory. But before we dive into the feature
    • Zoho CRM search not working

      The search bar is not showing any results in our CRM installation. We have a lot of items and can not search them by using the navigation each time. Can someone please check this asap.
    • How to send mail with js SDK

      Hell o I'm using https://live.zwidgets.com/js-sdk/1.2/ZohoEmbededAppSDK.min.js, for my widget in CRM (built with sigma) Is it possible to send email from js file, I try ti use that ZOHO.CRM.API.sendMail({ "Entity": "Accounts", "RecordID": sharedVariableEntityId,
    • In ZohoCRM Dashboards - Editing Shown Columns on Drilldown of Components

      Hello! I'm working with some Dashboards inside of ZohoCRM. When creating a component (In this case, specifically a KPI Ranking Component), I'd like to customize which fields show when trying to drilldown. For example, when I click on one of the sales
    • Feature request - pin or flag note

      Hi, It would be great if you could either pin or flag one or more notes so that they remain visible when there are a bunch of notes and some get hidden in the list. Sometimes you are looking for a particular name that gets lost in a bunch of less important
    • Flow with CRM

      Hello, I have a simple flow that uses a web hook to enter data into a Sales Order. I have the web hook sending Flow data which has a PO field. If the PO has a special character like - or / or \ the task fails. How can I get the flow to be okay with the
    • SendMail in CRM Deluge function rejects a validated email address

      In a CRM Deluge function, the email address is considered invalid. Is there another method by which it can be validated? It's unacceptable in my current situation to use either the zoho.loginuserid or adminuserid as the From address.
    • how do i remove a specific Zoho Service from my account

      I no longer need Zoho CRM, ZRM Assist nor ZRM BugTracker. How do I remove them from the list of apps for my account?
    • Link project tasks to tasks in CRM and/or other modules.

      Hello, I have created and configured a project in Zoho Projects with a set of tasks. I would now like to link these tasks (I imagine according to the ID of each one) to actions in the CRM: meetings, tasks, analytics). The aim is to link project tasks
    • Introducing 'Queries' In Zoho CRM

      Hello everyone! We are here with an exciting feature - Queries in Zoho CRM! A little context before we dive right into the feature specifics :) In today’s fast-paced business environment, immediate access to relevant data is essential for informed decision-making.
    • How to map a global picklist from one module to another

      Hi there, i currently have a new field that is called sales office which we use for permission settings between our different offices located in different countries. It is a global set picklist with three different options: MY, SG and VN. I want to be
    • Build custom AI solutions with Catalyst’s QuickML capabilities in CRM

      Hello everyone, We’re thrilled to announce an improvement for our Zoho CRM Enterprise users: the ability to create custom AI solutions using Catalyst’s QuickML directly from Zoho CRM. As you may already know, Zia, Zoho CRM’s AI-powered assistant, offers
    • Unveiling Cadences: Redefining CRM interactions with automated sequential follow-ups

      Last modified on 01/04/2024: Cadences is now available for all Zoho CRM users in all data centres (DCs). Note that it was previously an early access feature, available only upon request, and was also known as Cadences Studio. As of April 1, 2024, it's
    • Pay Contractor Timesheets

      I have contractors that fill out a timesheet. Each hour must be assigned to a current client. I need the easiest way to get the contracts paid. They are paid on an hourly bases. How can this be done?
    • Inventory Valuation Method Feature

      Zoho added another feature so called Inventory Valuation Method of each Item. This is actually good to see and it will benefit us so much but I have a question on this. For Existing Items that already have transactions, Zoho made it a default and assumed
    • Set up slack alert based on a field changing from one option to any other

      Hi, I'm trying to set-up a workflow to send a slack alert if a field changes from one option to any other. I've set-up a workflow to trigger on Edit and when a specific field gets modified but the only option I have 'is modified to' when really it should
    • Better UI more user friendly

      Hello everyone, I think all finance apps, especially Zoho Books, would benefit from the following suggestions/ notes: 1. Grouping Fields in Zoho Books: Unlike Zoho CRM, Zoho Books does not seem to have an option to create sections or group fields. This
    • Chronicles of 2024: The Year in Retrospect

      As we close out 2024, let’s take a moment to highlight the new features and updates that have enhanced Zoho Invoice in 2024. Among the exciting enhancements, we have launched a new AI-powered chatbot designed to assist you in understanding the app's features
    • Power of Automation :: Automatically archive your inactive Projects

      Hello Everyone, A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate
    • 554 5.1.8 Email Outgoing Blocked

      HELP!!!!! My e-mail marymariya@zoho.com is blocked. Error: 554 5.1.8 Email Outgoing Blocked The third day I am writing to the forum, but zohosupport is not responding. Why? What is the problem? I ask to help solve the problem, because I can not communicate with my customer base.
    • Zoho Inventory: Rewinding 2024

    • Custom Modules Now available for Standard and Professional Editions with Expanded Limits across all editions

      #CRM25Q1 Hello Everyone, We are here with an exciting update to Custom Modules in Zoho CRM. Custom modules will now be available to Standard and Professional Edition users, with expanded support across all editions. The standard modules offered in Zoho
    • Assistance with Custom Attendance Report in Zoho People

      Hi, I created a custom report in Zoho People 5.0 to track employee attendance according to our specific needs, as the existing reports do not include all the required details. However, I’ve noticed that the report doesn’t update continuously or on a daily
    • Zoho analyticsでのタブを跨いだ集計

      Zoho analyticsまたはCRMレポートなどを用いて、 見込み客タブと商談タブで共通するユニークキー(リード管理番号)を軸に、「共通選択リスト」で設定した項目別の集計を行うことは可能でしょうか? ・要望 ①リード管理番号をキーに、見込み客テーブルと商談テーブルを結合したRAWデータを作成したい ②具体的には下記表のように「共通選択リスト」項目(サービス)別のマーケ数値を一表にしたい  ※リード=見込み客タブ 商談・成約=商談タブ      リード数 商談数 成約数 サービスA   10   5   2
    • Key Highlights of 2024: Recalling a Year of Progress and Advancements!

      As we step into 2025, we’re excited to share the progress and developments we’ve made to simplify and streamline your travel and expense management in the past year. Let’s take a look back at some of the key updates and enhancements that have helped us
    • How to refresh the page by widget in related list?

      Hello, ZOHO.CRM.UI.Popup.closeReload method does the thing I need. But in my case, I'm not using popup. I have a widget in related list and I want to refresh the page when I'm done with it. I searched for it but I wasn't able to find it. Is there an any
    • Organization Variables - Restrict Access

      Currently, there is no way to restrict the access to organization variables. This leads to a problem when storing API related values that should be kept secret as anyone with access to create and edit email templates, workflow rules, or inventory templates
    • Next Page