Shopify
Build landing pages and storefront pages on Ploy while Shopify runs your products, cart and checkout.
Ploy hosts the pages. Shopify keeps your products, inventory, payments, shipping and orders. You can connect the two in either of two ways: link your Ploy pages to your Shopify store, or put a Shopify cart right on a Ploy page.
Choose an approach
| Approach | Best for | How buyers check out |
|---|---|---|
| Keep your Shopify store and add Ploy pages | You already sell on Shopify and want campaign, launch or content pages that rank in search and AI answers | Your Ploy pages link to products in your Shopify store |
| Shopify cart on a Ploy page | A product or campaign page you want to design freely, such as a Black Friday drop | Buyers add to a cart on your page, then pay in Shopify checkout |
See an example: a Ploy page with a Shopify cart, product sizes and Shopify checkout at unbranded-tees-store.ploy.build/bfcm.
You can try a Shopify cart on a Ploy page without connecting your store first. Connect it only when Ploy's Agent should manage products, stock or your theme. See Connect your Shopify store.
Before you start
- A Shopify store with your products. Each product needs its variants, prices and SKUs. Ploy's Agent can create them for you (see Step 1).
- Shipping and taxes set up in Shopify. Set them in your Shopify admin. Shopify checkout uses them for every order, whichever approach you choose. See Step 2: Set up shipping.
- Your store's myshopify.com address. Find it in Shopify under Settings, then Domains. Shopify's APIs use this address.
- Your site's address. Your ploy.build address is separate from the site name. Find or change it under Publish, then the gear, then Domains. Settle it before adding the checkout redirect in Step 4, because the redirect points at that address.
- A domain plan. Decide which hostname serves Ploy and which serves Shopify before you publish. See Domains.
- Check your credits. Building uses AI credits. See Credits.
Connect your Shopify store
Do this first if you want Ploy's Agent to work in your store for you: create products, track stock, publish to sales channels or add the checkout redirect. Skip it if you'll manage products yourself in Shopify admin.
There are two parts:
| Part | Where | What you do |
|---|---|---|
| Part 1 | Shopify, outside Ploy | Create a Shopify app, approve it on your store and copy its keys |
| Part 2 | Ploy | Give the keys to Ploy's Agent and publish your site |
Part 1: In Shopify
Part 1 happens on Shopify's websites, not in Ploy. You use the Shopify Dev Dashboard (dev.shopify.com), where Shopify apps are built, and your store's Shopify admin, where you approve the app. Sign in with the Shopify account that owns your store.
- In the Shopify Dev Dashboard, create an app. It must be in the same Shopify organization as your store. See Create apps using the Dev Dashboard. If you prefer the command line, you can create it with Shopify CLI instead.
- In the Shopify Dev Dashboard, open the app's Versions page, add the access from the table below to a new version, then select Release. Add everything you expect to use now. Adding access later means releasing a new version and approving it again.
- In the Shopify Dev Dashboard, select Install app. In the tab that opens, choose your store, review the access and select Install.
- In the Shopify Dev Dashboard, open the app's Settings and copy its Client ID and Client secret. You'll enter them in Ploy in Part 2.
| To let Ploy's Agent | Add this access |
|---|---|
| Create and edit products | read_products, write_products |
| Track stock | read_inventory, write_inventory, read_locations |
| Publish products to sales channels | read_publications, write_publications |
| Add the checkout redirect in Step 4 | read_themes, write_themes |
| Replace product photos | write_files |
After you connect in Part 2, Ploy's Agent tells you which access the app has.
Part 2: In Ploy
- In Ploy, open a chat on your site and send this prompt. Replace
your-store.myshopify.comwith your store's address.Connect our Shopify store your-store.myshopify.com to this site. I created a Shopify app in the Dev Dashboard. Ask me for its Client ID and Client secret in secure forms for both Preview and Production, then tell me which access the app has. - In Ploy, Ploy's Agent shows secure forms. Paste the Client ID and Client secret from Part 1 into the forms, not into a chat message. Each form saves to one environment, so paste the keys for both Preview and Production. See Environment Variables.
- In Ploy, publish your site. Secrets work on your published Preview and Production sites, not in the editor preview, so test on the published URL.
If Ploy's Agent reports missing access, go back to the Shopify Dev Dashboard, add it on a new version, release it and approve it on your store (see Manage access scopes). The Client ID and secret stay the same, so you don't need to repeat Part 2.
Approach 1: Keep your Shopify store and add Ploy pages
Your store stays as it is. Ploy builds the pages around it, on your Ploy site's design, and links buyers to your products.
- In a chat, describe the page and where it sends buyers:
"Build a landing page for our spring collection. Link each product to its page in our Shopify store at example.com."
- Review the page on desktop and mobile, and ask Ploy's Agent for any changes.
- Choose a domain layout (below), then publish. Ploy's Agent publishes only with your OK.
Domains
Pick one layout:
- Both on your main domain. Ploy serves the pages you choose on
example.comand passes everything else to a Shopify alias domain such aswww2.example.com. Buyers browse products and the cart without leaving your domain. - Shopify on your main domain, Ploy on a subdomain. Keep your store where it is and connect a subdomain such as
go.example.comto your Ploy site. See Custom Domains.
For the first, follow Use your Shopify domain with Ploy. Don't proxy paths to your myshopify.com address. Shopify redirects it to your primary domain (see Change your primary domain), so the requests loop.
Approach 2: Add a Shopify cart to a Ploy page
Ploy's Agent builds the cart into your page with Shopify's Storefront API. Products and the cart live in Shopify, and the page follows your design. When a buyer selects Checkout, Shopify's checkout opens to take payment.
Step 1: Set up products
Create your products, sizes or other options, prices and SKUs in Shopify admin. Or, once you've connected your store, ask Ploy's Agent to do it:
"Create a tee in our Shopify store in black and white, sizes S to XL, $30 each, with SKUs."
Ploy's Agent creates the product, its variants and SKUs and can publish it to your sales channels. Say whether to track inventory and how much stock each variant starts with. Our example store had tracking off because it had no stock to count.
Step 2: Set up shipping in Shopify
Shipping takes the most setup. We recommend doing it by hand in your Shopify admin. When we built our example store, shipping changes made through the API reported success, but checkout kept charging the old rates until they were changed in Shopify admin. Work through this list:
- Location. Go to Settings, then Locations. Make sure a location is active, has a valid address, and has Inventory at this location is available to fulfill online orders turned on.
- Products. Set each product as a Physical product with a shipping weight in the right unit. Give it stock at a location that fulfills orders, unless Continue selling when out of stock is on.
- Markets. The buyer's country must be in an active market. Buyers in inactive markets can't place orders, even when a shipping zone covers their country.
- Zones and rates. Go to Settings, then Shipping and delivery, and open your shipping profile. Every product starts in the general profile. Add a zone with the countries you ship to, then select Add shipping option and set a rate. A flat rate is the simplest. Enter 0 for free shipping. See Setting up shipping zones and rates.
- Test with a new checkout. Rates appear only after the buyer enters an address. An abandoned checkout can keep the rates it started with, so start a new one after each change. Test an address in each country you sell to.
If checkout says "Shipping not available. Your order cannot be shipped to the selected address", one of these is missing. See Troubleshooting and testing shipping rates.
Step 3: Build the page
First make your online store public. In Shopify admin, go to Online Store and change access from Private to Public (see Restrict access to your online store). New stores start private, and while a store is private the cart fails with "Online Store channel is locked."
Tell Ploy's Agent which product to sell and how the cart should work:
"Build a Black Friday page for our tee. Load the product with handle 'shirt' from your-store.myshopify.com with the Storefront API, add a cart drawer, and send buyers to Shopify checkout."
Products, collections, search and the cart work without an access token, so the page can call Shopify directly. Customer accounts, metafields, metaobjects, product tags and store menus need a Storefront access token, for example from the Headless channel in Shopify admin. See the Storefront API reference.
Step 4: Bring buyers back from checkout (optional)
Shopify links the checkout logo to your Shopify storefront, not your Ploy page, and you can't change that link in checkout. Instead, Ploy's Agent can add a redirect to your Shopify theme that sends storefront pages to your Ploy page.
A Shopify store can send buyers back to only one Ploy site. If another Ploy site already uses this store, the redirect points there. Adding it for a new site moves it from the old one.
This is for a standalone cart page. Skip it if your Shopify store also runs on your main domain behind Ploy (see Use your Shopify domain with Ploy), because it would send buyers away from the store pages you keep.
- Give your Shopify app
read_themesandwrite_themes, release a new version and approve it in your store. - Ploy's Agent backs up your theme's
layout/theme.liquidfile, then adds the redirect. Product pages go to your Ploy page, and the/cartpage goes to your Ploy homepage. - Cart handoff links under
/cart/, checkout, account and policy pages are left alone, so buying keeps working. Test each of them after the change. To undo, restore the backup.
Step 5: Test a purchase
Test in a real browser. Shopify can rate-limit scripted page checks.
- Choose each option, add to cart, change quantities and remove a line.
- Check the subtotal against your Shopify prices.
- Go to checkout and confirm the shipping rates and taxes are right for each country you sell to.
- Select the checkout logo and check where it takes you.
- Reload the page and check that the cart is still there.
- Before launch, place one real test order and refund it.
Step 6: Publish
Ploy's Agent publishes only with your OK. Use a domain layout from Domains, and go through the Launch Checklist before you share the page.
How the cart works
The page loads your products and keeps the buyer's cart with Shopify's Storefront API. The Checkout button opens Shopify's hosted checkout, where shipping, taxes and payment are worked out. See Shopify's guide Create and update a cart with the Storefront API.
What stays in Shopify and what Ploy runs
| Part | Where it lives |
|---|---|
| Products, variants, prices, SKUs and inventory | Shopify |
| Cart | Shopify, shown on your Ploy page through the Storefront API |
| Checkout, payments, shipping rates and taxes | Shopify |
| Orders, customers and fulfillment | Shopify |
| Page design, copy, images and SEO metadata | Ploy |
| Forms on the page, such as a waitlist | Ploy. See Form Submissions. |
| Hosting and domains | Ploy for your pages, Shopify for your store's hostname |
Limits
- Ploy pages live on Ploy. They aren't added to your Shopify theme. The theme changes only if you add the optional checkout redirect.
- Checkout is Shopify's. Change checkout, shipping and taxes in Shopify, not in Ploy.
- Set shipping by hand. Change shipping rates in Shopify admin and confirm them in a real checkout.
- Some data needs a token. Customer accounts, metafields, metaobjects, product tags and store menus need a Storefront access token.
- Keep cart IDs private. Shopify's cart ID includes a secret key. The cart keeps it in the buyer's browser. Don't put cart IDs in links or on public pages.
FAQ
Can I build new pages with my existing domain?
Yes, in two ways. Keep Ploy pages and store pages on your main domain, with Ploy in front and Shopify behind it on an alias domain such as www2.example.com. Your store URLs stay the same. Or leave your store alone and put Ploy pages on a subdomain such as go.example.com. See Use your Shopify domain with Ploy.
Does Ploy integrate with Shopify?
Yes, in two ways. You can keep your Shopify store and build landing pages and content pages on Ploy that send buyers to it. Or Ploy's Agent can add a Shopify cart to a Ploy page with Shopify's Storefront API, so buyers shop on your page and pay in Shopify checkout.
Can Ploy create products and variants in my store?
Yes, once you connect a Shopify app with product access. Ploy's Agent creates products, options, variants, prices and SKUs through Shopify's Admin API. Tell it whether to track inventory and how much stock each variant starts with.
Can I keep my Shopify store and use Ploy only for landing pages?
Yes. Your store, products, checkout and orders stay in Shopify. Ploy builds and hosts the pages you add, such as campaign, product launch, wholesale or content pages. Keep both on your main domain with Ploy in front and Shopify behind it on an alias domain, or put the Ploy pages on a subdomain such as go.example.com.
Can I use Shopify with my own website?
Yes. A Ploy site can sell Shopify products with a cart built on the Storefront API. The page shows your products and cart, and the Checkout button opens Shopify's hosted checkout, where shipping, taxes and payment are handled.
Is this headless Shopify?
Yes. Headless means the storefront is built outside your Shopify theme and talks to Shopify through its APIs. Ploy builds and hosts the storefront page. Shopify keeps products, the cart, checkout and orders.
What is the Shopify Storefront API?
It is Shopify's GraphQL API for building custom storefronts. A page can read products and collections, search, and create and update a cart, then send the buyer to the cart's checkout URL.
Do I need a Storefront API access token?
Not for products, collections, search or the cart. Shopify allows those without a token. Customer accounts, metafields, metaobjects, product tags and store menus need a token, which you can get from the Headless channel in Shopify admin. Creating or editing products is different: that uses the Admin API and needs app credentials.
Why does the cart say "Online Store channel is locked"?
Your online store is in private mode, behind a password. While it is, the Storefront API refuses product and cart requests. In Shopify admin, go to Online Store and change access from Private to Public, then try again.
How is this different from the Shopify Buy Button?
The Buy Button is a Shopify sales channel that gives you embed code for a product or collection. A Storefront API cart is part of the page itself, so it follows your site's design and you choose the layout. Both send buyers to Shopify checkout.
Can I put my Shopify store on a subdomain?
If your store already runs on your main domain, keep it there. Moving it to a subdomain such as shop.example.com changes every product and collection URL, which can cost you search traffic. To add Ploy pages to your main domain without moving the store, see Use your Shopify domain with Ploy.
Does Ploy publish pages into my Shopify theme?
No. Ploy hosts the pages on your Ploy site and your domain. Shopify keeps hosting your store. The two connect through links, a Storefront API cart or both. The only theme change Ploy makes is the optional redirect that brings buyers back from checkout.
Who handles shipping and taxes?
Shopify. Set shipping rates and taxes in your Shopify admin before you launch. Shopify checkout calculates them for each order.
I changed shipping rates. Why does checkout still show the old ones?
Check the rates in Shopify admin under Settings, then Shipping and delivery, and test with a new checkout. When we built our example store, shipping changes made through the API reported success but checkout kept the old rates. Setting the rates by hand in Shopify admin fixed it.
Can the checkout logo bring buyers back to my Ploy page?
Shopify links the checkout logo to your Shopify storefront. Ploy's Agent can add a redirect to your Shopify theme that sends storefront pages to your Ploy page, while cart handoff, checkout and account pages keep working. It needs theme access on your Shopify app.
Why does Shopify checkout say shipping is not available?
Checkout shows shipping rates only when the order matches your shipping setup. Check that each product is a physical product with a weight, that it has stock at a location that fulfills online orders, that the buyer's country is in an active market, and that a shipping zone covering that country has at least one rate. Then test with a new checkout, since an abandoned checkout keeps its old rates.