What is C.O.D Verification?

Cash on delivery (COD) is a great enabler for the e-commerce industry. But, it also is one of the leading sources of operational loss due to cancellations and bogus orders. Hence, reducing COD failures is the top priority for e-commerce players. 

Using Exotel, you can ensure that your COD orders are legitimate before you ship them out. It also helps you in cutting the operational cost making it more economically feasible.


  • Reduce no-shows
    An automated call is triggered to the customer before the delivery to confirm if the customer is ready to go ahead with the order. 

  • To Avoid First Attempt Failure
    An automated call on the day of delivery can be made to the customer to check availability and an IVR is played to reschedule if necessary. The input given by the customer will be passed to you in real-time.

Implementation of COD Verification

  • Automated call on placing a COD order: 
    An automated call is triggered when a COD order is placed to verify the order and number 

  • Your server sends the info to Exotel: 
    Your server sends the customer number and call flow to be played in the automated call. 

  • Exotel dials the customer: 
    Exotel calls the customer with an automated voice call instantly to verify the order. 

  • Order verified: 
    Based on the customer’s input (press 1 to confirm, press 2 to deny, etc.), the order can be marked as verified in the CRM. 

API Implementation:

Exotel API to connect a call to a flow:


This API will first call the From number, and once they pick up the phone, it will connect them to a call flow (aka applet) that you have created in the system - like your landing app, or any other app that can play a greeting, have IVR, etc. An HTTP POST request is made to the above-mentioned API.

API Credentials: 

Go to API settings and use your

  1. Account SID
  2. API Token
  3. API Key

You can refer to the article on where you will find the API key and token. How to find my API Key, API Token, Account SID and Subdomain?

Note for Subdomain:

  • If the account SID ends with any number from 0 to 9 --> Singapore Cluster (

  • If the account SID ends with the alphabet “m” --> Mumbai Cluster (

Mandatory Parameters:

A detailed description of various parameters and how to use the above API can be found here:

The call flow has to be created in the Exotel dashboard:

Sample Call flow:

Steps: Go to App Bazar > Click on create > Enter the flow name

You can also refer to this article to check on how to create a call flow.

Applets to be used: 

  • Gather

  • Passthru

  • Hangup

  1. Drag and drop the Gather Applet. The digits entered at the Gather applet will be captured and tabulated in the spreadsheet. 
  2. Drag and drop the Passthru Applet. 
  3. Use the web app URL that was created earlier, in the Passthru applet. 
  4. Drag and drop the Hangup Applet. 
  5. Save the flow. 
  6. Assign an Exophone to the newly created flow

How to implement COD Verification use-case using Exotel and spreadsheets:

  • Open a new spreadsheet. 

  • Upload the below code in the script editor of the spreadsheet.

  • Publish the code to get a web app URL.

  • Once deployed, copy the web app URL which will be used later in the Exotel flow. 

  • Open your Exotel account and create the flow below in the App Builder.

Javascript Code:

//Id of the spreadsheet 

//for spreadsheet"

// has id as 1BsalnnI5_yBRke6brWk5G54Qwm5dgonN_YnLXJa

var ID = "1M2-MShDX8pIvJlwtPwTvDCPnDSTQw_OfNuI6fODIyIk"

  //Nme of the specific sheet inside the spreadsheet where data to  be dumped

var SHEET_NAME = "Sheet1"

  //Nme of the specific sheet inside the spreadsheet where numbers are available

function doGet(e) {

  var params = JSON.stringify(e.parameters);

  var jsonMapping = JSON.parse(params)

  var sheet = SpreadsheetApp.openById(ID).getSheetByName(SHEET_NAME)

  sheet.appendRow([jsonMapping["From"][0], jsonMapping["digits"][0]])

  return ContentService.createTextOutput(e.parameters)


  1. Replace the Sheet ID (var ID) from the URL as in the screenshot below

  2. Replace the Sheet Name (var SHEET_NAME) from the sheet as in the screenshot below

  1. Deploy the script as a web app

    - Once the script is done, select the menu item Publish > Deploy as web app. A window will pop up on your screen.
    - Under Project Version, type the name of the project.
    - Under Execute the app as a section, select Me (Email).
    - Under Who has access to the app, select Anyone, even anonymous. This helps make the web app accessible to Exotel.
    - You can then click on Deploy to get the web app URL, which can be used in the Exotel flow.

  1. Use the Webhook created in the call flow, in the pass-thru applet.

Sample Sheet Integration here:

Case Study:

If you have any questions or concerns, please connect with us using the chat widget on your Exotel Dashboard or Whatsapp us on 08088919888.