DEV Community

RAXXO Studios
RAXXO Studios

Posted on • Originally published at raxxo.shop

How to Automate Shopify with Claude Code and the Admin API

  • Use Claude Code with Shopify Admin API to automate repetitive tasks like product updates and order tracking instantly.

  • Create custom app in Shopify Settings, configure Admin API scopes, generate access token, store securely in .env file.

  • Automate bulk product updates by fetching products via API and updating descriptions programmatically instead of manually editing each.

  • Set up order automation for daily summaries pulling revenue data, popular products, and flagged orders from past 24 hours.

  • Use webhooks to trigger automatic workflows like subscription plan upgrades when customers purchase specific products through Shopify.

If you're running a Shopify store and writing the same admin tasks over and over, you're wasting hours every week. I've been using Claude Code to talk directly to the Shopify Admin API, and it's changed how I manage everything from product updates to order tracking.

Here's how to set it up and what's actually worth automating.

Why Automate Shopify in the First Place?

Running a store means repetitive tasks. Updating product descriptions across 50 items. Checking inventory levels. Pulling order data for accounting. Syncing prices. Each task takes five minutes, but when you do twenty of them a week, that's your entire evening gone.

The Shopify Admin API gives you programmatic access to everything in your store. Products, orders, customers, collections, themes, metafields. If you can do it in the Shopify dashboard, you can script it through the API.

Claude Code makes this practical because you can describe what you want in plain language, and it writes the API calls for you. No need to memorize endpoint paths or JSON schemas.

Setting Up API Access

First, you need a custom app in your Shopify admin. Go to Settings, then Apps and sales channels, then Develop apps. Create a new app, configure the Admin API scopes you need (start with read/write access to products and orders), and install it. You'll get an access token.

Store that token securely. I keep mine in a .env file file that's gitignored. Never commit API tokens to your repo.

SHOP_TOKEN=your_token_here
SHOPIFY_STORE=your-store.myshopify.com
Enter fullscreen mode Exit fullscreen mode

Your First Automation: Bulk Product Updates

Say you need to update the description on every product in a collection. Manually, that's clicking into each product, editing, saving. With the API:

// Fetch all products
const response = await fetch(
  `https://${store}/admin/api/2026-01/products.json?limit=250`,
  { headers: { 'X-Shopify-Access-Token': token } }
);
const { products } = await response.json();

// Update each one
for (const product of products) {
  await fetch(
    `https://${store}/admin/api/2026-01/products/${product.id}.json`,
    {
      method: 'PUT',
      headers: {
        'X-Shopify-Access-Token': token,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        product: { id: product.id, body_html: generateNewDescription(product) }
      })
    }
  );
}
Enter fullscreen mode Exit fullscreen mode

With Claude Code, you don't even need to write this yourself. Just tell it: "Update all products in my Shopify store to add a size chart at the bottom of each description." It generates the script, you review it, run it.

Order Automation That Actually Saves Time

The real power is in order workflows. Here's what I automate:

Daily order summary: A script that pulls all orders from the last 24 hours, formats them into a clean summary with total revenue, most popular products, and any flagged orders.

Subscription management: For RAXXO Studio's SaaS plans sold through Shopify, webhooks trigger plan upgrades automatically. When someone buys the Flame plan (EUR 9/month), the webhook hits the API, finds the user by email, and upgrades their account. No manual intervention.

Inventory alerts: For print-on-demand, inventory isn't the issue, but for anyone selling physical goods, a simple script that checks stock levels and sends a Slack message when anything drops below threshold is invaluable.

Using Claude Code as Your API Layer

Here's the workflow I actually use. I open Claude Code in my project directory. I describe what I need: "List all products tagged 'sale' and reduce their price by 15%." Claude Code writes the script, I review the logic, then run it.

The key insight is that Claude Code can read your existing codebase. If you already have a Shopify utility file with your auth headers set up, it'll use that. It understands your project structure and builds on what's there.

For more complex automations, I have it create proper Node.js scripts in a scripts/ directory that I can rerun anytime. Things like syncing product descriptions from a spreadsheet, generating SEO-friendly handles, batch-creating metafields, and exporting order data to CSV for German tax reporting.

Webhook Automation: The Real Game Changer

Webhooks are where automation gets powerful. Instead of polling the API, Shopify pushes events to your server. Order created, payment confirmed, subscription cancelled.

At RAXXO Studios, our webhook handler manages the entire subscription lifecycle. It verifies the HMAC signature, identifies the plan from the order, finds or creates the user, and updates their access level. The whole thing runs in under 200ms.

Common Pitfalls

Rate limits: Shopify's API has a leaky bucket rate limit. You get 40 requests per app per store, replenishing at 2 per second. For bulk operations, add a small delay between requests.

API versioning: Always specify the API version in your URLs. Shopify deprecates old versions, and your scripts will break if you're using an outdated one.

Pagination: Product and order lists are paginated. The API returns a Link header with the next page URL. Don't assume all your data comes in one response.

Idempotency: Make your scripts safe to run twice. Check if a change has already been applied before applying it.

What's Worth Automating?

My rule of thumb: if I do it more than twice a week and it takes more than two minutes, it gets a script. If it's a one-time task, Claude Code generates a throwaway script and I move on.

Start with one automation. Get it working. Then build from there. You'll be surprised how quickly your store runs itself.

At RAXXO Studios, I use Claude Code and the Shopify Admin API to manage the merch store and SaaS subscription system. The AI Social Media Copywriter is one of the products built on this stack.

Want the complete blueprint?

We're packaging our full production systems, prompt libraries, and automation configs into premium guides. Stay tuned at raxxo.shop

This article contains affiliate links. If you sign up through them, I earn a small commission at no extra cost to you.

This article contains affiliate links. If you sign up through them, I may earn a small commission at no extra cost to you. (Ad)

Top comments (0)