Tip #4.1 Auto-creating package and shipment records for your offline sales orders

Tip #4.1 Auto-creating package and shipment records for your offline sales orders

Hello,


Hope this post finds you in good health.
Last week we saw how we could automate item weight calculation for your orders. This week we will go a step further and see how you can automate the process of creating packages and shipments for your sales orders. 

To make it easier for the reader, this post has been split into two. Part 1 or tip #4.1 will tell you how you can auto-create package and shipment records in Zoho Inventory for your offline orders while tip #4.2 or part 2 will tell you how to do the same for online orders.

Who is this for?

Any business that ships goods as soon as an order is made and has very less time on their hands for paperwork (same day shipments using a single carrier/by self).


How does this work? 

It all begins with a sales order draft inside of Zoho Inventory. As soon as you email the sales order to a client or manually mark it as confirmed, the system uses this status change as a trigger for creating a package record (with all of the items on your sales order). Once this is done, the system will record a manual shipment record within the system against a preset shipping medium (which can be configured by you as you write the custom function into Zoho Inventory). 

Now, let's see how we can write this custom function for your business.

Setting up the custom function:

Log in to your Zoho account and click on this link to generate an Auth Token which is required to make this work.
  • Open your Zoho Inventory organization.

  • Navigate to Settings using the gear icon from the top-right corner.

  • Select Automation from the sidebar. Now click on the button adjacent to +New Workflow Rule.

  • Out of the four options from the drop-down, select Custom Functions.

  • Now let's add a name for this workflow rule and make sure that there are no spaces between words.

  • Select Sales Orders against module.

  • Add a description if you need one.

  • Now, the workflow type is going to be Event Based.

  • The condition to set shall be, "When a Sales Order is created".

  • And, for the trigger, it will be "When Sales Order status is Confirmed".

  • Now copy and paste this code snippet into the deluge pane:

salesorderID = salesorder.get("salesorder_id"); 

salesorderdate = salesorder.get("date").toDate();

organizationID = organization.get("organization_id");

authtoken = "Copy and paste your authtoken here";

mapper = Map();

customerID = salesorder.get("customer_id").toString();

//package_number = salesorder.get("salesorder_number").replaceFirst("SO","PA");

//mapper.put("package_number",package_number);

mapper.put("customer_id",customerID);

mapper.put("date",salesorderdate);

lineItems = salesorder.get("line_items").toList();

newLineItems = List();

for each lineItem in lineItems

{

lineItemMap = Map();

solineitemID = lineItem.get("line_item_id");

lineItemMap.put("so_line_item_id",solineitemID);

quantity = lineItem.get("quantity");

lineItemMap.put("quantity",quantity);

newLineItems.add(lineItemMap);

}

mapper.put("line_items",newLineItems);

jsonString = Map();

jsonString.put("JSONString",mapper);

response = invokeurl

[

url :"https://inventory.zoho.com/api/v1/packages?authtoken=" + authtoken + "&salesorder_id=" + salesorderID + "&organization_id=" + organizationID

type : POST

parameters:jsonString

];

info mapper;

info response.toMap();

//shipment

pack=response.get("package");

packid=pack.get("package_id");

ship=Map();

ship.put("date",salesorderdate);

ship.put("delivery_method","dhl"); //REPLACE WITH SHIPPING CARRIER NAME OR DELIVERY BY SELF

jsons=Map();

jsons.put("JSONString",ship);

resp = invokeurl

[

url: "https://inventory.zoho.com/api/v1/shipmentorders?package_ids="+packid+"&salesorder_id=" +salesorderID+ "&authtoken="+authtoken+"&organization_id=" + organizationID

type: POST

parameters: jsons

];

info resp.toMap().get("message");


  • Copy and replace your authtoken number with the text on line 4 of the code.

    • authtoken = "copy and paste your authtoken here"to something like, authtoken = "67xxxxxxxxxxxxxxxxx".

  • You can change the carrier name/shipping medium by making changes to line 38 of the code that says: ship.put("delivery_method","dhl"); //REPLACE WITH SHIPPING CARRIER NAME - for e.g., "dhl" can be replaced with "fedex" or something of your choice like say, "delivery_by_self" or "picked_up_by_customer".

  • Note: If you have enabled auto-generation of package numbers for your organization, then you don't need these two lines:

    • //package_number = salesorder.get("salesorder_number").replaceFirst("SO","PA");

    • //mapper.put("package_number",package_number);

  • Once everything is ready, hit Save.


Henceforth, all your offline sales orders (that have been confirmed) will have packages and manual shipment records created inside of Zoho Inventory.

Please check out the part 2 of this post titled - Tip #4.2 Auto-creating package and shipment records for your online sales orders on our forums.

Until next time.

Your everyday end user,
Ajay Aadhithya Chandrasekaran
Zoho Inventory


    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                   
                                                    

                                                  Videos

                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner






                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner







                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ








                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • JS SDK 8.0 – TypeError: Cannot read properties of undefined (reading 'getCacheStore') with sample code

                                                                                                              Hello Zoho Support Team, I’m integrating the Zoho CRM JavaScript SDK v8.0 and I’m getting the error below when running your official sample. I tested directly from: https://github.com/zoho/zohocrm-javascript-sdk-8.0/blob/main/samples/create_records_sample/create_records.js
                                                                                                            • Function #55: Convert multiple quotes to single SO using Custom Button

                                                                                                              Hello everyone, and welcome back to our series! In Zoho Books, after a quote is accepted by your customer, it can be converted into a sales order or an invoice. Often, a customer might have multiple quotes, and for easier billing or upon the customer's
                                                                                                            • Zoho One - Syncing Merchants and Vendors Between Zoho Expense and Zoho Books

                                                                                                              Hi, I'm exploring the features of Zoho One under the trial subscription and have encountered an issue with syncing Merchant information between Zoho Expense and Zoho Books. While utilizing Zoho Expense to capture receipts, I noticed that when I submit
                                                                                                            • Rich Text For Notes in Zoho CRM

                                                                                                              Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                                                                                            • Time based workflow without edit/action

                                                                                                              Hello I need help solving this problem if possible. We have Deals come into the CRM via Live Transfer which have the field properties: Stage = New Channel = Inbound Some of them don't get answered so we want these to automatically go into our Outbound
                                                                                                            • What's New - August 2025 | Zoho Backstage

                                                                                                              Every month, Zoho Backstage grows with you. These updates aren't just features and fixes, they're about making your workday smoother, your events more impactful, and your attendees happier. We’ve listened, learned, and shaped this release to keep things
                                                                                                            • prevent selling expired items

                                                                                                              Hello. I need to make a constraint on expired batch items not to be sold. Is it possible in Zoho Inventory? if so, then how? Thanks for further help.
                                                                                                            • Product details removed during update from other system

                                                                                                              We maintain our product details in an other system. These details are synchronized with Zoho at the end of each day, through an API. This has worked perfectly sofar. But last Monday, all product codes and some other product data have been wiped during
                                                                                                            • Client Customer

                                                                                                              I purchased a customer user license, but we cannot see the project I added in the customer account. I would like to ask for support on what we should do.
                                                                                                            • Add Ability to Use Zoho Finance Tags

                                                                                                              For Zoho Finance (Books and Inventory), the current actions do not allow us to affect the tags associated with the entities in question (customers, vendors, items, etc.). Please consider adding this functionality into the actions.
                                                                                                            • Embeded Signing doesn't work on Safari Browser

                                                                                                              We have implemented Zoho Sign in our website by using embeded signing, It works perfectly on Chrome. But it fails on Safari, We get stuck on Zoho Sign Page during redirection from Zoho Sign to our website after signing the document, Please let us know
                                                                                                            • Dataprep Webhook Limits and Cannot update column with Dataprep

                                                                                                              I have two problems : 1 - I am using Airflow to trigger my pipeline, and when I tested it, it worked fine a couple of times. However, after that, I received an error: {"code":429,"message":"Request rate limited"}. I didn’t send too many requests — maybe
                                                                                                            • Power of Automation :: Automatic removal of project users once the project status is changed.

                                                                                                              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 complex tasks and
                                                                                                            • New in Zoho Forms: Google reCAPTCHA v3 for smarter spam protection

                                                                                                              Hello form builders, Spam submissions are one of the biggest challenges when you share your forms online. They not only clutter your data but can also waste valuable time. To help you combat this without making life harder for genuine respondents, we’re
                                                                                                            • Project Management Bulletin: August, 2025

                                                                                                              We’ve touched a grand 19 years since we started pioneering project management solutions with Zoho Projects. What started as a simple one-page interface is now a suite of products with Zoho BugTracker, Zoho Sprints, and our new debut Zoho Projects Plus,
                                                                                                            • Zoho Sign and Zoho Workdrive Integration

                                                                                                              Hello, there. I want to know if it's possible to save a signed document from Zoho Sign in an specific folder for each signer in Zoho Workdrive.  For example: If John Doe signs the document in Zoho Sign I want to save it automatically in a folder named
                                                                                                            • Office 365 and CRM mail integration: permission required

                                                                                                              Has anyone run into this weird problem? My email server is Office 365. When I try to configure Zoho CRM to use this server, a Microsoft popup window opens requesting user and password. After entering that, I get a message in the Microsoft window saying
                                                                                                            • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

                                                                                                              Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
                                                                                                            • How do you list multiple contacts for a lead?

                                                                                                              My sales team wants to be able to add additional contacts for leads, how do we do that? Is there a different way we should be using the lead / contact functionality? Moderation update (9th September 2025): Our developers have built an extension to achieve
                                                                                                            • Modifying Three Dot Menu Options

                                                                                                              Is there a way to modify the three dot menu options that display in a Report header? They currently display: Show As (List, Calendar, Timeline), Print, Import, Export. I'd like to remove the Show As and Print options, since they aren't applicable for
                                                                                                            • Field Not Updating in FSM Script - Service and Parts module.

                                                                                                              Dear Team, I am reaching out regarding a script I have implemented in Zoho FSM to automate the calculation of the End of Service date based on the End of Sale date in the Service and Parts module. Overview of the script: Fetches the End_of_Sale__C and
                                                                                                            • Zadarma + Zoho CRM Integration – Missed Calls Saved as Contacts Instead of Leads

                                                                                                              Hello everyone, I’m looking for input from anyone with experience using the Zadarma + Zoho CRM integration. Currently, I’m seeing that missed calls are automatically being created as Contacts instead of Leads. From a CRM perspective, this doesn’t make
                                                                                                            • Zoho Books | Product updates | September 2025

                                                                                                              Hello users, We’ve rolled out new features and enhancements in Zoho Books. From PayNow payment method to applying journal credits to invoices and bills in other locations, explore the updates designed to enhance your bookkeeping experience. Integrate
                                                                                                            • How to update Multiple Users field in Quote Module from Deal Module

                                                                                                              Scenario : Deal Module having Multiple User Field (Presales Engineer) which having more than 1 User and through Deluge Script I need to get that Users Details and need to put into Multiple User Field (Presales Engineer) of Quote Module. Note: Both Module
                                                                                                            • Auto-sync field of lookup value

                                                                                                              This feature has been requested many times in the discussion Field of Lookup Announcement and this post aims to track it separately. At the moment the value of a 'field of lookup' is a snapshot but once the parent lookup field is updated the values diverge.
                                                                                                            • Clone a Module??

                                                                                                              I am giong to repurpose the Vendors module but would like to have a separate but very similar module for another group of contacts called Buyers. I have already repurposed Contacts to Sellers. Is it possible to clone (make a duplicate) module of Vendors
                                                                                                            • Advance PDF creation from CRM data

                                                                                                              I'm trying to create a PDF export of data in the CRM. My problem is I want a pretty complicated format for the data. I'm trying to export multiple modules worth of data, with nested one-to-many relationships between the modules. Along with that, I want
                                                                                                            • how to disable staff selection Zoho Booking integrated to SalesIQ?

                                                                                                              currently there is only one Consultant in my Zoho Bookings like this I integrate Zoho Bookings into Zoho SalesIQ to create a chatbot. Unfortunately, even though I only have one consultant for a consultation, the user have to pick the consultant. It will
                                                                                                            • How to change the text in WhatsApp Zobot integrated to Zoho Booking?

                                                                                                              I have integrated Zoho Bookings into Zoho SalesIQ, I want to change the text in WhatsApp when creating a booking in Zobot how to change those text?
                                                                                                            • Updating Subform Record from other Form

                                                                                                              Just wanted to ask how to properly approach this. I have 2 forms and would like to trigger an auto update on the subform once record submitted. block below only updates 1 row for each recordRow in input.AV_System { AssetRecord = Site_Asset_Services[SOR_No
                                                                                                            • when I email a invoice how can i see it was sent and also were i can go to see all emails sent

                                                                                                              when I email a invoice how can i see it was sent and also were i can go to see all emails sent?
                                                                                                            • Zoho Books - Hide Convert to Sales Order if it can't be used.

                                                                                                              Hi Books team, I noticed that it is not possible to convert a Quote to a Sales Order when a Quote is not yet marked as accepted. My idea is to not show the Convert to Sales Order button when it is not possible to use it, or show it in a grey inactive
                                                                                                            • How do I bulk archive my projects in ZOHO projects

                                                                                                              Hi, I want to archive 50 Projects in one go. Can you please help me out , How can I do this? Thanks kapil
                                                                                                            • Cross-Data Center Collaboration and / Or allowing users to choose DC

                                                                                                              Dear Zoho Cliq Support Team, We are writing to request a significant enhancement to Zoho Cliq that would greatly benefit our geographically dispersed development team. Current Challenge: Currently, Zoho Cliq automatically routes users to specific data
                                                                                                            • Zoho Flow - Update record in Trackvia

                                                                                                              Hello, I have a Flow that executes correctly but I only want it to execute once when a particular field on a record is updated in TrackVia. I have the trigger filters setup correctly and I want to add an "update record" action at the end of the flow to
                                                                                                            • New Mandatory One-Click Unsubscribe Link Overshadowing Custom Unsubscribe Link

                                                                                                              I was recently informed by Zoho CRM Support that they are now mandated by the large email service providers like Google and Yahoo to provide a one-click unsubscribe option in the header (not the body) of all mass emails. I have a custom unsubscribe link
                                                                                                            • Send / Send & Close keyboard shortcuts

                                                                                                              Hello! My team is so close to using Zoho Desk with just the keyboard. Keyboard shortcuts really help us to be more efficient -- saving a second or two over thousands of tickets adds up quickly. It seems like the keyboard shortcuts in Desk are only for
                                                                                                            • Is it possible to register webhooks in Zoho CRM using API?

                                                                                                              Hello, I am trying to register a webhook in Zoho CRM programmatically (using the API). Specifically, I want to register a webhook that is fired when new Contacts are created in the CRM. I was able to setup a webhook using the UI, by creating a rule that
                                                                                                            • Calls where the local audio is shared, have echo

                                                                                                              When another user is sharing their screen with audio, I get echo from my own voice. We tested this with multiple users, with different audio setups, and there's no obvious way to fix it. Is this a bug you could look into, or are we missing something?
                                                                                                            • Systematic SPF alignment issues with Zoho subdomains

                                                                                                              Analysis Period: August 19 - September 1, 2025 PROBLEM SUMMARY Multiple Zoho services are causing systematic SPF authentication failures in DMARC reports from major email providers (Google, Microsoft, Zoho). While emails are successfully delivered due
                                                                                                            • Next Page