{"slug": "build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify", "title": "Build a multilingual voice AI agent for ecommerce with Vapi and Shopify", "summary": "A developer has published a technical guide for building a multilingual voice AI sales agent for ecommerce, combining Vapi's voice gateway, Shopify's GraphQL API, OpenAI's GPT-4 for conversation, and Google Cloud Text-to-Speech for multilingual responses. The step-by-step walkthrough uses n8n for orchestration and details API endpoints, pricing, and estimated build time of 8-12 hours.", "body_md": "A **multilingual voice AI agent for ecommerce** lets you take orders, answer product questions, and upsell shoppers entirely over the phone in any of your supported languages. In this guide you'll assemble a Vapi-driven sales bot, connect it to Shopify via API, and add OpenAI-powered conversation plus Google Cloud Text-to-Speech for truly multilingual responses.\n\n**What is a voice AI sales agent?** It is an automated conversational system that interacts with customers through spoken language, answering queries, guiding purchases, and completing transactions without human intervention.\n\n| Tool | Plan / Price | Role |\n|---|---|---|\n| Vapi | Pay-as-you-go (check the current pricing page) | Voice gateway, call handling, multilingual STT/TTS |\n| Shopify | Standard plan (starts at $39 /mo) | Product catalogue, order management, GraphQL API |\n| n8n | Cloud (free tier available for low-volume testing - verify on n8n.io) or self-hosted (Community Edition - free) | Orchestration of API calls and webhook routing |\n| OpenAI GPT-4 | $0.03 / 1 K prompt tokens, $0.06 / 1 K completion tokens (check OpenAI pricing) | Conversational reasoning and dynamic response generation |\n| Google Cloud Text-to-Speech | $4.00 / 1 M characters (standard voices) - see Google Cloud pricing | High-quality multilingual speech synthesis |\n| Supabase (optional) | Free tier (up to 500 MB storage) - verify on supabase.com | Persistent storage for user sessions and analytics |\n\n**Estimated build time:** 8-12 hours, depending on familiarity with each platform.\n\nBelow is a step-by-step walk-through that you can follow line-for-line. Every setting, field, and API endpoint is spelled out so you can copy-paste where possible.\n\nVapi supports over 30 languages with a single endpoint, removing the need for separate language-specific pipelines.\n\n`read_products`\n\n, `read_inventory`\n\n, `write_orders`\n\n. For the full spec see ** Shopify developer docs**.\n\nWe'll use n8n to glue Vapi, OpenAI, Google Cloud, and Shopify together.\n\n`POST`\n\nand copy the generated URL - this will be the callback URL you register in Vapi (see step 5). `transcript`\n\nand `language`\n\nfields from Vapi's request payload.\n\n```\n{\n \"nodes\": [\n {\n \"parameters\": {\n \"value\": \"{{$json[\\\"speech\\\"][\\\"transcript\\\"]}}\",\n \"type\": \"string\"\n },\n \"name\": \"ExtractIntent\",\n \"type\": \"n8n-nodes-base.set\"\n }\n ]\n}\n```\n\n*What this does:* isolates the raw spoken text and the detected language so downstream nodes can work with a clean payload.\n\n`prompt`\n\nto a template like:\n\n```\n You are a helpful voice sales assistant for a Shopify store. Answer the customer's question in {{ $json[\"language\"] }} and keep the tone friendly and concise.\n```\n\nSet **Model** to `gpt-4`\n\n.\n\n`https://{{store}}.myshopify.com/admin/api/2023-10/graphql.json`\n\n). Use the `Authorization: Bearer`\n\nheader. The GraphQL query can be:\n\n```\n{\n products(first: 5, query: \"{{ $json[\"userQuery\"] }}\") {\n edges {\n node {\n title\n variants(first: 1) {\n edges {\n node {\n price\n }\n }\n }\n }\n }\n }\n}\n```\n\n*What this does:* pulls the top-matching products for the user's request, which the OpenAI node can then reference when building its answer.\n\nConnect the **Webhook** node to Vapi: In Vapi's dashboard, under *Application → Webhooks* add a new *Call Ended* webhook and paste the n8n webhook URL. Choose **POST** and set **Content-type** to `application/json`\n\n.\n\nAdd a **Google Cloud TTS** HTTP Request node named *SynthesizeSpeech*. Use the `languageCode`\n\nfrom Vapi's payload (e.g., `es-ES`\n\nfor Spanish) and the text from OpenAI's response. Example request body:\n\n```\n{\n \"input\": { \"text\": \"{{ $json[\\\"choices\\\"][0][\\\"message\\\"][\\\"content\\\"] }}\" },\n \"voice\": { \"languageCode\": \"{{ $json[\\\"language\\\"] }}\", \"ssmlGender\": \"NEUTRAL\" },\n \"audioConfig\": { \"audioEncoding\": \"MP3\" }\n}\n```\n\nRemember to set the **Authorization** header to `Bearer {{YOUR_GOOGLE_CLOUD_ACCESS_TOKEN}}`\n\n.\n\nPress **Activate** in n8n. The workflow will now listen for incoming calls, process the spoken request, query Shopify, generate a multilingual answer via OpenAI, synthesize it, and play it back.\n\nIf anything fails, the **Execution Log** in n8n will show which node errored and the exact response payloads.\n\nAdd a **PostgreSQL** node after *ExtractIntent* to store `call_id`\n\n, `language`\n\n, and `last_intent`\n\n. This lets you implement multi-turn dialogues (e.g., \"Add that to my cart\") without losing context between webhook calls.\n\nSet up alerts in n8n or your cloud provider to avoid surprise bills.\n\n| Failure mode | Symptom | Fix |\n|---|---|---|\nVapi language detection mismatch |\nAgent replies in the wrong language | Verify the language codes sent by Vapi; override by forcing a known code in the Set node if needed. |\nShopify API rate limit (40 req/s per shop) |\nHTTP 429 Too Many Requests in FetchProduct node |\nImplement an n8n Delay node (e.g., 200 ms) before each Shopify request, or cache frequent queries in Supabase. |\nOpenAI token quota exceeded |\n429 Too Many Requests from OpenAI node |\nUpgrade the OpenAI billing plan or add a Retry node with exponential back-off. |\nGoogle Cloud TTS auth expiration |\n401 Unauthorized in SynthesizeSpeech\n|\nUse a service account key and rotate the token every hour with a Cron workflow that refreshes `YOUR_GOOGLE_CLOUD_ACCESS_TOKEN` . |\nn8n webhook unreachable (e.g., public URL not reachable) |\nVapi logs \"Webhook delivery failed\" | Ensure the n8n instance has a stable HTTPS endpoint (use n8n.cloud or expose self-hosted via ngrok for testing). |\nCost blow-up on high call volume |\nUnexpected spikes in Vapi or OpenAI bills | Set a daily spend limit in Vapi, and add a Function node that checks a Supabase-stored `budget_remaining` flag before proceeding with expensive calls. |\n\nA single Vapi-Shopify integration can handle at least 5 concurrent calls on a modest cloud VM without degradation, provided you respect Shopify's 40 req/s limit.\n\nAdd the ISO language code (e.g., `de-DE`\n\nfor German) in Vapi's *Multilingual* settings, then ensure the Google Cloud TTS request uses the same `languageCode`\n\n. No code changes are required unless you use language-specific prompts.\n\nYes. Use the **n8n Community Edition** Docker image, host your own PostgreSQL for Supabase-compatible storage, and run a small VM for the webhook. Vapi and Google Cloud remain SaaS components, but you can replace them with open-source alternatives if you need a fully on-prem solution.\n\nTypical end-to-end latency is 1.2-1.8 seconds: ~300 ms for STT, ~500 ms for OpenAI processing, ~300 ms for Shopify GraphQL, and ~200 ms for TTS synthesis. Optimize by caching product data and re-using the OpenAI session token.\n\nNo. Vapi's voice gateway can detect the caller's language on a single inbound number, then route the request to the same workflow which dynamically selects the appropriate TTS voice.\n\nVisit the **Shopify GraphQL Explorer** or the **Shopify Developers** page for sample queries. The snippet in step 4 works for most \"search-by-keyword\" use cases.\n\nStore all secret keys in n8n's **Credentials** store, not in workflow JSON. Mark them as **Encrypted** and restrict access to the n8n UI via SSO or IP allow-listing.\n\nIf you're looking for more ready-made automation ideas, check out our guide on ** AI automations you can sell** and grab", "url": "https://wpnews.pro/news/build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify", "canonical_source": "https://dev.to/samchenreviews/build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify-5ff5", "published_at": "2026-09-03 16:30:31+00:00", "updated_at": "2026-09-03 16:56:32.082049+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "developer-tools", "natural-language-processing"], "entities": ["Vapi", "Shopify", "OpenAI", "Google Cloud", "n8n", "GPT-4", "Supabase"], "alternates": {"html": "https://wpnews.pro/news/build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify", "markdown": "https://wpnews.pro/news/build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify.md", "text": "https://wpnews.pro/news/build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify.txt", "jsonld": "https://wpnews.pro/news/build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify.jsonld"}}