---
title: "Build a Shopify AI agent for your merchants"
description: "Build a Shopify AI agent that reads each merchant's orders and stock and tags the orders it reviewed, with AIsa Connect holding every store's connection."
canonical: "https://aisa.one/solutions/shopify-ai-agent"
---

# Build a Shopify AI agent that works in each merchant's store

> Build a Shopify AI agent that reads each merchant's orders and stock and tags the orders it reviewed, with AIsa Connect holding every store's connection.

Merchants connect their store with an Admin API token, your agent reads their unfulfilled orders and stock, tags the orders it reviewed, and AIsa keeps every store's connection apart.

- Web page: https://aisa.one/solutions/shopify-ai-agent
- Who it suits: Agent builders and Cross-border sellers
- Data domain: AIsa Connect
- Runs on AIsa Connect: [AIsa Connect](https://aisa.one/products/connect)

## Four requests from connected store to tagged orders

Each step is one request from your server for the fictional merchant store_8812, with field names from each action's published schema.

### 1. The merchant connects their store

Collect the store's Admin API token and myshopify.com domain in your product and forward them once. AIsa checks the fields, Shopify checks the token, and the connection belongs to this merchant's externalUserId.

```
curl -X POST "https://api.aisa.one/apis/v1/connector/connect/shopify/credentials" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "store_8812",
    "apiKey": "shpat_...",
    "credentials": {
      "shopDomain": "acme.myshopify.com"
    }
  }'
```

### 2. Read the orders that need attention

shopify.list_orders takes a Shopify search query, such as unfulfilled orders, and returns each order's name, fulfillment status, total and customer.

```
curl -X POST "https://api.aisa.one/apis/v1/connector/actions/run" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionKey": "shopify.list_orders",
    "externalUserId": "store_8812",
    "input": {
      "first": 50,
      "query": "fulfillment_status:unfulfilled"
    }
  }'
```

### 3. Check stock before your agent promises a date

shopify.get_inventory_quantities returns the available quantity of one item at one location, so your agent can tell a late order from an out-of-stock one.

```
curl -X POST "https://api.aisa.one/apis/v1/connector/actions/run" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionKey": "shopify.get_inventory_quantities",
    "externalUserId": "store_8812",
    "input": {
      "inventoryItemId": "gid://shopify/InventoryItem/4410283321",
      "locationId": "gid://shopify/Location/7731205",
      "names": [
        "available"
      ]
    }
  }'
```

### 4. Tag the orders your agent reviewed

shopify.add_tags writes to the store, so ask the merchant before it runs. AIsa sends it once, and if the outcome is unknown, check the order in Shopify before you run it again.

```
curl -X POST "https://api.aisa.one/apis/v1/connector/actions/run" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionKey": "shopify.add_tags",
    "externalUserId": "store_8812",
    "input": {
      "id": "gid://shopify/Order/5829113872",
      "tags": [
        "agent-reviewed"
      ]
    }
  }'
```

## Let your coding agent build it

Paste this into Claude Code, Codex or Cursor in your product's repository, and keep your AIsa key in the server's environment.

```text
Add a Shopify agent to this app with AIsa Connect (https://aisa.one/docs/resources/aisa-connect).

Read the guide first. Call AIsa only from the server with AISA_API_KEY from the environment, and never send the key to the browser.

1. Add a settings form where a merchant enters their Shopify Admin API token and myshopify.com domain. Forward both to POST /connect/shopify/credentials with the merchant's ID as externalUserId, explain any 400 error in plain words, and do not store the token.
2. Add a job that runs shopify.list_orders with the query fulfillment_status:unfulfilled for one merchant and lists the orders.
3. Check stock for each order's items with shopify.get_inventory_quantities.
4. Let the merchant approve a list before any shopify.add_tags run. Treat outcome_unknown as unknown and check the order before a retry.

Read each action's inputSchema from GET /apps/shopify/actions before writing the calls, and show me the plan before you write code.
```

Your coding agent shows a plan before it writes code. Test with a development store before a merchant connects theirs.

## Questions about building a Shopify AI agent

### What is a Shopify AI agent?

A Shopify AI agent is software that reads and acts in a merchant's store for them, such as listing unfulfilled orders, checking stock or tagging orders. On AIsa Connect, each merchant connects their own store and your agent runs Shopify actions for that merchant only.

### Do I need to list a Shopify app?

Not for the token route. Each merchant creates an Admin API access token in their own store and enters it in your product, and AIsa runs the calls with it.

### How does a merchant connect their store?

They enter their Admin API access token, which starts with shpat_, and their store's myshopify.com domain in your product. You forward both once: a missing field returns invalid_request and a rejected token returns connect_failed.

### Which Shopify actions can my agent run?

Close to 100, across orders, products, inventory, customers, draft orders and fulfillment. Each action publishes its input schema and says whether it reads, writes or deletes.

### Can the agent change orders or products?

Yes. Actions such as shopify.add_tags and shopify.update_product write to the store, so ask the merchant before they run. AIsa never retries a run on its own.

### How much does a Shopify agent cost to run?

Each successful run costs $0.0003 on every plan, and failed runs are free. Connecting a store and managing connections cost nothing.

## Related tasks

- [Build an AI customer support agent](https://aisa.one/solutions/ai-customer-support-agent.md): Read order questions from a merchant's Gmail, look up each order in their store and draft the reply for a person to send. For Agent builders and Enterprise teams
- [Automate ecommerce reports](https://aisa.one/solutions/ecommerce-reporting.md): Pull each merchant's orders and email campaigns every week and write the report to their Notion. For Agent builders and Marketing agencies
