ByteChef logo
ByteChef
tutorials

AI-driven WhatsApp Order Status Automation with Shopify

AI-driven WhatsApp Order Status Automation with Shopify
5 min read
Nikolina Špehar

Handling customer inquiries can be a challenging and time-consuming task, especially when dealing with a large number of customers. Answering the questions can become time-consuming very fast and having employee delegated to just that can be costly.

To provide a better customer experience and to relieve the burden of customer service, integrating AI-driven WhatsApp bots to handle Shopify order status updates can be an effective solution.

In this ByteChef tutorial, we will guide you through the steps of building an AI-driven WhatsApp bot that can update customers on their order status directly via WhatsApp.

Problem & Solution

Swamping customer service with endless order status inquiries can be a big problem. Employees spend a lot of their time dealing with easy, repeating tasks, which can lead to decreased productivity and increased costs.

By automating the process of handling order status inquiries, we can free up employee time to focus on more complex and valuable tasks.

Workflow Overview

The workflow can be broken down into the following steps:

  1. Trigger: new customer WhatsApp message
  2. Order retrieval: extracting order ID from the message and fetching the order
  3. Conditional check: security check for order ownership
  4. Response: sending a response to the customer
WhasApp AI-Driven Bot Handle Shopify Order Workflow

1. Trigger: New Customer WhatsApp Message

The automation process starts when the customer sends a message to the WhatsApp bot. The bot will then trigger the automation process based on the customer's message. For that purpose the workflow uses infobip/v1/newWhatsappMessage trigger. The trigger dynamically recieves data from the WhatsApp message, via HTTP request, and passes it to the next step of the workflow.

Infobip New WhatsApp Message Trigger
  • Trigger label recommendation: New WhatsUp message about the order status

  • Key parameters:

    1. Number: phone number of your WhatsApp Bot
    2. Keyword: Package (but will depend on how you set up your WhatsApp Bot template)

2. Order Retrieval

Workflow uses two components in order to retrieve order from Shopify. Firstly the openAi/v1/ask is used to extract order number from the WhatsApp text message. Then the workflow uses that order number to retrive the order using the shopify/v1/getOrder action.

Open AI Ask Configuration

Open AI Ask Configuration 1
  • Label recommendation: Extract order number from the text message

  • Key parameters:

    1. Model: any model you have access to, in this case gpt-4.1-mini
    2. Format: Simple
    3. Prompt: Give me order number from this text message: ${trigger_1.results[0].message.text}
    4. Response: Structured data

After choosing Structured data as response format new button appears Open JSON Schema Builder. By pressing it you access editor where you can define the schema of the response.

Open AI Ask Structured Data Configuration
  • Key parameters:
    1. Pill Type: Object
    2. Pill Title: order
    3. click on Add Data Pill
    4. Pill Type: String
    5. Pill Title: orderNumber
    6. Pill Key: orderNumber

Shopify Get Order Configuration

After the output of the OpenAI component has been configured, the workflow can access whole Shopify order using the order number.

Shopify Get Order Configuration
  • Label recommendation: Retrieving order from Shopify
  • Key parameters:
    1. Order ID: ${openAi_1.orderNumber}

3. Conditional Check for Security

The workflow adds a security check to ensure that the customer who is asking about their order is the actual owner of the order. If not, the customer will not be able to access order details. This step ensures that only authorized users can access their order information.

Condition Configuration

a) If false → workflow sends message to user that phone numbers do not match

b) If true → workflow proceeds to send a response to the user

  • Label recommendation: Check if the phone numbers match
  • Key parameters:
    1. Raw Experssion: false
    2. add OR condition
    3. add AND condition and choose String Expression as a type
    4. Value 1: ${trigger_1.results[0].from}
    5. Operation: equals
    6. Value 2: ${shopify_1.customer.phone}

4. Sending Response to Customer

Depending on the result of the security check, the workflow sends a response to the customer. If the phone numbers match, the bot provides the order status. If they don't match, the bot informs the customer that they are not authorized to view the order details.

Infobip Send WhatsApp Template Message

If the security check passes, before the bot sends a response to the customer. The workflow uses openAi/v1/ask to enhance the response.

Open AI Ask Configuration 2
  • Label recommendation: Enhance response to customer
  • Key parameters:
    1. Model: any model you have access to, in this case gpt-4.1-mini
    2. Format: Simple
    3. Prompt: ${shopify_1} this is customers order object. I need you to write me a text that will cover everything from the order nicely
    4. Response: Text

Workflow Summary

The workflow automates the process of handling Shopify order status inquiries via WhatsApp, ensuring a seamless shopping experience for your customers. It includes steps for triggering the automation process, retrieving order information, performing security checks, and sending responses to customers. By automating these tasks, you can free up your customer service team to focus on more complex and valuable work.

Possible Enhancements

The workflow can be enhanced by:

  • adding one more layer of security by also checking the email of the order owner
  • adding prompts that will change where the user gets response
  • integrating multi-language support
  • setting up automatic WhatsApp notifications when the order status changes

ByteChef's modular design allows these additions with minimal configuration.

Conclusion

The workflow outlined here is just the beginning, start with a basic implementation, test it with real customers, gather feedback, and continuously enhance the bot as your business scales. By embracing AI-driven automation, you’re not only solving today’s customer service challenges but also future-proofing your business for an increasingly digital and conversational commerce landscape. Customers now expect instant, reliable information, and with these tools, you can deliver exactly that.