> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vis42.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify

> Connect your Shopify store so VIS42 agents can read orders, products, and customers directly from conversations.

Connect Shopify to let VIS42 agents work with your store data — orders, products, customers, and inventory. Agents can reconcile sales against your accounting, find orders by customer, and summarize revenue, all without leaving the conversation.

Shopify connects through a **custom app** you create in your store's admin. No OAuth redirect, no Shopify App Store listing, no review. You copy the Admin API access token once and paste it into VIS42 along with your shop domain.

## What your agents can do

Once connected, VIS42 agents have four Shopify capabilities:

* **List orders**, filtered by status and date range. Returns order name (like `#1042`), totals, customer email, and fulfillment status.
* **Get a single order** with full detail: line items (title, SKU, quantity, price), customer, totals, and shipping address.
* **List products** with all variants (SKU, price, inventory quantity).
* **List or search customers** by email, name, or phone. Returns orders count and total spent per customer.

Example prompts:

* Ask **Themis** *"what was our Shopify revenue last week?"* — it filters orders by date and sums totals.
* Ask **Pluto** *"cross-check our Shopify orders from April against receivables"* — it fetches orders and reconciles.
* Ask **Mercury** *"draft a follow-up for order #1042"* — it pulls the order details and customer contact.

All four capabilities are **read-only** in this release. Agents cannot edit products, fulfill orders, or mutate your store data.

## Create a custom app in Shopify

<Steps>
  <Step title="Open your Shopify admin">
    Go to **Settings** → **Apps and sales channels** → **Develop apps**. If custom app development is disabled, click **Allow custom app development** (store owner only).
  </Step>

  <Step title="Create the app">
    Click **Create an app**. Name it something recognizable, for example **VIS42**.
  </Step>

  <Step title="Configure Admin API access">
    On the app's **Overview** page, click **Configure Admin API scopes**. Enable these scopes:

    * `read_orders`
    * `read_products`
    * `read_customers`

    Save.

    <Warning>
      Without `read_orders` your agents can't see any orders. Without `read_products` or `read_customers` the corresponding tools return "not authorized" errors. You can add more scopes later if we expand the integration.
    </Warning>
  </Step>

  <Step title="Install the app">
    Click **Install app** in the top right. Confirm on the dialog. Shopify installs the app into your own store.
  </Step>

  <Step title="Reveal and copy the token">
    On the app's **API credentials** tab, click **Reveal token once** under **Admin API access token**. It starts with `shpat_` and contains 32 hex characters. **Copy it immediately** — Shopify only shows it once.

    Also note your **shop domain** (visible in the Shopify admin URL), which looks like `acme.myshopify.com`.
  </Step>
</Steps>

## Connect in VIS42

<Steps>
  <Step title="Open agent settings">
    Open any agent (Mercury, Themis, or Pluto) and scroll to the **Connected Services** section.
  </Step>

  <Step title="Click Connect on the Shopify card">
    Two input fields expand below the card.
  </Step>

  <Step title="Paste your shop domain and token">
    * **Shop domain**: the full `acme.myshopify.com` value (not the custom domain if you have one)
    * **Admin API access token**: the `shpat_…` value you copied

    Click **Save**. VIS42 calls `/admin/api/2025-01/shop.json` to validate both credentials together before storing them — if they don't match, you'll see an inline error.
  </Step>

  <Step title="Done">
    The card flips to **Enabled** and shows the email on your Shopify store. Agents can now call the 4 Shopify tools.
  </Step>
</Steps>

## Access scope

<Warning>
  VIS42 can only access what the token's scopes allow. Adding new capabilities in the future may require enabling additional scopes and reconnecting.
</Warning>

To change what VIS42 can read:

* **Add or remove scopes**: in your Shopify admin → Apps → your custom app → **Configure Admin API scopes** → adjust → save. You do **not** need to reconnect in VIS42 — the updated scopes apply immediately.
* **Disconnect entirely**: either **uninstall** the app in Shopify (immediately invalidates the token), or click **Disconnect** on the Shopify card in VIS42's agent settings. Uninstalling in Shopify is the strongest option.

## Privacy and scope

* The connection is **per user, per business** — each team member creates and pastes their own custom app token.
* VIS42 stores the token and shop domain encrypted at rest.
* VIS42 can only access the store the token is installed on — nothing else.
* Tokens don't expire automatically. They stay valid until you uninstall the custom app in Shopify or disconnect in VIS42.

## Troubleshooting

<AccordionGroup>
  <Accordion title="'Shopify credentials are invalid'">
    Either the token was revoked or mistyped, or the shop domain doesn't match the token's store. Open the custom app in Shopify, reveal the token again (or create a new one), and reconnect.
  </Accordion>

  <Accordion title="'Shopify store … not found'">
    The shop domain is wrong. It must be the `*.myshopify.com` domain, not a custom domain like `www.acme.com`. Find the correct one in your Shopify admin URL.
  </Accordion>

  <Accordion title="Agent says it can't see any orders (or products, or customers)">
    The custom app is missing the matching `read_orders` / `read_products` / `read_customers` scope. Open the app in Shopify → Configure Admin API scopes → enable → save. No reconnection needed.
  </Accordion>

  <Accordion title="Order details are missing a field">
    VIS42 returns a curated subset of the Shopify order object (line items, customer, totals, shipping address). If you need a field we don't surface yet, contact support.
  </Accordion>

  <Accordion title="I want to revoke access from Shopify's side">
    Go to your Shopify admin → Settings → Apps and sales channels → your custom app → **Uninstall**. This invalidates the token immediately. Also click **Disconnect** in VIS42 to clean up the local record.
  </Accordion>
</AccordionGroup>
