How I Built an AI Voice Agent to Cut COD Returns by 40% A developer built an AI voice agent using Vyora's API to automatically confirm cash-on-delivery orders for D2C brands, reducing return-to-origin rates by 40%. The system integrates with Shopify and WooCommerce via webhooks, placing Hinglish calls within 60 seconds of order placement and handling outcomes like confirmation, cancellation, or retry. In a test with a fashion brand processing 800 COD orders per month, the agent cut RTO from 25% to 15%. If you run a D2C brand in India, COD is unavoidable. It accounts for 60–70% of all ecommerce orders. But it comes with a cost: 20–30% RTO Return to Origin rates that silently drain your margin. For a brand shipping 1,000 COD orders/month at 25% RTO: The fix most people reach for: hire telecallers to manually confirm orders. This costs ₹25,000–40,000/month per agent, and they max out at 80–120 calls/day. There's a better way. Here's what I built: Shopify/WooCommerce webhook ↓ Order placed COD ↓ POST to Vyora API ↓ AI voice agent triggers <60 seconds ↓ Hinglish/Hindi call to customer ↓ Outcome logged → Confirmed / Cancelled / No Answer ↓ Webhook fires back → Update OMS No human in the loop. Entire flow runs in under 2 minutes from order placement. Go to vyora.ai https://www.vyora.ai → Get Started → Create a new agent. Agent config: Script I used Hinglish : Namaste Main Brand Name ki taraf se bol raha hoon. Aapne abhi ek order place kiya hai — Product Name — ₹ Amount ka. Kya aap yeh order confirm karna chahte hain? If yes → Bahut acha Aapka order confirm ho gaya. Delivery 3-5 din mein hogi. If no → Koi baat nahi. Main order cancel kar deta hoon. This runs fully automatically. The agent handles "haan", "ha", "yes", "nahi", "cancel" — all variations. In Shopify Admin → Settings → Notifications → Webhooks Add webhook: orders/create Node.js handler: js const express = require 'express' ; const axios = require 'axios' ; const app = express ; app.use express.json ; app.post '/webhook/shopify-cod', async req, res = { const order = req.body; // Only trigger for COD orders if order.payment gateway == 'Cash on Delivery' { return res.status 200 .send 'skipped' ; } const payload = { phone: order.shipping address.phone, variables: { customer name: order.shipping address.name, product name: order.line items 0 .title, amount: order.total price, brand name: 'YourBrand' } }; await axios.post 'https://api.vyora.ai/v1/calls/trigger', payload, { headers: { 'Authorization': Bearer ${process.env.VYORA API KEY} , 'Content-Type': 'application/json' } } ; res.status 200 .send 'call triggered' ; } ; app.listen 3000 ; Deploy this to Railway or Render free tier works fine for under 500 orders/day . If you're on WooCommerce, use a webhook trigger on woocommerce new order : add action 'woocommerce new order', 'trigger vyora cod call', 10, 1 ; function trigger vyora cod call $order id { $order = wc get order $order id ; if $order- get payment method == 'cod' return; $phone = $order- get billing phone ; $name = $order- get billing first name ; $product = $order- get items ; $total = $order- get total ; $payload = json encode 'phone' = $phone, 'variables' = 'customer name' = $name, 'amount' = $total, 'brand name' = get bloginfo 'name' ; wp remote post 'https://api.vyora.ai/v1/calls/trigger', 'headers' = 'Authorization' = 'Bearer ' . VYORA API KEY, 'Content-Type' = 'application/json' , 'body' = $payload ; } Vyora fires a callback when the call completes. Set your callback URL in the Vyora dashboard. js app.post '/webhook/vyora-outcome', async req, res = { const { call id, outcome, order id } = req.body; if outcome === 'confirmed' { // Mark order as verified — proceed to dispatch await markOrderVerified order id ; } if outcome === 'cancelled' { // Cancel order in Shopify await cancelOrder order id ; } if outcome === 'no answer' { // Retry logic — try again after 30 mins await scheduleRetry order id, 1800 ; } res.status 200 .send 'ok' ; } ; Running this on a fashion brand with ~800 COD orders/month: | Metric | Before | After | |---|---|---| | RTO rate | 27% | 16% | | Monthly RTOs | 216 | 128 | | RTOs prevented | — | 88 | | Savings ₹350/RTO | — | ₹30,800/mo | | Vyora cost | — | ₹799/mo | ROI: 38x in month one. The biggest drop came from impulse buyers who cancelled on the call — orders that would have shipped, failed delivery, and come back. English IVR calls in India get ignored. Customers hang up or don't engage. When the agent speaks in the customer's language: For Tier 2/3 cities, this is non-negotiable. A brand in Jaipur selling to Rajasthan customers cannot run a confirmation call in English and expect results. Vyora's agents handle Hindi, Hinglish, Tamil, Telugu, Marathi out of the box. You pick the language per agent. For a full breakdown of the COD return problem and the data behind AI confirmation calls, read: How Indian D2C Brands Are Using AI Calls to Cut COD Returns by 40% https://www.vyora.ai/blog/ai-calls-reduce-cod-returns-d2c-india This is pre-dispatch only — filters fake orders before they ship. If you're losing more than ₹50,000/month to COD returns, this pays for itself on day one. Questions on the webhook setup? Drop them below. Tags: india ecommerce shopify node voiceai