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

> Source: <https://dev.to/samchenreviews/build-a-multilingual-voice-ai-agent-for-ecommerce-with-vapi-and-shopify-5ff5>
> Published: 2026-09-03 16:30:31+00:00

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.

| Tool | Plan / Price | Role |
|---|---|---|
| Vapi | Pay-as-you-go (check the current pricing page) | Voice gateway, call handling, multilingual STT/TTS |
| Shopify | Standard plan (starts at $39 /mo) | Product catalogue, order management, GraphQL API |
| 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 |
| 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 pricing | High-quality multilingual speech synthesis |
| Supabase (optional) | Free tier (up to 500 MB storage) - verify on supabase.com | Persistent storage for user sessions and analytics |

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

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.

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

`read_products`

, `read_inventory`

, `write_orders`

. For the full spec see ** Shopify developer docs**.

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

`POST`

and copy the generated URL - this will be the callback URL you register in Vapi (see step 5). `transcript`

and `language`

fields from Vapi's request payload.

```
{
 "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.

`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`

.

`https://{{store}}.myshopify.com/admin/api/2023-10/graphql.json`

). Use the `Authorization: Bearer`

header. The GraphQL query can be:

```
{
 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.

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`

.

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:

```
{
 "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}}`

.

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.

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

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.

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

| Failure mode | Symptom | Fix |
|---|---|---|
Vapi language detection mismatch |
Agent replies in the wrong language | Verify 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 node |
Implement an n8n Delay node (e.g., 200 ms) before each Shopify request, or cache frequent queries in Supabase. |
OpenAI token quota exceeded |
429 Too Many Requests from OpenAI node |
Upgrade the OpenAI billing plan or add a Retry node with exponential back-off. |
Google Cloud TTS auth expiration |
401 Unauthorized in SynthesizeSpeech
|
Use 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 volume |
Unexpected 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. |

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.

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.

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.

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.

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.

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.

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
