---
title: C.O.D. Verification
slug: business-phone-system/cod-verification
docTags: 
createdAt: 2025-10-10T12:15:53.104Z
---

**Cash on Delivery (COD)** has been a major growth driver for the e-commerce industry. However, it also introduces operational risks such as cancellations, fake orders, and failed deliveries.
Reducing COD-related losses is therefore a key focus area for most e-commerce businesses.

With **Exotel’s automated COD verification**, you can confirm the legitimacy of COD orders before dispatch — reducing failed deliveries and optimizing operational costs.

***

## Advantages

- **Reduce No-shows**
  An automated call is triggered to the customer before delivery to confirm their availability and willingness to receive the order.
- **Avoid First Attempt Failures**
  On the day of delivery, an automated IVR call checks whether the customer is available.
  Customers can confirm or reschedule deliveries via keypad input.
  The input is relayed to your CRM or backend system in real time.

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/Ups6l9KU-CH-AVAQ6oMt--20260729-043015.png?1625050055)

***

## Implementation Steps

### 1. Automated Call Trigger on COD Order

When a COD order is placed, your system can trigger an automated verification call to confirm the order and customer number.

### 2. Send Details to Exotel

Your server sends the **customer number** and **call flow** details to Exotel via API.

### 3. Exotel Initiates the Call

Exotel automatically calls the customer with a pre-defined IVR flow to confirm the order.

### 4. Capture Customer Input

Based on customer input (e.g., *Press 1 to confirm*, *Press 2 to cancel*), your CRM can mark the order status as verified, canceled, or pending.

***

## API Implementation

Exotel API to Connect a Call to a Flow

```javascript
https://<your_api_key>:<your_api_token>@<subdomain>/v1/Accounts/<your_sid>/Calls/connect
```

This API first calls the From number, and once the recipient answers, connects them to the call flow (applet) you’ve created in the system — for example, a landing app with IVR or greeting logic.
An HTTP POST request is made to the above endpoint.

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/YsVIaekT6bQ71oKluZZbX-20260729-043012.png?1625050055)

### API Credentials

Navigate to **API Settings** in your Exotel Dashboard and retrieve:

1. **Account SID**&#x20;
2. **API Token**&#x20;
3. **API Key**&#x20;

For details, see:
&#x20;How to find my API Key, API Token, Account SID, and Subdomain?

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/h_Hn5lU2DlNjC8h4R-hRi-20260729-043013.png?1625050055)

### Mandatory Parameters

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/ao25Om06VQWkTr97_0Ikc-20260729-043014.png?1625050055)

Detailed documentation for all parameters is available here:
&#x20;https\://developer.exotel.com/api#call-customer

:::BlockQuote

:::

:::hint{type="info"}
The call flow referenced in the API must be created in your Exotel Dashboard: [https://my.exotel.com](https://my.exotel.com)
:::

## Sample Call Flow

1. Go to **App Bazaar → Create Flow → Enter Flow Name**&#x20;
2. Use the following applets in sequence:&#x20;

### Applets to Use

- **Gather** — captures customer keypad input&#x20;
- **Passthru** — sends input data to your server via webhook&#x20;
- **Hangup** — ends the call gracefully&#x20;

**Steps:**

1. Drag and drop the **Gather Applet** – digits entered will be recorded and stored.&#x20;
2. Drag and drop the **Passthru Applet** – link it to your webhook URL.&#x20;
3. Add the **Hangup Applet** at the end of the flow.&#x20;
4. Save the flow.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/xfZ79xe2binmlhyzPgpN3-20260729-043015.png?1625050898" size="54" width="368" height="179" position="center" showCaption="false"}

Assign an **Exophone** to the newly created flow:

::Image[]{src="https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/EPEoMnLlvTf73pQXZCT65-20260729-043016.png?1625050906" size="62" width="355" height="280" position="center" showCaption="false"}

## Implementing COD Verification with Google Sheets

To simplify data collection, you can integrate Exotel with Google Sheets using a simple Apps Script.

### Steps

1. Open a new **Google Sheet**.&#x20;
2. In **Script Editor**, paste the following code.&#x20;
3. Deploy the script as a **web app** and copy the **web app URL**.&#x20;
4. Use this URL as the **Passthru webhook** in your Exotel flow.&#x20;

### Sample JavaScript Code

:::BlockQuote
// Spreadsheet configuration
var ID = "1M2-MShDX8pIvJlwtPwTvDCPnDSTQw\_OfNuI6fODIyIk"; // Sheet ID
var SHEET\_NAME = "Sheet1";// Append data to sheet
function doGet(e) \{
&#x20; var params = JSON.stringify(e.parameters);
&#x20; var jsonMapping = JSON.parse(params);
&#x20; var sheet = SpreadsheetApp.openById(ID).getSheetByName(SHEET\_NAME);
&#x20; sheet.appendRow(\[jsonMapping\["From"]\[0], jsonMapping\["digits"]\[0]]);
&#x20; return ContentService.createTextOutput(e.parameters);
}
:::

::Image[]{src="https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/CGrSoGZ_KMyKjUTZ-FfRS-20260729-043013.png?1625050055" size="84" width="793" height="44" position="center" showCaption="false"}

Replace:

- ID → the **Sheet ID** from the Google Sheets URL&#x20;
- SHEET\_NAME → the name of the sheet where you want to store data&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/GVvAA4UZpqeVFCvfPakBs-20260729-043011.png?1625050054" size="74" width="544" height="64" position="center" showCaption="false"}

### Deploy the Script

When deploying:

- **Project Version:** Enter a version name&#x20;
- **Execute as:** *Me (your email)*&#x20;
- **Who has access:** *Anyone, even anonymous*&#x20;
- Click **Deploy** to get your **web app URL**&#x20;

Use this webhook URL in the **Passthru Applet** in your Exotel call flow.

## Watch a short video

:::Iframe{iframeHeight="0" code="<div style=&#x22;position: relative;padding-bottom: 56.25%;height: 0;border-radius: 0;box-shadow: 0 15px 40px rgba(63,58,79,.3);overflow: hidden;min-width:320px&#x22;><iframe src=&#x22;https://learn.exotel.com/share/ZtLWusxRPcekfiQJ0gOQWA/embed?autoplay=false&#x22; frameborder=&#x22;0&#x22; webkitallowfullscreen mozallowfullscreen allowfullscreen allow=&#x22;autoplay; fullscreen&#x22; style=&#x22;position: absolute; top: 0; left: 0; width: 100%; height: 100%;&#x22;></iframe></div>"}

:::
