Connecting Shopify
Reading time: 8 minutes. Hands-on time: 10 minutes. What you'll have at the end: Your live product catalog flowing into Scarif One, with images, prices, descriptions, and inventory. Every ad and email generation is now product-aware.
This tutorial assumes you've finished 01 โ Getting started and you're logged in.
Why connect Shopify
Without it, Scarif One has no idea what you sell. Every "generate an ad" prompt has to ask you for product details every time, and the AI can't pull customer data, can't check inventory before suggesting a push, and can't write product-aware emails.
With it, the AI:
- Knows every product you sell โ name, description, price, photos, tags, inventory
- Can pick a product to feature in any ad/email automatically
- Auto-pauses ads for products that just went out of stock
- Writes lifecycle emails ("Welcome", "Win-back", "Subscription renewal") with the customer's actual purchase history
- Can upload generated ad images to your Shopify CDN so they're hosted on your domain, not ours
The integration takes ~5 minutes, costs nothing extra, and uses Shopify's built-in custom-app system โ no third-party connectors, no scopes you don't need.
Step 1 โ Open your Shopify admin
Sign in to Shopify the way you normally do:
admin.shopify.com(the unified admin), oryourstore.myshopify.com/admin(per-store admin)
You should land on the dashboard with Home highlighted in the left sidebar.
Step 2 โ Navigate to the custom apps area
- Click Settings at the very bottom-left of the Shopify admin.
- The Settings page opens. Click Apps and sales channels in the left column.
- Click Develop apps in the top-right.
First time clicking Develop apps? Shopify will show a warning: "Apps that you build with custom app development have access to your store data. Make sure you trust the developers."
Click Allow custom app development. This unlocks the Develop apps area for all custom integrations going forward โ you only do it once per store.
Step 3 โ Create the custom app
- Click Create an app (top-right).
- App name: type
Scarif One. (Customers don't see this name โ it's only for you.) - App developer: auto-fills with your email. Leave it.
- Click Create app.
You're now on the new app's page. It looks empty because you haven't configured any API access yet.
Step 4 โ Configure the Admin API scopes
- Click Configuration in the top tabs.
- Find Admin API integration and click Configure.
- Tick all six of these scopes โ and only these six. Extra scopes get rejected at install time; missing scopes break the sync silently.
| Scope | What it unlocks |
|---|---|
read_products | Pulls your product catalog โ names, descriptions, prices, tags |
read_product_listings | Better image data + variant detail |
read_customers | Customer list for lifecycle segmentation + win-back flows |
read_orders | Order history for analytics + revenue attribution |
read_inventory | Stock levels โ powers auto-pause when an item runs out |
write_files | Lets us upload generated ad images to your store CDN |
Don't grant write_products or write_orders. Scarif One never modifies your catalog or orders. If we ask for those scopes in a future version, ask why before approving.
- Click Save at the bottom.
Storefront API โ there's a separate section. Leave it alone. Scarif One doesn't use it.
Step 5 โ Install the app to generate the token
- Click Install app at the top of the page.
- Shopify shows a confirmation: "Are you sure you want to install Scarif One on your store?"
- Click Install.
Now the critical bit:
- The next page shows the Admin API access token. It's blurred out by default with a button: Reveal token once.
- Click Reveal token once.
- COPY THE TOKEN IMMEDIATELY. It starts with
shpat_and is about 38 characters long. Paste it into a notes app or password manager.
You only see this token ONCE. If you close the page or lose the token, you can't reveal it again. You'd have to uninstall the app, recreate it from scratch, and re-grant the scopes. Take 5 seconds and copy it now.
Step 6 โ Connect inside Scarif One
- Open Scarif One in another tab.
- Click ๐ Integrations in the dashboard nav.
- Find the Shopify card (top-left, green border).
- Click ๐ Connect Shopify.
- Inline tutorial modal opens. Scroll to the bottom โ you'll see two fields:
| Field | What to paste |
|---|---|
| Store domain | Your .myshopify.com domain. Example: acmecoffee.myshopify.com. |
| Admin API access token | The token starting with shpat_ from Step 5. |
- Click ๐ Test connection.
Within ~5 seconds you should see a green box:
โ Connection works Connected to Acme Coffee (GBP) First sync: Acme Coffee ยท 47 products ยท 2,341 customers
- Click โ Save + connect.
The modal closes. The Shopify card now has a green โ Connected badge.
Step 7 โ Wait 60 seconds for first sync
In the background, Scarif One is now:
- Pulling all your products via Shopify's GraphQL API
- Caching product images (URLs only โ no copies leave Shopify's CDN unless you generate ad creatives later)
- Running the AI product context curator โ for each product, Gemini distills the description into a structured creative brief (essence, key selling points, ideal customer, visual identity)
- Writing the result to
/data/tenants/{your-slug}/product-contexts.json
This takes 30 seconds for ~10 products, up to 5 minutes for 100+ products. You don't need to wait โ close the tab and come back later. The next time you open /products or /create/ad-creatives, your catalog is there.
Want to watch progress? Open
/admin/scheduler(ordocker compose logs -f scarif-oneif self-hosted). Look for log lines like[shopify] curated 12/47.
Step 8 โ Verify it worked
- Click Products in the dashboard nav (or open
/productsdirectly). - You should see your full product list with thumbnails.
- Click any product โ you'll see:
- Live data from Shopify (price, inventory, description)
- The AI-generated creative brief below it
- A "Generate ad with this product" button
If products are missing or the page is empty, see Troubleshooting below.
Troubleshooting
"401 Unauthorized" when testing
Token is wrong, expired, or you're using a public app token instead of an Admin API token.
Fix: Go back to Shopify โ Settings โ Apps and sales channels โ Develop apps โ your app โ API credentials โ click Rotate to generate a new token. Reveal it, copy it, paste it back into Scarif One. Don't forget to click Test connection again.
"403 Forbidden on /products.json"
Token works for general API but you forgot a scope (almost always read_products).
Fix: Shopify admin โ your app โ Configuration โ Admin API integration โ Configure โ tick the missing scope โ Save โ uninstall the app โ reinstall it. New token. Re-paste in Scarif One.
Yes, you have to uninstall + reinstall. Shopify doesn't let you add scopes to an installed app โ security feature.
"Use the .myshopify.com domain"
You pasted your custom domain (e.g. acmecoffee.com). The Admin API only answers on the technical .myshopify.com domain.
Fix: Find your .myshopify.com domain. In Shopify admin: Settings โ Domains. The technical one is usually first. Use that one.
"Invalid domain" error
Two common causes:
- Trailing slash in the domain field โ strip it. (
acme.myshopify.com/โacme.myshopify.com) - HTTPS prefix in the domain field โ strip it. (
https://acme.myshopify.comโacme.myshopify.com)
Test passed but my products aren't showing in Scarif One
The first-sync runs in the background and can take a few minutes. If /products is still empty after 5 minutes:
- Click ๐ in the bottom-right and file a bug. Include the message "Products empty after Shopify connect." We'll see your bug within seconds.
- Or: from
/integrations, find your Shopify card and click โป Re-test. This re-runs the test and triggers a manual re-sync.
"Cannot upload images (write_files)"
You forgot the write_files scope. This isn't a connection failure โ testing passes โ but ad image uploads to your store CDN will fail later.
Fix: Same as the 403 fix above โ add write_files in Shopify, uninstall + reinstall, paste the new token.
What changes in Scarif One after Shopify connects
The dashboard adapts automatically:
/create/ad-creativesโ product picker now lists your real products/create/emailโ campaign drafter has a "use this product" button/productsโ the full catalog with AI-generated creative briefs per product/inventoryโ stock-aware push priorities (items low on stock get marketing priority)/lifecycleโ customer segments now have real customers in them/cart-recoveryโ abandoned-cart detection starts running/analyticsโ once you publish ads, revenue attribution works
You don't need to "turn on" any of this โ it activates the moment Shopify connects.
Disconnecting
If you ever need to disconnect (rotating tokens, switching stores, paranoid):
/integrationsโ Shopify card โ Disconnect.- Confirm.
- The token is removed from your tenant profile.
Your synced data is preserved โ products, customer briefs, etc. stay on disk. You can reconnect later (same token or new) and pick up where you left off.
To wipe the synced data too: /security โ "Delete tenant data" โ tick "Shopify-derived data only". Or for self-hosted users: rm -rf data/tenants/{your-slug}/product-contexts.json.
Where to next
- Tutorial 03 โ Connect Meta (Facebook + Instagram) so you can publish ads
- Tutorial 04 โ Generate your first ad with full creative direction
- Tutorial 06 โ Draft email campaigns with your real customer segments
- Tutorial 07 โ Reviews โ UGC pipeline (needs Judge.me too)