← All posts
How-ToAugust 30, 2026 · 6 min

Build a multilingual voice AI agent for ecommerce with Vapi and Shopify

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.

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.

What you need

ToolPlan / PriceRole
VapiPay-as-you-go (check the current pricing page)Voice gateway, call handling, multilingual STT/TTS
ShopifyStandard plan (starts at $39 /mo)Product catalogue, order management, GraphQL API
n8nCloud (free tier available for low-volume testing - verify on n8n.io) or self-hosted (Community Edition - free)Orchestration of API calls and webhook routing
OpenAI GPT-4$0.03 / 1 K prompt tokens, $0.06 / 1 K completion tokens (check OpenAI pricing)Conversational reasoning and dynamic response generation
Google Cloud Text-to-Speech$4.00 / 1 M characters (standard voices) - see Google Cloud pricingHigh-quality multilingual speech synthesis
Supabase (optional)Free tier (up to 500 MB storage) - verify on supabase.comPersistent storage for user sessions and analytics

Estimated build time: 8-12 hours, depending on familiarity with each platform.

How to create a multilingual voice AI agent for ecommerce

Below 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.

1. Register and configure Vapi

  1. Sign up at Vapi.ai and create a new Voice Application.
  2. In Application Settings enable Multilingual Speech-to-Text and Multilingual Text-to-Speech. Add the languages you want to support (e.g., English, Spanish, French).
  3. Note the generated API Key (under Developer > API Keys) - you'll need it for n8n authentication.

Vapi supports over 30 languages with a single endpoint, removing the need for separate language-specific pipelines.

2. Set up a private Shopify app

  1. Log into your Shopify admin and navigate to Apps → Develop apps for your store.
  2. Click Create an app, give it a name like VoiceSalesBot, and enable the following API scopes: read_products, read_inventory, write_orders.
  3. After saving, click API credentials and copy the Admin API access token and Storefront access token. Keep them secure; they will be used by n8n to query product data and create orders.

For the full spec see Shopify developer docs.

3. Spin up an n8n workflow

We'll use n8n to glue Vapi, OpenAI, Google Cloud, and Shopify together.

  1. Create a new workflow and add a Webhook node. Set HTTP Method to POST and copy the generated URL - this will be the callback URL you register in Vapi (see step 5).
  2. Add a Set node named ExtractIntent to pull the transcript and language fields from Vapi's request payload.
json
{
 "nodes": [
 {
 "parameters": {
 "value": "{{$json[\"speech\"][\"transcript\"]}}",
 "type": "string"
 },
 "name": "ExtractIntent",
 "type": "n8n-nodes-base.set"
 }
 ]
}

What this does: isolates the raw spoken text and the detected language so downstream nodes can work with a clean payload.

  1. Insert an OpenAI node (use the Chat Completion operation). Map the prompt to a template like:
 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.
 

Set Model to gpt-4.

  1. Add a HTTP Request node called FetchProduct that calls Shopify's GraphQL endpoint (https://{{store}}.myshopify.com/admin/api/2023-10/graphql.json). Use the Admin API access token in the Authorization: Bearer header. The GraphQL query can be:
graphql
{
 products(first: 5, query: "{{ $json["userQuery"] }}") {
 edges {
 node {
 title
 variants(first: 1) {
 edges {
 node {
 price
 }
 }
 }
 }
 }
 }
}

What this does: pulls the top-matching products for the user's request, which the OpenAI node can then reference when building its answer.

  1. Connect 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.
  1. Add a Google Cloud TTS HTTP Request node named SynthesizeSpeech. Use the languageCode from Vapi's payload (e.g., es-ES for Spanish) and the text from OpenAI's response. Example request body:
json
{
 "input": { "text": "{{ $json[\"choices\"][0][\"message\"][\"content\"] }}" },
 "voice": { "languageCode": "{{ $json[\"language\"] }}", "ssmlGender": "NEUTRAL" },
 "audioConfig": { "audioEncoding": "MP3" }
}

Remember to set the Authorization header to Bearer {{YOUR_GOOGLE_CLOUD_ACCESS_TOKEN}}.

  1. Finally, add a Response node that returns the synthesized MP3 URL back to Vapi. Vapi will stream the audio to the caller automatically.

4. Deploy the workflow

Press 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.

5. Test end-to-end

  1. From the Vapi console, click Dial Test Number (you can use any SIP-compatible phone or a mobile).
  2. Speak a request such as "¿Cuál es el precio de la chaqueta azul?"
  3. The system should:

Detect Spanish, Query Shopify for "blue jacket", Have GPT-4 formulate a short answer in Spanish, Synthesize the reply with Google Cloud TTS, * Play the audio back to you.

If anything fails, the Execution Log in n8n will show which node errored and the exact response payloads.

6. Optional: Persist sessions in Supabase

Add a PostgreSQL node after ExtractIntent to store call_id, language, and last_intent. This lets you implement multi-turn dialogues (e.g., "Add that to my cart") without losing context between webhook calls.

7. Scale and monitor costs

  • Vapi charges per minute of call time; monitor via the Usage dashboard.
  • OpenAI usage is token-based; a typical sales interaction consumes ~150 prompt tokens and ~250 completion tokens.
  • Google Cloud TTS charges per character; a 30-second reply is roughly 400 characters.

Set up alerts in n8n or your cloud provider to avoid surprise bills.

Where this breaks

Failure modeSymptomFix
Vapi language detection mismatchAgent replies in the wrong languageVerify the language codes sent by Vapi; override by forcing a known code in the Set node if needed.
Shopify API rate limit (40 req/s per shop)HTTP 429 Too Many Requests in FetchProduct nodeImplement an n8n Delay node (e.g., 200 ms) before each Shopify request, or cache frequent queries in Supabase.
OpenAI token quota exceeded429 Too Many Requests from OpenAI nodeUpgrade the OpenAI billing plan or add a Retry node with exponential back-off.
Google Cloud TTS auth expiration401 Unauthorized in SynthesizeSpeechUse a service account key and rotate the token every hour with a Cron workflow that refreshes YOUR_GOOGLE_CLOUD_ACCESS_TOKEN.
n8n webhook unreachable (e.g., public URL not reachable)Vapi logs "Webhook delivery failed"Ensure the n8n instance has a stable HTTPS endpoint (use n8n.cloud or expose self-hosted via ngrok for testing).
Cost blow-up on high call volumeUnexpected spikes in Vapi or OpenAI billsSet a daily spend limit in Vapi, and add a Function node that checks a Supabase-stored budget_remaining flag before proceeding with expensive calls.

A 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.

Frequently asked questions

How do I add support for a new language?

Add the ISO language code (e.g., `de-DE` for German) in Vapi's *Multilingual* settings, then ensure the Google Cloud TTS request uses the same `languageCode`. No code changes are required unless you use language-specific prompts.

Can I run this stack entirely self-hosted?

Yes. 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.

What's the latency from the moment a caller speaks to hearing the reply?

Typical 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.

Do I need a separate phone number for each language?

No. 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.

Where can I find ready-made templates for Shopify product queries?

Visit 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.

How do I protect my API credentials from exposure?

Store 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. --- If you're looking for more ready-made automation ideas, check out our guide on AI automations you can sell and grab the free guide for deeper insights into voice-first commerce. Happy building!

Get the full toolkit

Grab the free guide with the node-by-node build for all 10 automations.

No spam. Unsubscribe anytime. Just the good stuff.