image
4241
blog

In this article, I will show you how to verify a cash-on-delivery order from the customer.

We have also created a video tutorial on how to verify a cash-on-delivery order from the customer. 

You can watch the video tutorial:

It will be very helpful to protect fake orders on WooCommerce Store.

You can now confirm a cash-on-delivery order by sending a WhatsApp message to the buyer. The buyer will get a message on WhatsApp asking them to confirm the order by saying yes or no.

It will send a message to customers, asking them to confirm the order.

Let’s see how to do that by using the BotSailor. 

First, you need to create a message template in BotSailor, the message template that will be sent to customers as soon as they create a Cash on Delivery order.

Second, you have to create a new Webhook workflow and add the Webhook to the WooCommerce store. Then, you have to map data.

To create a message template, follow the instructions step by step:

  1. , Go to the Dashboard of BotSailor -> Click on the Bot Manager menu in the left sidebar of the Dashboard -> click on the message template option.

Before creating the message template, you have to create variables. At the bottom of the page, you will see the Template variable section.

To create a variable follow the below instructions: 

  1. Click on the create button -> provide a name for the variable in the Name field -> Click on the Save button.
  2. In this way, create two variables – Product list and Total price. 

To create a message template, follow the instructions below:

  1. Click on the create button -> provide a name in the template name field -> write a message in the message body -> use the two variables -- total price and product list.
  2. Click on the Quick Reply option -> write confirm order in the first Button Text field -> write cancel order in the second Button Text field -> click on the save button. 
  3. Click on the Check status button to see the status of the message template. 

Read the blog to know more on how to create message template by BotSailor:

How to create a Message Template for WhatsApp by BotSailor

You need to create postbacks for those quick replies. 

To create postback follow the instructions:

  1. Click on the Postback option -> Click on Create button.
  2. Configure the Start Bot Flow component. Double-click on the Start Bot Flow component.
  3. Provide a title in the Title field. Choosing a Label and choosing a sequence is optional. 
  4. Click on the Save button.
  5. Add a Text element to the Start Bot Flow component.
  6. Configure the Text element.
  7. Double-click on the Text element -> writes a message in the field -> click on ok button.
  8. Click on the Save button.   

In this way, you have to create two postback -- Confirm Order and Cancel Order. You have to use the two postback for the two quick replies. 

Now you have to create a Webhook workflow. To create a webhook workflow, follow the instructions below:

  1. Click on the Webhook Workflow menu in the left sidebar of the dashboard. 
  2. Click on the create button
  3. Scroll down to the bottom of the page to the Workflow details section. 
  4. Provide a name in the Workflow name field -> Then select the message template you have created to verify woocommerce order.  
  5.  Click on the create workflow button.

  • Now copy the Webhook URL.


  1. Go to your WordPress dashboard admin dashboard ->the WooCommerce plugin-> click on settings -> click on the Advance tab.
  2. Click on the Webhooks option on the advanced settings page.
  3. Click on the Add Webhook button. 

 

 

Instantly, the Webhook data form will appear. Fill out the form: 

  1. Provide a name in the Name field. 
  2. Select Active in the Status field. 
  3.  Select Order Created in the Topic field.
  4. In the Delivery URL field, paste the Webhook Callback URL that you have copied from the BotSailor.
  5. Now Click on the Save Webhook button.  

Now, you need to provide sample data for mapping. 

  1. Now go to BotSailor.
  2. Click on the Capture Webhook Response.

 Instantly, the Webhook Response Mapping page will appear with raw data.

It is sample data. When a Webhook is added, the sample data will be provided automatically. Just ignore this data.

  1. To do that, go to the WooCommerce store -> make a purchase order in WooCommerce.

  1. Now return to BotSailor-> click on the Connection details button
  2. Wait a few moments to get the real data collected from the order.

After getting the real data, you have to configure the Webhook Response Mapping. To configure the Webhook Response Mapping, you have to fill out some fields.

  1. select the billing->phone number option in the Phone Number field.
  2. Create and set a formatter to remove the plus sign from the phone number. (Because WhatsApp can’t send messages to a phone number that has a plus sign before the number.  )
  3. Select total price in the total price variable field. 
  4. Select line_items in the Product list variable field.

You have to use a formmater for the product list because there may be one item in the order. 

Now let's see how to create a formatter for the product list.

  1. Click on the new button in Data formatter section. 
  2. Provide a name in the Name field. 
  3. Select concat list items in the Action field. 
  4. Put a comma in the glue field. 
  5. Write "name" in the position field. 
  6. Click on the Save Formatter button

  1. Now select the formatter in the product list field. 

Now you have to select postback for the quick reply buttons in the message template. 

  1. Select Confirm order postback for the Confirm order field
  2. Select Cancel order postback for the Cancel order field

So, when the user clicks on the button, they will get a reply. Also, we need to confirm or cancel the order according to the button they click.

For that, we will use Call back APIs. Now, we will set up the API for confirming or canceling the order. For the "confirm order" button click, a note will be added to the order. The order will be cancelled if you click the Cancel Order button.

You can use only the "confirm order" button or both of them.

Let’s see how to create Callback APIs.

  1. To create a Callback API, click on the new button
  2. Provide a name in the name field.
  3. Select WooCommerce order note update in the API action field
  4. In the Select Store API field, select an integrated WooCommerce Store.
  5. Write a note in the Note field.
  6. Click on the Save Callback API button.

Now for the Confirmation order, select the Callback Api you have just created now.

 

Likewise, you have to create another callback API for cancel order button.

After you have created the Callback Api, select the API for cancel the order.

You don’t need to use the delay option because the message needs to be sent immediately. But you need to add a rule because this message will be sentt only to those who place the order with cash on delivery. 

Follow the instruction below to add a rule:

  1. Select the first option and then click on the Add rule button.
  2. Instantly, three fields – select data field, select operator, put value –  will appear. 
  3. In the select data field, select payment method: cod option.
  4. In the select operator field, select Equal(=) option
  5. Write cod, in the put value field.  
  6. Click on the save workflow button. 

 

 

To see report, click on the Workflow report button.

 

Now let's see how it works. 

  1. Go to WooCommerce and place an order with cash on delivery
  2. Refresh the BotSailor to see if the workflow has been completed or not. Yes, the Workflow has been completed.
  3. Let’s check on WhatsApp. 
  4. Yes, the message has been arrived. The message has the total price and product list.
  5. Now, if we click on the confirm button, a message will arrive and the purchase order should be confirmed on the WooCommerce shop.
  6.  And if we click on the Cancel order button, a message will arrive and  it will cancel the order.
  7. Let’s go to WooCommerce to check the order.

 


 

  1. Let’s go to WooCommerce to check the order.
  2. Click on the order, you can see that the note has been updated.

 

  1. Make another order.
  2.  After the BotSailor sends the WhatsApp message, let’s click on the Cancel button.
  3. go to the WooCommerce store order,
  4.  The order has been cancelled.

This is how you can use BotSailor’s WhatsApp integration with your WooCommerce store to verify the cash on delivery orders.

Thank you for reading the article. 

image

Kamrul Hasan

12 Dec 2022
  • Categories :

  • Uncategorized

(0) Comments

Related Articles

Stay ahead of the curve with BotSailor`s latest articles. Dive into expert analyses, industry trends, and actionable tips to optimize your experience. Explore our articles now and unlock the full potential of your business.

blog

How to set up the WhatsApp Cloud API with BotSailor

BotSailor is a complete WhatsApp marketing automation; it has chatbot, live chat, broadcasting, Shopify & WooCommerc...

READ MORE
blog

Send WooCommerce Order Notifications to WhatsApp by BotSailor Webhook Workflow

You can send Woocommerce Order Notifications to customers via WhatsApp by BotSailor in a very easy and straightforward w...

READ MORE
blog

BotSailor’s Affiliate Program

We're delighted to announce the opening of the BotSailor Affiliate Program today! We developed it as a way to thank the ...

READ MORE