Shopify merchants running mid-size stores spend 5 to 10 hours per week on tasks that boil down to reading data and acting on it: checking order status, updating inventory counts, tagging customers, chasing abandoned carts. OpenClaw turns those tasks into a conversation. Send a message to your agent from Telegram or WhatsApp, and it runs the Shopify API call, parses the result, and replies in plain language.
This guide covers the full setup: creating a Shopify custom app, configuring API credentials, writing a complete OpenClaw skill file with templates for orders, products, customers, and inventory. If OpenClaw is already running on your machine, the whole process takes about 25 minutes.
What This Integration Does
Once connected, OpenClaw acts as a conversational layer on top of your Shopify Admin API. Instead of navigating Shopify’s dashboard, you message your agent and it handles the API calls.
Here is what the skill enables:
- Look up orders by number, customer name, or fulfillment status
- Search products and check inventory across locations
- Create and update customers with tags and notes
- Check abandoned checkouts and trigger recovery messages
- Monitor stock levels and get alerts when products run low
- Fulfill orders and update tracking information
The agent uses Shopify’s REST Admin API through a custom app access token. No middleware, no paid connectors, no third-party data routing. Your queries go directly from your machine to Shopify’s servers.
Before You Start
You need three things before connecting Shopify to OpenClaw:
-
OpenClaw installed and running on your machine or a VPS. If you have not set it up yet, follow our OpenClaw setup guide first. For 24/7 availability, consider running OpenClaw on Hostinger.
-
A Shopify store with the Owner or Staff permissions needed to create custom apps. This works on all Shopify plans, including the Basic plan. You do not need Shopify Plus.
-
A text editor for writing and editing your skill file. VS Code, Cursor, or any Markdown editor works.
Step 1: Create a Shopify Custom App
Shopify custom apps give you an Admin API access token scoped to the exact permissions you choose. This is the recommended method for connecting external tools because you control what the token can read and write.
Generate the Access Token
- Log into your Shopify admin at
your-store.myshopify.com/admin - Go to Settings (bottom left) then Apps and sales channels
- Click Develop apps at the top of the page
- If prompted, click Allow custom app development
- Click Create an app
- Name it
OpenClaw Integrationand set yourself as the developer - Click Configure Admin API scopes and enable the following:
| Scope | Permission | What It Enables |
|---|---|---|
read_orders | Read | Look up orders by number or status |
write_orders | Write | Update order tags and notes |
read_products | Read | Search products and check inventory |
write_products | Write | Update product details and stock counts |
read_customers | Read | Look up customer records |
write_customers | Write | Create/update customers and add tags |
read_inventory | Read | Check stock levels across locations |
write_inventory | Write | Adjust inventory quantities |
read_checkouts | Read | Access abandoned checkout data |
read_fulfillments | Read | Check shipping and tracking status |
write_fulfillments | Write | Create fulfillments and add tracking |
Start with read scopes only if you prefer to test before enabling writes. You can add write permissions later by editing the app.
- Click Save, then go to the API credentials tab
- Click Install app and confirm
- Copy the Admin API access token immediately. Shopify shows it once. If you lose it, you need to uninstall and reinstall the app to generate a new one.
Store the Token Safely
Do not paste the token into your skill file. Store it in a .env file:
# ~/.env or ~/openclaw/.env
SHOPIFY_ACCESS_TOKEN=shpat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SHOPIFY_STORE_URL=your-store.myshopify.com
OpenClaw reads environment variables at runtime. This keeps the secret out of any file your agent might log or share.
Step 2: Write the OpenClaw Shopify Skill
OpenClaw skills are Markdown files that teach your agent when and how to use an external API. The skill file lives in your workspace’s skills/ directory and contains templated API calls the agent adapts to your requests.
Create the Skill Directory
mkdir -p ~/.openclaw/workspace/skills/shopify
Write the SKILL.md File
Create ~/.openclaw/workspace/skills/shopify/SKILL.md with this content:
---
name: shopify
description: Manage Shopify store data. Look up orders, search products, check inventory, manage customers, and handle abandoned checkouts via the Shopify Admin REST API.
tools:
- shell
---
# Shopify Store Skill
## Authentication
Use environment variables for all API requests:
- Store URL: $SHOPIFY_STORE_URL
- Access token: $SHOPIFY_ACCESS_TOKEN
All requests go to: https://$SHOPIFY_STORE_URL/admin/api/2024-01
Header for every request:
X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN
## Available Operations
### Look Up an Order by Number
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
"https://$SHOPIFY_STORE_URL/admin/api/2024-01/orders.json?name=%23ORDER_NUMBER&status=any" \
| jq '.orders[0] | {id, name, email: .email, total: .total_price, status: .financial_status, fulfillment: .fulfillment_status, created: .created_at}'
### List Recent Orders
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
"https://$SHOPIFY_STORE_URL/admin/api/2024-01/orders.json?status=any&limit=10" \
| jq '.orders[] | {name, email: .email, total: .total_price, status: .fulfillment_status, created: .created_at}'
### Search Products
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
"https://$SHOPIFY_STORE_URL/admin/api/2024-01/products.json?title=SEARCH_TERM&limit=10" \
| jq '.products[] | {id, title, status, variants: [.variants[] | {sku: .sku, price: .price, inventory: .inventory_quantity}]}'
### Check Inventory for a Product
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
"https://$SHOPIFY_STORE_URL/admin/api/2024-01/products/PRODUCT_ID.json" \
| jq '.product | {title, variants: [.variants[] | {sku: .sku, inventory: .inventory_quantity, price: .price}]}'
### Create a New Customer
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-X POST "https://$SHOPIFY_STORE_URL/admin/api/2024-01/customers.json" \
-d '{
"customer": {
"first_name": "FIRST_NAME",
"last_name": "LAST_NAME",
"email": "EMAIL",
"tags": "TAG1, TAG2"
}
}' | jq '.customer | {id, email, first_name, last_name, tags}'
### Search Customers by Email
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
"https://$SHOPIFY_STORE_URL/admin/api/2024-01/customers/search.json?query=email:CUSTOMER_EMAIL" \
| jq '.customers[0] | {id, email, first_name, last_name, orders_count, total_spent, tags}'
### Get Abandoned Checkouts
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
"https://$SHOPIFY_STORE_URL/admin/api/2024-01/checkouts.json?limit=10" \
| jq '.checkouts[] | {id, email: .email, total: .total_price, created: .created_at, abandoned_url: .abandoned_checkout_url, cart_items: [.line_items[] | .title]}'
### Update Order Tags
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-X PUT "https://$SHOPIFY_STORE_URL/admin/api/2024-01/orders/ORDER_ID.json" \
-d '{
"order": {
"id": ORDER_ID,
"tags": "NEW_TAGS"
}
}' | jq '.order.tags'
### Adjust Inventory Level
First get the inventory_item_id from the product variant, then adjust:
curl -s -H "X-Shopify-Access-Token: $SHOPIFY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-X POST "https://$SHOPIFY_STORE_URL/admin/api/2024-01/inventory_levels/adjust.json" \
-d '{
"location_id": LOCATION_ID,
"inventory_item_id": INVENTORY_ITEM_ID,
"available_adjustment": ADJUSTMENT_NUMBER
}' | jq '.'
## Rules
- Always confirm before creating or updating records. Show the user what will change and ask for approval.
- When searching for orders, try order number first. Fall back to customer email if no number is given.
- For inventory adjustments, show current stock level and proposed change before executing.
- Respect rate limits: Shopify allows 40 requests per bucket with a 2/second refill rate. Pause if you hit a 429 response.
- Never log the access token in responses or memory files.
- For large result sets, use pagination: check for the Link header and follow the next page URL.
What Each Section Does
The frontmatter (name, description, tools) tells OpenClaw when to activate this skill and which system tools it needs. The shell tool lets the agent run curl commands against Shopify’s API.
The operations section provides templated API calls for each action. When you ask “What is the status of order 1042?”, the agent reads the order lookup template, substitutes the order number, executes the curl command, and returns the parsed JSON response.
The rules section sets boundaries. The confirmation requirement is the most important: you do not want your agent silently adjusting inventory or modifying orders based on a misunderstood message.
Step 3: Test the Connection
Restart OpenClaw to load the new skill:
openclaw gateway restart
Open your Telegram or WhatsApp chat with your OpenClaw agent and run these tests:
Read test:
“How many orders came in today?”
The agent should hit the orders endpoint, filter by date, and return a count.
Search test:
“Find the customer record for jane@example.com”
The agent should return the customer’s name, order count, total spent, and tags.
Product test:
“Check inventory for the Classic T-Shirt”
The agent should search by product title and return variant-level stock quantities.
Write test (confirm before executing):
“Add the tag ‘VIP’ to customer jane@example.com”
The agent should show you the proposed change and wait for your confirmation before making the API call.
If a test fails, check these common issues:
| Symptom | Likely Cause | Fix |
|---|---|---|
| 401 Unauthorized | Token is wrong or expired | Regenerate in Shopify Admin > Apps > Your App |
| 403 Forbidden | Missing API scope | Edit the app and add the required scope |
| Empty results | Wrong API version or query syntax | Verify the API version in your SKILL.md matches your store |
| 429 Too Many Requests | Rate limit hit | Wait 10 seconds and retry |
| Location ID errors | Fulfillment requires a location | Run a location list query first to get your location IDs |
What to Automate First
After the connection works, start with low-risk read operations and expand from there. Jumping straight to automated fulfillment tends to create problems that take hours to untangle. The phased approach prevents that.
Week 1: Read-Only Queries
Use your agent for quick store lookups during your workday:
- “Show me unfulfilled orders from the last 24 hours”
- “What is the inventory count for SKU BLUE-TEE-M?”
- “List all customers tagged ‘wholesale’”
- “Show me abandoned checkouts from this week”
This builds your habit of querying the store through chat and lets you verify the agent’s responses against Shopify’s actual dashboard.
Week 2: Add Write Operations
Once reads feel reliable, start updating records:
- “Tag order #1042 as ‘priority-ship’”
- “Create a new customer: Maria Lopez, maria@example.com, tag: influencer”
- “Add 50 units to SKU BLUE-TEE-M at the warehouse location”
The agent should always ask for confirmation before executing writes. If it does not, strengthen the Rules section in your SKILL.md.
Week 3: Add Automated Monitoring
Use OpenClaw’s heartbeat or cron system to run periodic checks without prompting. For more on scheduling, see our heartbeat configuration guide.
Add this to your heartbeat.md:
## Low Stock Alert
Check Shopify inventory for all active products.
If any variant has fewer than 10 units in stock, send me a Telegram message
listing the product name, SKU, current quantity, and which location is low.
Or set up an abandoned checkout recovery cron:
## Abandoned Checkout Recovery (runs every 3 hours)
Pull abandoned checkouts from the last 3 hours where the customer has an email.
For each checkout, compose a brief, friendly message noting the items left in their cart.
Send me a summary of checkouts found and messages drafted for review.
This progression (read, then write, then automate) gives you confidence at each stage before increasing the agent’s autonomy over your store data.
Security Considerations
Your Shopify access token has direct read/write access to customer data, orders, and inventory. Treat it with the same care as a database credential.
Least-privilege scoping. Only enable the API scopes you need right now. If you are not using fulfillment automation yet, leave write_fulfillments off. You can add it later through the app settings without regenerating the token.
Token storage. Keep the token in a .env file, not in your workspace files. Never put it in soul.md, agents.md, or any file that OpenClaw loads into its context window. Environment variables are read at runtime and do not appear in conversation logs.
Confirmation rules. The skill’s Rules section should require the agent to confirm every write operation before executing it. This is your primary defense against misunderstood instructions or prompt injection from customer-submitted data (like order notes or product reviews that contain instructions).
Rate limit awareness. Shopify’s REST API allows 40 requests per bucket with a 2-requests-per-second leak rate. Normal conversational use stays well under this limit. Automated monitoring (checking hundreds of products every hour) can hit it. Add a rate limit note to your skill’s Rules section: “If you receive a 429 response, wait 10 seconds and retry once.”
Audit trail. Shopify logs all API activity. Check Settings > Activity Log periodically to verify your agent is making the expected calls and nothing else.
For a broader discussion of OpenClaw security practices, see Step 9 in our OpenClaw setup guide.
Frequently Asked Questions
Do I need a paid Shopify plan to connect OpenClaw?
OpenClaw works with all Shopify plans, including the Basic plan at $39/month. Custom app development and the Admin REST API are available on every tier. Shopify Plus adds higher rate limits and additional APIs (like the Multipass login API), but none of those are required for this integration.
How long does this setup take?
About 25 minutes if OpenClaw is already installed. Creating the custom app takes 5 minutes. Writing the skill file takes 10, and testing takes another 10. If you need to install OpenClaw first, add 30 to 45 minutes for the initial setup.
Can OpenClaw process refunds automatically?
Technically yes, if you add the write_orders scope and include a refund endpoint in your skill file. We do not recommend this for most stores. Refunds involve financial transactions and should have a human in the loop. A better pattern: the agent flags orders that match refund criteria and drafts the refund for your approval.
How does OpenClaw handle Shopify’s API rate limits?
Shopify uses a leaky bucket model: 40 requests fill the bucket, and it drains at 2 requests per second. Each API response includes X-Shopify-Shop-Api-Call-Limit in the headers showing your current usage. For conversational use, you will never approach the limit. If you set up aggressive automated polling, add retry logic to your skill’s Rules section.
Is it safe to give an AI agent access to my Shopify store?
It is as safe as you configure it to be. Three safeguards matter most: least-privilege scoping (only enable scopes you need), token isolation (store in .env, not workspace files), and write confirmation (the agent must ask before modifying data). OpenClaw runs on your own infrastructure, so store data does not pass through third-party servers beyond Shopify and your AI model provider.
Can OpenClaw recover abandoned checkouts?
Yes. The skill includes an abandoned checkout lookup endpoint. You can query recent abandoned carts manually or set up a cron job that checks every few hours and drafts recovery messages. The agent can pull the customer email, cart contents, and the recovery URL that Shopify generates for each abandoned checkout.
Can I use this from WhatsApp instead of Telegram?
Yes. OpenClaw supports Telegram, WhatsApp, Slack, Discord, and iMessage. The Shopify skill works identically regardless of your chat channel. For instructions on configuring different channels, see our OpenClaw setup guide. For always-on availability, deploy OpenClaw on a VPS.
Does this work with Shopify Plus?
Yes, and Shopify Plus stores get additional benefits: higher API rate limits (double the bucket size), access to the GraphQL Admin API bulk operations, and additional endpoints for gift cards, scripts, and multipass. The base skill in this guide works on all plans. Plus users can extend it with additional operations.
Key Takeaways
- Connect Shopify to OpenClaw by creating a custom app token and writing a SKILL.md file with API call templates for orders, products, customers, and inventory
- Start with read-only lookups to build confidence, then add writes, then automated monitoring
- Store your Shopify access token in a
.envfile, never inside workspace files the agent loads into context - Use heartbeat instructions or cron jobs for low-stock alerts and abandoned checkout recovery
- All Shopify plans support this integration, including the $39/month Basic plan
SFAI Labs