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


    • Recent Topics

    • Introducing Zoho Creator's 2025 Release Projection 2

      Hello Creators! I'm Prakash, from the Creator product management team, and today I'm delighted to unveil our next set of features as part of Release Projection 2 for 2025. With thoughtful analysis and planning, we've curated powerful new capabilities
    • Zoho Sign Reminder email template

      Is there a template we can edit for the reminder emails? I don't see it in Settings / Choose a template
    • Object required error

      Hi, I am getting an 'Object required' error on the line Call HideColumnsOutsideRange(ws, startOfWeek, endOfWeek) when I run the ShowCurrentWeek macro but not when I run the ShowCurrentMonth macro. Any ideas? Regards, GW Option Explicit Sub HideColumnsOutsideRange(ws
    • Color of Text Box Changes

      Sometimes I find the color of text boxes changed to a different color. This seems to happen when I reopen the same slide deck later. In the image that I am attaching, you see that the colors of the whole "virus," the "irology" part of "virology," and
    • Preview an upload PDF or File

      I have a form where the customer has to upload a file (normally PDF - never jpeg)  When in report view I want to be able to preview the uploaded file without having to download it.  If I click on the upload it downloads to my computer, I want to be able
    • How to filter emails by Reply-to field?

      I receive a very particular newsletter from an association A registered on a website W (that is used by many associations), and the emails fields are not great: the From just contains the generic website's W's email, while A is only mentioned in the Reply-to
    • How to sync from Zoho Projects into an existing Sprint in Zoho Sprints?

      Hi I have managed to integrate Zoho Projects with Zoho Sprints and I can see that the integration works as a project was created in Zoho Sprints. But, what I would like to do is to sync into an existing Zoho Sprints project. Is there a way to make that
    • How to invite friends on other social media platforms to one of my group chats in arattai?

      Hello, I have formed chat groups in arattai. I want to invite my friends on other social media platforms like WhatsApp/ FB to one of my groups. Different friends would be invited to different groups. How to share an invite link of one of my groups to
    • Line spacing

      I coudn't decrease the line spacing to space smaller then a single line. There is too much space between the lines that make the document look ugly. Please fix that. Liran. fonar
    • Domain Change

      “Please update my Email-in domain from @biginmail.biginmail.in to @biginmail.zoho.com. Messages to the .in domain are bouncing.”
    • Cliq iOS can't see shared screen

      Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
    • Google Fonts Integration in Pagesense Popup Editor

      Hello Zoho Pagesense Team, We hope you're doing well. We’d like to submit a feature request to enhance Zoho Pagesense’s popup editor with Google Fonts support. Current Limitation: Currently, Pagesense offers a limited set of default fonts. Google Fonts
    • Control Position of “X” (Close) Button in Popup Editor

      Hello Zoho PageSense Team, We hope you're doing well. We would like to request a customization improvement in the PageSense popup editor. Current Limitation: Currently, the position of the “X” (close) button is fixed and cannot be customized in the popup
    • Add Standalone “Save” Button in Pagesense Popup Editor

      Hello Zoho Pagesense Team, We hope you're doing well. We would like to request an important usability improvement in the Pagesense popup editor. Current Limitation: There is currently no dedicated Save button while building a popup. The only way to save
    • Text Direction Control in Pagesense Popup Editor

      Hello Zoho Pagesense Team, We hope you're doing well. We’d like to submit a feature request to add text direction control in the Pagesense popup editor. Current Limitation: Currently, the popup editor does not provide native support for RTL (Right-to-Left)
    • Autosave in Pagesense Popup Editor

      Hello Zoho Pagesense Team, We hope you're doing well. We’d like to submit a feature request to enhance the Pagesense editor with an autosave functionality. Current Limitation: Currently, changes made in the Pagesense editor must be manually saved. In
    • Billing frequency is not displayed correctly.

      Hello There is an issue while displaying the billing frequency on a subscription quote. I am able to activate the subscription details and get this lovely overview: If I am adding a Plan which I charge quarterly, first of all it should be possible to
    • Creating Secret via Vault API

      Hi I am trying to create a secret through vault api.  This is the response I get. One thing I am not sure is how to decrypt the secretdata, how to get the secrettypeid? {     "operation": {         "result": {             "error_code": "",             "message": "Sorry, we are unable to process your request.",
    • Zoho CRM custom fields not showing in zoho creator

      Hi Team, I have created a Products form with Zoho CRM integration and connected it to Products module of CRM. But when I see the reports of Products in Zoho creator then I am not able to see custom fields of Products module. Only standard fields of Products
    • Is It Possible to Hide Menu Option from Main Navigation?

      Is it possible to hide a menu option, e.g. Admin, from the Main Navigation based on some criteria, e.g. login = zoho.adminuser
    • Unleash the power of detail, with Table View.

      What use is context that's not available where you need it? With this in mind, we bring you the Table View. This feature will add more power to the way you organize and work through your ticket load. Table View comes in handy when you want more control over the ticket information you see. This is a nifty tool for users who find themselves limited in terms of the level of information that is being offered in the Classic View and Compact View. With an upper limit of 15 columns, agents can glean most
    • Kaizen #126 - Circuits in Zoho CRM - Part 1

      Hello everyone! Welcome back to another week of Kaizen! Today, we will discuss an exciting topic—Circuits in Zoho CRM. For starters, we will discuss what Circuits are, how beneficial they are for businesses, different views of a Circuit, and the different
    • Dynamic Signature - Record owner

      Hi everyone, I’m using Zoho Writer merge templates from Zoho CRM and have two questions: Owner signature: How can I automatically insert the CRM record owner’s signature in the merged document? I’m not sure where this signature is stored or how to reference
    • 'Statement of Accounts does not exist' error received, when creating PO using api in Zoho Inventory

      Here is request json -- JSONString = { "date": "2019-09-24", "purchaseorder_number": "PO-6-1", "delivery_date": null, "delivery_org_address_id": 36221200000056XXX, "vendor_id": 362212000000564XXX, "attention": "Testing", "line_items": [{ "unit": "Pieces", "account_id": 36221200000003XXX, "quantity": 1, "item_id": 362212000000049XXX, "tax_type": "", "tax_name": "", "name": "One HD", "purchase_rate": 85, "tax_percentage": 0, "item_total": 85.00, "tax_id": "", "warehouse_id": 362212000000564XXX }] }
    • Multiple clients in one project

      Hi team, What is the possibility to have more than one client to be linked for one project in the Zoho Books? Our business model is to have a project, and this project have expenses/bills, as well, we issue invoices for this same project to several customers.
    • Option to Customize Career Site URL Without “/jobs/Careers”

      Dear Zoho Recruit Team, I hope you are doing well. We would like to request an enhancement to the Career Site URL structure in Zoho Recruit. In the old version of the career site, our URL was simply: 👉 https://jobs.domain.com However, after moving to
    • Preserve Ticket Issue Mapping When Migrating from Jira to Zoho Projects

      Hello Zoho Projects Team, We hope you are doing well. We are currently exploring a full migration from Jira to Zoho Projects, and we identified a critical limitation during the migration process involving Zoho Desk integration. Current Situation: We use
    • Support Bots and Automations in External Channels

      Hello Zoho Cliq Team, How are you? We actively use Zoho Cliq for collaboration, including with our external developers. For this purpose, external channels are a key tool since they work seamlessly within the same interface as all of our other channels
    • How to Add Time Formula Duration (hh:mm)

      Hi everyone — I’m trying to create a formula field in Zoho CRM that calculates the difference between a “Call Start Time” and “Call End Time” and displays the duration in HH:MM format (for example: 1:04 for one hour and four minutes). My current setup
    • Workdrive on Android - Gallery Photo Backups

      Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma
    • How many clients can be added to Zoho Practice?

      How many clients can be added to Zoho Practice without having their zoho app?
    • Need more details on API Usage Dashboard

      Hi Team, We have implemented Zoho Expense for a client and has done some integrations with well known third party ERP via api. Recently we have noticed a huge spike in the API consumption. But we couldn't get the root cause for the same. I accept there
    • Zoho Sheet for Desktop

      Does Zoho plans to develop a Desktop version of Sheet that installs on the computer like was done with Writer?
    • Edit item custom fields

      Getting this error : Transactions have been created with the custom field. Hence it cannot be deleted. Not trying to delete it, just trying to change which modules to show in or to not show at all in transactions !
    • Rendering PDF to view on page

      My company upload lots of PDF files onto Zoho. But every time we open it, it downloads the file instead of viewing it on the web page. Does Zoho allow uploaded PDF files to be rendered to view on web page yet? I've been trying to use <embed> or <object> but it cannot be loaded.  (similar thread: https://help.zoho.com/portal/community/topic/how-to-open-a-pdf-file-of-a-view-in-preview-mode)
    • How do I create a time field?

      I want a field that only records time. I can only see how to create a date-time field. If I do that and enter a time, without a date, nothing is recorded. If I create a number or decimal field, I cannot use it in time calculations. All I want is a field
    • Dynamically Fetching Lookup Field Display Value

      I have an audit trail form, Audit_Changes, that tracks old vs new values across different forms. For lookup fields, the old/new value is the ID, but I also need the display value. What's a best practice for dynamically fetching the display value of the
    • Workflow workdrive rollout

      Hi! When will workflow be rolled out to all users? Thanks.
    • Workdrive and ChatGPT Team Synced Connectors

      Hi, we want to be able to integrate Zoho Workdrive with OpenAI’s ChatGPT Team plan. Google Drive and OneDrive both offer this, zoho please catch up asap. We dont want to have to put our company files in google drive, we want to allow chatgpt Team edition
    • Is it possible to pull the Zoho desk data into Zoho analytics in real time

      Hi - I am looking to add more dashboards and reports of Zoho Desk in analytics. I see there is a schedule to pull the data into analytics, but I'm wondering if there is an option to pull the data in real time instead of a specific interval?
    • Next Page