COD Confirmation Call API: A Voice AI Recipe for Indian E-commerce
A developer recipe for confirming cash-on-delivery orders with an AI phone call: order webhook in, outbound call out, a structured outcome back on the order.

What you will build
When a COD order is created, your server asks Nutaan to place an outbound call. The AI agent confirms the order and reads the address back in Hindi, Hinglish or English. When the call ends, Nutaan sends a webhook with the outcome, and your server tags or holds the order. If you are on Shopify and do not want to write code, use the ready-made COD confirmation workflow instead.
Architecture
| Step | Where | What happens |
|---|---|---|
| 1 | Your store | COD order created → webhook to your server |
| 2 | Your server | Filters eligible orders and calls POST /api/voice/calls/outbound with the order as variables; stores the returned callId against the order |
| 3 | Nutaan | Places the call, runs the agent, records the conversation |
| 4 | Nutaan → your server | The agent’s postCallWebhookUrl receives callId, outcome, transcript and analysis (including extractedData) |
| 5 | Your server | Looks up the order by callId and maps the result to a tag, hold or cancellation; schedules a retry if needed |
1. Create and configure the agent
Create a voice agent in the dashboard or with POST /api/voice/agents, choose a Hindi/Hinglish voice, and use a prompt like the one below. Then turn on post-call analysis and point the webhook at your server (PATCH /api/voice/agents/AGENT_ID with postCallAnalysis: true and postCallWebhookUrl). Full field lists are in the Nutaan API reference.
You are a polite order-confirmation assistant for {{store_name}}.
Speak in the customer's language (Hindi, Hinglish or English) and keep sentences short.
Say you are an automated assistant from {{store_name}}.
Goal: confirm the cash-on-delivery order and the delivery address.
1. Confirm the order: {{items}}, amount Rs {{amount}}, cash on delivery.
2. Read the address back slowly, including landmark and PIN code {{pincode}}.
3. If the address is wrong, ask for the correction and repeat it back.
4. If the customer wants to cancel, confirm the cancellation.
5. If they are busy, ask for a time to call back.
Never ask for card, UPI PIN, OTP or bank details. Never promise delivery dates you were not given.
Record a field cod_status with one of: confirmed, cancelled, address_corrected, callback, wrong_number, human_review.
If the address changed, record it in a field corrected_address.2. Place the call when a COD order arrives
Pass only what the conversation needs as variables, and keep the API key on your server. The endpoint returns a callId straight away; save it against the order.
// Node.js (server-side). Endpoint and fields: https://nutaan.com/developers#calls
app.post('/webhooks/orders-create', async (req, res) => {
const order = req.body;
res.sendStatus(200); // acknowledge the store webhook quickly
if (!order.payment_gateway_names?.includes('Cash on Delivery (COD)')) return;
const a = order.shipping_address;
const r = await fetch('https://nutaan.com/api/voice/calls/outbound', {
method: 'POST',
headers: { 'X-API-Key': process.env.NUTAAN_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
agentId: process.env.NUTAAN_COD_AGENT_ID,
to: a.phone, // E.164, e.g. +9198XXXXXXXX
variables: {
store_name: 'Your Store',
items: order.line_items.map(i => `${i.quantity} x ${i.title}`).join(', '),
amount: order.total_price,
address: [a.address1, a.address2, a.city].filter(Boolean).join(', '),
pincode: a.zip,
},
}),
});
const { callId } = await r.json(); // status: "queued"
await saveCallForOrder(callId, order.id);
});3. Handle the post-call webhook
When the call ends, the agent’s postCallWebhookUrl receives the callId, an outcome (completed, rejected, meeting_booked, no_response or natural_end), the transcript and — with post-call analysis on — an analysis object with summary, disposition, sentiment and extractedData. Map your cod_status field to an action. You can also poll GET /api/voice/calls/:id with the callId.
app.post('/webhooks/nutaan-call-ended', async (req, res) => {
res.sendStatus(200);
const { callId, outcome, analysis } = req.body;
const orderId = await orderForCall(callId);
if (!orderId) return;
if (outcome === 'no_response') return scheduleRetry(orderId);
const status = analysis?.extractedData?.cod_status;
const actions = {
confirmed: () => tagOrder(orderId, 'cod-confirmed'),
address_corrected: () => holdOrder(orderId, 'address-updated', analysis.extractedData.corrected_address),
cancelled: () => cancelOrder(orderId),
callback: () => scheduleRetry(orderId),
wrong_number: () => holdOrder(orderId, 'wrong-number'),
};
await (actions[status] || (() => holdOrder(orderId, 'review')))();
});4. Retries and calling hours
Retry unanswered calls at most twice, a few hours apart, inside 9 am–9 pm. Honour requested callback times. Stop immediately after an opt-out and log it. Orders still unconfirmed after the last attempt go to human review, not straight to cancellation.
Testing
Use your own test numbers. Try: confirm, cancel, a wrong address with a landmark, “call me later”, English mid-call, and silence. Check every outcome reaches your webhook and maps to the right action before switching on real orders.
Pricing
Calls are billed per connected minute: ₹6.00 up to 1,000 minutes a month, ₹4.50 to 2,000, ₹3.40 at 5,000 and ₹3.00 at 10,000 (GST extra). A typical COD call is around a minute. You can start free with ₹100 welcome credits. See pricing.
Frequently asked questions
Is there a free voice AI API for COD confirmation calls?
You can start free with ₹100 welcome credits; production calls are billed per connected minute.
Which languages can the COD call use?
Hindi, Hinglish, English and Indian regional languages.
Do I need Shopify to use this?
No. Any store or OMS that can send an order webhook and receive a call-ended webhook can use the API.
Written by the Nutaan team — we build and operate the AI calling and chat platform described here, running production voice and chat workloads for businesses across retail, healthcare, real estate, education and hospitality. Updated 19 November 2026. Pricing figures reference Nutaan's published rates; costs on other platforms vary. Questions or corrections: avishek@nutaan.com.



