---
title: Build a Shopify operations agent with Vercel Connect
description: Create a staff agent that searches products and checks orders through Vercel Connect, and asks for approval before it changes your catalog.
url: "https://vercel.com/kb/prompts/build-shopify-operations-agent"
last_updated: 2026-11-10
related_resources:
  "[Build a Shopify agent with AI SDK and Vercel Connect](/kb/guide/shopify-agent-ai-sdk-vercel-connect)": "Build a Shopify agent with AI SDK and Vercel Connect to search products, check orders, and request approval before changing your catalog."
  "[Vercel Connect](https://vercel.com/docs/connect)": "Give agents and services short-lived, scoped access to third-party APIs without storing provider credentials."
---

# Build a Shopify operations agent with Vercel Connect

Create a staff agent that searches products and checks orders through Vercel Connect, and asks for approval before it changes your catalog.

Give store staff an agent that answers product and order questions from live Shopify data. Catalog changes wait for a person to approve them, and the app never stores a Shopify token.

Start in an empty workspace or open your existing Next.js app in your coding agent. Use a Shopify development store and a test product. The handoff carries prompt text, not your repository, store access, or credentials.

Expect a local chat agent with read tools, an approval step for product edits, and tests for denied, altered, and replayed requests. This first version does not change orders or contact customers.

## Agent prompt

```text
Build a staff-facing Shopify operations agent in a Next.js app. It answers product and order questions from live Shopify Admin API data and requires human approval before it changes a product.

Read repository instructions, then inspect the framework, authentication, package manager, and installed AI SDK and @vercel/connect versions. If the intended repository is missing, ask me to open or import it, or create a Next.js App Router project if I want a new one. Verify current APIs in the AI SDK, Vercel Connect, and Shopify Admin GraphQL documentation before writing code, and pin the Admin API version you confirm. Keep the existing stack and avoid unrelated rewrites.

Get Shopify credentials only through Vercel Connect. Never store, log, or return an Admin API token. Request a token on the server for each call with only the scopes that tool needs, read the store domain from configuration, and if Shopify returns 401, clear the cached token and retry once. Route model calls through AI Gateway with the model ID read from configuration. If the connector, OIDC token, or store domain is unavailable, keep Shopify calls behind a local fake and document the setup commands instead of inventing values.

Add three tools with validated inputs: product search, order lookup by order number, and a product update limited to named fields such as title and tags. Return only the fields the model needs, and quote prices with their currency. Cap the agent loop at a small step limit. Treat product descriptions, order notes, and model output as data; they must never choose which tool runs or what it writes.

The Connect token acts with the Shopify app’s authority, not the staff member’s, so enforce access in your route. Require server-side staff sign-in and permission for the configured store. Gate the update tool behind explicit approval using the SDK’s approval support and a server-only signing secret. Show the product, its current values, and the exact proposed values with Approve and Deny controls. Bind each approval to the signed-in user and the validated arguments. Reject altered, expired, or replayed approvals, and make denial perform no write. Surface Shopify userErrors as visible failures.

Test with the local fake: read questions cause no writes; an edit shows approval first; approval applies the reviewed change once; denial, changed arguments, another user, and a replayed approval change nothing; a 401 triggers one token refresh; Shopify errors appear clearly.

Proceed with reversible local changes. Ask before connecting a real store, changing live products, or deploying. Report what changed, checks and results, blocked checks, required connector and environment setup, local run steps, and any remaining authorization or replay limitations.
```

## Related resources

- [Build a Shopify agent with AI SDK and Vercel Connect](/kb/guide/shopify-agent-ai-sdk-vercel-connect): Build a Shopify agent with AI SDK and Vercel Connect to search products, check orders, and request approval before changing your catalog.

- [Vercel Connect](https://vercel.com/docs/connect): Give agents and services short-lived, scoped access to third-party APIs without storing provider credentials.

## Try other prompts

- [Add human approval before your agent takes action](/kb/prompts/add-human-approval-to-agent-actions): Add a review step to an existing AI SDK tool, with explicit approval, server authorization, and protection against repeated actions.

- [Add a tool to an existing agent](/kb/prompts/add-agent-tool): Extend your agent with one focused tool, including validated inputs, server-side permissions, and tests for service failures.

## Reference Architecture

Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.

- [Agent stack](/kb/architecture/agents): Build and operate agents with models, tools, and durable workflows.
- [Web applications](/kb/architecture/web): Choose rendering, data, authentication, and caching approaches.
- [Backends](/kb/architecture/backends): Choose a runtime, connect services, and run background work.

[Browse all stacks](/kb/architecture)

## Build with prompts

Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.

[Browse the prompt library](/kb/prompts) · [Read the Markdown index](/kb/prompts.md)
