Plug Sample #8 - Track your eCommerce order real-time with Zobot - Zoho commerce integration

Plug Sample #8 - Track your eCommerce order real-time with Zobot - Zoho commerce integration

Hi Everyone!

Zoho SalesIQ's Zobot is an intelligent tool to increase customer engagement and provide support, especially in the e-commerce industry. A crucial aspect of e-commerce is ensuring your customers can easily keep track of their orders. Just imagine your Zobot providing real-time updates on your customers' order status, tracking URL, shipment details, and estimated delivery dates. Sounds cool, right? That's what we are going to look at in this post. 



Zoho Commerce is a comprehensive e-commerce platform for building a website, accepting orders, tracking inventory, processing payments, and more. With SalesIQ's Zobot seamlessly integrated with Zoho Commerce, you can now provide exceptional support and prioritize convenience for your customers by making your bot actively promote your key offers, assist in tracking orders, create support tickets, and much more. 

To learn more about chatbots usage in the e-commerce industry, check out our exclusive webinar and help article. Now, let's dive into the step-by-step process of how to make your bot track orders with the codeless bot builder.

Overview of tracking orders



Step 1 - Create a connection between SalesIQ and Zoho Commerce.

  •  In your SalesIQ Dashboard, navigate to Settings > Developers > Plugs > Click on Add.
  •  Provide your plug a name, and description, select the Platform as SalesIQ Scripts, and finally, click on Connection to your left bottom. You will be redirected to the connection interface.

  •  Click on Create connection at the top right corner. Under Default connection, select Zoho OAuth service. 

  • Provide your connection name, connection link name, and choose the scopes below.
    • ZohoCommerce.salesorders.READ
    • ZohoCommerce.items.READ
  • Click on Create And Connect to connect Zoho SalesIQ and Zoho Commerce. 


  • Upon successful authentication,  Zoho SalesIQ will be connected with Zoho Commerce. 
Note: The Connection Link Name will be used in the scripts to invoke URL tasks.
 

 

Step 2 - Fetch the "Shipped" orders (Plug 1)

First, let's look at how to list all the shipped orders of the visitor from Zoho Commerce. To do this, we need the email address of the visitor. By List all sales orders API, the bot can fetch all the orders from the visitors (email). Then using the status as a filter, all the Shipped orders can be fetched and displayed to the visitors as options. 

Input Parameter:
  • Name: email | Type: Email
Output Parameter: 
  • Name: orderList | Type : Options list


Copy/paste the below code to list all the shipped orders. 
 
  1. response = Map();
  2. if(session.containsKey("email"))
  3. {
  4. email = session.get("email").get("value");
  5. }
  6. params = Map();
  7. params.put("email",email);
  8. params.put("page","1");
  9. params.put("per_page","5");
  10. header = Map();
  11. //Insert your Zoho Commerce Org ID (From your Zoho Commerce, navigate to the Store > Settings > Organization Profile > Organization ID)
  12. header.put("X-com-zoho-store-organizationid","<org_ID>");
  13. check_status = invokeurl
  14. [
  15. url :"https://commerce.zoho.com/store/api/v1/salesorders"
  16. type :GET
  17. parameters:params
  18. headers:header
  19. connection:"zohocommerce"
  20. ];
  21. array = check_status.get("salesorders");
  22. optionList = List();
  23. for each  entry in array
  24. {
  25. salesorder_id = entry.get("salesorder_id");
  26. URL = "https://commerce.zoho.com/store/api/v1/salesorders/" + salesorder_id;
  27. get_order_details = invokeurl
  28. [
  29. url :URL
  30. type :GET
  31. headers:header
  32. connection:"zohocommerce"
  33. ];
  34. shipping_status = get_order_details.get("salesorder").toList().get(0).get("shipped_status").toUpperCase();
  35. //Printing the shipped orders
  36. if(shipping_status == "SHIPPED")
  37. {
  38. product_ordered = get_order_details.get("salesorder").get("line_items").toList().get(0).get("name");
  39. quantity = get_order_details.get("salesorder").get("line_items").toList().get(0).get("quantity").toNumber();
  40. display_text = product_ordered + " (" + quantity + ")";
  41. optionList.add({"id":salesorder_id,"text":display_text});
  42. }
  43. }
  44. response.put("orderList",optionList);
  45. return response;
  • Then, click Save, preview the plug and Publish it. 
Note: API invoked in the plug List all sales orders 

Step 3- Getting order details (Plug 2)

In the previous step, we fetched all the "Shipped" orders and displayed them to the visitors. When they click on a specific order, the bot will get the order details from the Retrieve sales order API and provide them to the visitor. 

Input Parameter:
  • Name : orderID | Type : String
Output Parameter: 
  • Name: shippingAddress | Type : String
  • Name: deliveredDate | Type : String
  • Name: orderName | Type : String
  • Name: orderNumber | Type : String
  • Name: quantity | Type : Number
  • Name: orderCost | Type : Number
  • Name: trackingUrl | Type : Options list
  • Name: shippedDate | Type : Options list
  • Name: paymentMode | Type : Options list
  • Name: shippingStatus | Type : Options list


 Copy and paste the below code to get the order details.
 
  1. if(session.containsKey("orderID"))
  2. {
  3. salesorder_id = session.get("orderID").get("value");
  4. }
  5. header = Map();
  6. //Insert your Zoho Commerce Org ID (From your Zoho Commerce, navigate to the Store > Settings > Organization Profile > Organization ID)
  7. header.put("X-com-zoho-store-organizationid","<ord_ID>");
  8. URL = "https://commerce.zoho.com/store/api/v1/salesorders/" + salesorder_id;
  9. get_order_details = invokeurl
  10. [
  11. url :URL
  12. type :GET
  13. headers:header
  14. connection:"zohocommerce"
  15. ];
  16. order_number = get_order_details.get("salesorder").toList().get(0).get("salesorder_number");
  17. product_ordered = get_order_details.get("salesorder").get("line_items").toList().get(0).get("name");
  18. cost = get_order_details.get("salesorder").get("line_items").toList().get(0).get("rate").toNumber();
  19. quantity = get_order_details.get("salesorder").get("line_items").toList().get(0).get("quantity").toNumber();
  20. payment_mode = get_order_details.get("salesorder").get("offline_payment_details").toList().get(0).get("payment_mode");
  21. shipping_address = get_order_details.get("salesorder").get("shipping_address").toList().get(0).get("address");
  22. tracking_url = get_order_details.get("salesorder").get("packages").toList().get(0).get("status_message");
  23. shipping_address = get_order_details.get("salesorder").get("shipping_address").toList().get(0).get("address");
  24. shipping_status = get_order_details.get("salesorder").toList().get(0).get("shipped_status").toUpperCase();
  25. if(shipping_status == "FULFILLED")
  26. {
  27. shipping_status = "Delivered";
  28. tracking_url = "No tracking URL";
  29. delivered_date = get_order_details.get("salesorder").get("packages").toList().get(0).get("shipment_date");
  30. shipped_date = get_order_details.get("salesorder").get("packages").toList().get(0).get("shipment_date");
  31. }
  32. else if(shipping_status == "SHIPPED")
  33. {
  34. shipping_status = "Shipped";
  35. tracking_url = get_order_details.get("salesorder").get("packages").toList().get(0).get("status_message");
  36. shipped_date = get_order_details.get("salesorder").get("packages").toList().get(0).get("shipment_date");
  37. delivered_date = get_order_details.get("salesorder").get("packages").toList().get(0).get("shipment_date");
  38. }
  39. else
  40. {
  41. shipping_status = "Yet to Ship";
  42. tracking_url = "No tracking URL available";
  43. shipped_date = "NA";
  44. delivered_date = "NA";
  45. }
  46. response = Map();
  47. response.put("orderNumber",order_number);
  48. response.put("orderCost",cost);
  49. response.put("orderName",product_ordered);
  50. response.put("quantity",quantity);
  51. response.put("shippingStatus",shipping_status);
  52. response.put("paymentMode",payment_mode);
  53. response.put("shippingAddress",shipping_address);
  54. response.put("trackingUrl",tracking_url);
  55. response.put("shippedDate",shipped_date);
  56. response.put("deliveredDate",delivered_date);
  57. return response;
  • Then, click Save, preview the plug and Publish it. 
Note: API invoked in the plug Retrieve sales order
 

Step 3 - Adding these plugs to the Codeless bot builder

  • Navigate to Settings > Bot > Add, provide the necessary information, and select Codeless Bot as a bot platform or open an existing bot.
  • To list the shipped orders, get the email address from the visitor by email card. 
  • Then, select the Plugs under Action Cards and select listShippedOrder (Plug 1). In the input parameters, select the Email context variable and provide a name (tracking.order) to save the list of shipped orders. 


  • Next, use the Single choice card to display all the shipped orders. Provide an option "Can't find my order" and click on dynamic suggestions and select the (tracking.order) variable. 

  • Next, click on Save in bot context (post.tracking.order) and store the visitor's order choice. 

  • Then, use the criteria router to route the flow based on the visitor's choice. 

  • After that, select the orderDetails plug in Plug card. And provide the post.tracking.order as the input and provide names for the outputs. 



  • Finally, use these context variables by typing % in the Send message card to display the order details to track orders. 

  • Also, use the markups to provide the tracking URL as a hyperlink.  


Bot Preview (Output)

  • The bot will ask for the email address and then provide the "shipped" orders list.  

  • Then the visitor selects one order, and the bot will provide the information about the order.  

  • Once the bot flow is complete, click Publish to deploy Zobot on your website or online store. Zobot will be ready to engage with your customers, provide support, and assist with their purchasing journey.
 
Related links:
To know more about the features of Zobot, kindly visit our Resources Section. 

    Access your files securely from anywhere

          Zoho Developer Community




                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day



                                        Zoho Marketing Automation


                                                Manage your brands on social media



                                                      Zoho TeamInbox Resources

                                                        Zoho DataPrep Resources



                                                          Zoho CRM Plus Resources

                                                            Zoho Books Resources


                                                              Zoho Subscriptions Resources

                                                                Zoho Projects Resources


                                                                  Zoho Sprints Resources


                                                                    Qntrl Resources


                                                                      Zoho Creator Resources



                                                                          Zoho Campaigns 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

                                                                                                  • Time Zone Correction with Daylight Savings Time

                                                                                                    Hey, I'm writing a series of reports where the source data is synced from an external source which stores the date/time information in GMT, but I want the reports to be in local time. Now, I understand there is the CONVERT_TZ function which allows me
                                                                                                  • Load form in iframe without header

                                                                                                    I am trying to load a form into an iframe without the header, but I am not having any luck. I am using openUrl() to load the iframe with the form URL and zc_Header set to false, e.g. #Form:Add_Case?zc_Header=false but it is still loading the header. Any
                                                                                                  • Filter embedded report

                                                                                                    How to filter embedded report in a page, below code is not working. dateField => startDate & dateField=< endDate The report should print on page containing records from startDate to endDate. params='zc_Header=true&amp;Service_Date__gte=<%=startDate%>&amp;Service_Date__lte=<%=endDate%>'
                                                                                                  • Creator Simplified #5: Set file upload restrictions in Zoho Creator

                                                                                                    Hey Creators, Welcome to the next post in the Creator Simplified series. Today, we’ll explore how to implement file upload restrictions to limit user submissions to specific file types. By implementing an allowed list for file uploads, you can optimize
                                                                                                  • Field Type: Address, Change District/State to Dropdown with picklist??

                                                                                                    Using the Address Field type, is there a way to make the District/State field be a dropdown with a picklist so the users can select rather than type the state name every time? I know this can be done if I use a drowdown field for the State (or entire address information), but that isn't as tidy as using the address field type. I apologize if this is a duplicate. I posted this question the other day, or so I though. Can't find that post.
                                                                                                  • cutomized fields are not showing up in zoho creator from zoho crm

                                                                                                    We have customized fields in zoho crm under accounts module like "Last production upgrade" --> This field is a date. When created a solution in zoho creator i couldn't find any of the customized fields. Would you please help me on this matter? Thanks
                                                                                                  • How to Add Bulk Data in Zoho Creator Forms Using Deluge Without Exceeding Execution Time Limit

                                                                                                    I have a database form with a column named 'Product Name' containing 8000 values in a Zoho Creator form. In another form named 'Returns Data,' I have a column with the same name, 'Product Name.' How do I add these 8000 values to the 'Returns Data' form
                                                                                                  • Open New Free Zoho Account

                                                                                                    Hi Team, Do you guys offer a free email hosting? I do have a domain already. If yes, what is the process to open the new account? Thanks,
                                                                                                  • 554 5.7.1 : Recipient address rejected: user info@intimspace.de does not exist

                                                                                                    554 5.7.1 : Адрес получателя отклонен: пользователь info@intimspace.de не существует I can't send an email to Google at info@intimspace.de. An error comes. I entered everything correctly in DNS https://zohomail.tools/#domainDetails/intimspace.de/ALL
                                                                                                  • Emails going back unread

                                                                                                    Hi all, When in Zoho mail - when I recieve a new mail it puts back all emails read that day back to unread - I then have to go back through and open all emails I have already read! Gets very annoying... Any idea on the bug fix?
                                                                                                  • Been getting this error, every now and then "Get count limit exceeded, please try again after 3 mins"

                                                                                                    it is really annoying.
                                                                                                  • Constraints on Tasks

                                                                                                    We have a use case where we have certain fixed date tasks and need to schedule predecessor tasks around these. Predecessor tasks need to be completed with a lag before the fixed date. We should be able to schedule the start and end date for predecessor
                                                                                                  • Moving Project Dependencies Not Moving Precedessors

                                                                                                    Most of the time we want to base our start dates around an event that is in the middle of the project template. If I set a bar up at the date we want it, it doesn't move the predecessors up. Is there a way to change this? eg. there is no point starting
                                                                                                  • Can you set task due dates to be "x" days before the milestone?

                                                                                                    We have a milestone set as the date of our first event. All of the tasks need to happen in increments prior to the milestone event. Is there a way to configure this without having to set up each task due date? Thanks!
                                                                                                  • Default ticket template in helpcenter

                                                                                                    Hello, I have a web form and a ticket template created. How can I make that my default ticket template? If an user clicks New ticket or create a ticket, I want that template to be the default one. Thank you for the time and info.
                                                                                                  • Expanded data-capturing capabilities with enhanced tabular sections

                                                                                                    We are thrilled to announce an update to Zoho Recruit that brings even more flexibility and customization to your recruiting process. With the addition of 10 new field types to the tabular sections, you now have the power to enhance your tabular sections
                                                                                                  • Integration of Business Hours in Email Templates

                                                                                                    Dear Zoho Desk Team, We would like to propose a feature enhancement to Zoho Desk that would greatly improve the utility of the Business Hours settings and streamline communication with our clients. Feature Request: Integration of Business Hours in Email
                                                                                                  • Add Owner to deluge-created module record note

                                                                                                    Is it possible to include the "owner" aka "creator", of a Note when creating it via delulge? This sets "superadmin" as the Note creator. I need to override it. notemap = Map(); notemap.put("Parent_Id",program_contact_id); notemap.put("Note_Content",program_contact_data.get('Note'));
                                                                                                  • Blueprint - Field Validation Criteria (During)

                                                                                                    When setting validation criteria elsewhere in Zoho, or even workflow criteria etc., there are Is Empty and Isn't Empty options.  Within the Field Validation Criteria within Blueprint, those options aren't available.  Is there a particular reason for this? 
                                                                                                  • Delete Field that is used in a Zoho Flow connection

                                                                                                    I'm trying to delete a Field used in a Webhook created by Zoho Flow with CRM Connection and i get the following alert: When going to the alert i get to the following issue, can't edit it since its been deployed by a pluggin But yes i have here the prompted
                                                                                                  • Use image on img HTML tag

                                                                                                    Hi how could I do to use my image saved in Workdrive to use it in an HTML img tag ? I need to display it on my website without having to use iframes. Regards,
                                                                                                  • ZOHO Compain emails going to spam after authentication is successful

                                                                                                    Hello, I am frustrated right now. I have recently setup the zoho email compaign, The auto responder email went to receipient spam folder. then, I researched a lot and completed authentication (SPF, DKIM) in email deliverability, email relay in zoho crm.
                                                                                                  • Security Policies

                                                                                                    To protect against cyber threats and attacks, organizations need to set up security policies for their employees' accounts. Security policies are rules and regulations for every individual or group using the organization's assets and resources. Enabling
                                                                                                  • Zoho CRM functions editor is not in the programming language deluge

                                                                                                    I am trying to write a function for a button. I helped someone before in deluge and I'm using this new editor I'm not familiar with - I guess it is new. Why is the default code statically typed? The editor will not let me create a variable without a type.
                                                                                                  • "Age in Days" calculation in Advanced Analytics

                                                                                                    Hi Can someone advise how this is calculated? I am getting values on this report which I cannot understand. Thank you
                                                                                                  • Automatically set quotes to "lost" if deal is set to lost

                                                                                                    Hi, Is there a way to automate that if a deal (opportunity) is lost the related quotes are also set to lost? Thanks!
                                                                                                  • Subdomain

                                                                                                    How can i make subdomain in my zoho website
                                                                                                  • A/R Aging Details shows wrong aging days

                                                                                                    In the A/R Summary Report all of the invoices are in the right aging buckets. When I run the A/R Aging Details report I get aged dates of +300 days when they should be in the 0-90 day range.
                                                                                                  • Global Choice List share ownership

                                                                                                    I have created several forms that use one or more Global Choice Lists. These lists have been published to Org. I would like to allow one or more admins to edit the choices in these lists. Any help appreciated. Geoff
                                                                                                  • Domain Transfer

                                                                                                    I have a Godaddy domain, how i can transfer it to Zoha? and how i can move my website to Zoho server? With my best wishes.
                                                                                                  • Project Templates & Reminders

                                                                                                    I am getting projects all set up to work for our company and am running into a problem that I'm hoping is easily fixable. I have created a project template and within that project, there are reminders set on certain tasks. When I create a project from
                                                                                                  • 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
                                                                                                  • Create customized SLAs for your customer base with support plans

                                                                                                    Managing customer expectations, prioritizing critical issues, and resolving customer inquiries on time is quite a juggle. Without a clear timelines or defined priorities, a support team may struggle with delays in response, SLA violations, and pending
                                                                                                  • Zoho Flow or Schedules

                                                                                                    I have a process where we text our leads 7 times over a 14 day with different content for each text. I created one flow in Zoho Flow to do this, but wondering if there is a more efficient way to accomplish this via Schedules. It goes on for 6 more times
                                                                                                  • Free webinar: Zoho Sign 2024 wrap-up - Everything that is new and has changed

                                                                                                    Hello, Are you looking up to catch up on all the updates made to Zoho Sign in 2024? Or are you still figuring out how you can use Zoho Sign better to get business paperwork done more efficiently? If so, we invite you to join us this Thursday, December
                                                                                                  • How to Customize Task Creation to Send a Custom Alert Using JavaScript in Zoho CRM?

                                                                                                    Hello Zoho CRM Community, I’m looking to customize Zoho CRM to send a custom alert whenever a task is created. I understand that Zoho CRM supports client scripts using JavaScript, and I would like to leverage this feature to implement the alert functionality.
                                                                                                  • Workflow - Execute Based on Date

                                                                                                    Hello, I have trouble understanding the documentation for Execute Based on Date or Date Time Field's Value. I want to send an email every time I have a Case opened for more than three days with its status unchanged. I set : This rule will be executed 3 days after [date].  Condition : Status is [New]. Instant Action : Send an email notification. However, I'm not sure I follow this part of the documentation: "For all the records matching the rule criteria, rule will be triggered either monthly or yearly
                                                                                                  • Can we set a BCC address as default to show while sending emails?

                                                                                                    Two things inside ZohoCRM are annoying me because it's a repeated work. First one is that I always need to click manually to add the BCC field while sending an email to a lead. Can we set a default address so when I click to send a new email the BCC address
                                                                                                  • Make collecting payments from your customers in Bigin easier with payment links

                                                                                                    Greetings, Efficient payment collection is crucial for business success. Bigin already helps your businesses manage and sell products effectively, but we can further enhance this by making payment collection easier. This integrated payment feature lets
                                                                                                  • Send email is not authenticated

                                                                                                    Hi, I’m getting an error in Gmail, when receiving an email from my account in zoho, my email is already authenticated in my domain, and I don't know why I keep receiving this message... also testing in outlook, the message goes directly to "junk".
                                                                                                  • Next Page