Connect Shopify to Lovable using the built-in Shopify shared connector in Settings → Connectors. Once connected, describe your storefront in Lovable's chat and the AI auto-generates product catalog pages, shopping cart logic, and checkout flows — all wired to your Shopify store with no manual API coding required. Setup takes about 10 minutes.
Build a Custom Shopify Storefront in Lovable Without Touching the API
Shopify is excellent at managing products, orders, and payments — but its built-in themes have real design limits. Lovable lets you build a fully custom storefront UI powered by your Shopify backend, without hiring a developer or learning the Storefront API yourself. Because Shopify is a native shared connector, Lovable's AI already understands how to call it correctly. You describe what you want in plain English and the AI generates the frontend code, sets up the API connection, and handles authentication behind the scenes.
The integration uses Shopify's Storefront API, which is designed specifically for headless storefronts. Lovable routes these calls through its secure Edge Function layer — your Shopify Storefront API token lives in Cloud → Secrets and never appears in the browser. This means customers get a fast, custom-designed shopping experience while all order management, inventory, and payments stay inside your existing Shopify admin.
This combination is particularly powerful for founders who already have a Shopify store but want a branded app experience, a custom landing page with a shop section, or a client portal that embeds purchasing. The Shopify connector handles product listings, collections, cart management, and checkout redirect — the three building blocks of any storefront — all available to Lovable's AI as soon as the connector is active.
Integration method
Shopify is one of Lovable's 17 shared connectors — connecting it through Settings → Connectors gives Lovable's AI full awareness of your store, so it can generate product pages, cart state, and checkout flows from natural language prompts.
Prerequisites
- A Lovable account with an active project (any plan — shared connectors are available on all plans)
- A Shopify store (any Shopify plan, including the free trial)
- A Shopify Storefront API access token — generated in your Shopify admin under Apps → Develop apps → Create app → Configure Storefront API scopes
- Your Shopify store domain in the format your-store.myshopify.com
- At least one published product in your Shopify store to test the integration
Step-by-step guide
Generate a Shopify Storefront API token
Generate a Shopify Storefront API token
Before connecting Shopify to Lovable, you need a Storefront API access token from your Shopify admin. This is different from the Admin API key — the Storefront API is specifically designed for custom storefronts and only exposes data that customers are allowed to see (products, collections, cart, checkout). Log in to your Shopify admin at your-store.myshopify.com/admin. In the left sidebar, scroll down and click Apps, then look for the Develop apps link near the bottom of that page (you may need to click Develop apps → Allow custom app development first if you have not done this before). Click Create an app, give it a name like Lovable Storefront, and click Create app. Once the app is created, click the Configuration tab at the top of that app page. Scroll down to find the Storefront API integration section and click Configure. Check the boxes for the Storefront API scopes your storefront needs — at minimum select unauthenticated_read_product_listings, unauthenticated_read_product_inventory, and unauthenticated_write_checkouts. Click Save. Now click the API credentials tab. Scroll down to the Storefront API section and click Install app if prompted. You will see your Storefront API access token — click Reveal token once, copy it immediately, and store it somewhere safe. This token is shown only once. You will also need your store's myshopify.com domain (for example, acme-store.myshopify.com). Keep both of these handy for the next step.
Expected result: You have a Shopify Storefront API access token (a long string starting with a letter/number mix) and your store domain in the format your-store.myshopify.com ready to paste into Lovable.
Connect Shopify in Lovable's Settings → Connectors
Connect Shopify in Lovable's Settings → Connectors
Now open your Lovable project. Click the settings gear icon in the top-right corner of the Lovable editor to open Project Settings. In the left sidebar of Settings, look for the Connectors section and click it. You will see a list of available connectors — scroll until you find Shopify (it is one of the 17 shared connectors) and click Connect or the toggle next to it. A configuration panel will open asking for your Shopify credentials. In the Store domain field, enter your myshopify.com address exactly as it appears — for example acme-store.myshopify.com (do not include https:// or any trailing slash). In the Storefront API token field, paste the access token you generated in the previous step. Click Save or Connect. Lovable will verify the credentials by making a test call to your Shopify store. If the credentials are correct, the Shopify connector will show a green connected status. If you see an error, double-check that the store domain has no extra spaces or slashes and that the token was copied completely — they can be long. Once connected, the Shopify connector is active for your entire workspace, meaning every project in your workspace can use it. Lovable's AI now has full awareness of the Shopify Storefront API — it knows the correct GraphQL query shapes, how to handle pagination for large product catalogs, how to manage cart state, and how to redirect to Shopify's hosted checkout. You do not need to explain any of this in your prompts; just describe the UI and behavior you want.
Expected result: The Shopify connector shows a green connected status in Settings → Connectors. Lovable is now aware of your Shopify store and can generate storefront code that calls it correctly.
Generate a product catalog page
Generate a product catalog page
With the Shopify connector active, return to the main Lovable chat interface. You can now describe your storefront in plain English and the AI will generate the correct React components wired to your live Shopify store. Start with the product catalog — this is the page that displays your products from Shopify. Use the lovable_prompt below as a starting point and customize the description to match your brand. Lovable will generate a products page that fetches your live inventory from Shopify using the Storefront API, renders product cards with image, title, price, and an Add to Cart button, handles loading and empty states gracefully, and includes a responsive grid layout that works on mobile and desktop. After sending the prompt, watch the preview panel on the right. Lovable will write the code, deploy it, and show a live preview. If your Shopify store has products, you should see them load in the preview within a few seconds of the build completing. If the preview shows placeholder data, ask Lovable to connect it to real Shopify data and it will adjust. You can also ask for specific layouts — for example, a two-column grid for mobile or filtering by product collection.
I have Shopify connected as a shared connector. Build me a product catalog page that fetches all published products from my Shopify store using the Storefront API. Show each product in a card with its main image, title, price, and an Add to Cart button. Use a responsive grid layout — 1 column on mobile, 2 on tablet, 3 on desktop. Show a loading skeleton while products are fetching, and an empty state message if no products are found. Use Tailwind CSS and shadcn/ui components for the UI.
Paste this in Lovable chat
Expected result: A working product catalog page in your Lovable preview that displays your Shopify products with images, titles, and prices fetched live from your store.
Add shopping cart state and a cart sidebar
Add shopping cart state and a cart sidebar
A product catalog is only useful if customers can collect items before buying. In this step, ask Lovable to add cart functionality — a cart state that tracks items the customer has added, a cart count badge on a header icon, and a slide-out cart sidebar that shows the cart contents with quantities and a subtotal. Lovable will generate this using React context or a lightweight state management approach — typically a CartContext that wraps your app and provides addToCart, removeFromCart, and updateQuantity functions to any component. The cart sidebar component reads from this context and renders each item with its product image, name, price, quantity controls, and a remove button. A checkout button at the bottom of the cart will be wired in the next step. Send the prompt below, then check the preview. Click an Add to Cart button on the product catalog — the cart count in the header should increment and the sidebar should be accessible. If anything looks off — for example the cart count is not updating or the sidebar does not slide in — ask Lovable to fix the specific issue and it will adjust the code without regenerating the whole page. This entire cart is client-side state — nothing is written to Shopify until the customer clicks Checkout. Shopify only gets involved when a Checkout object is created, which happens in the next step. This keeps things fast and avoids creating abandoned checkouts for every page load.
Add shopping cart functionality to my Shopify storefront. Create a CartContext that wraps the whole app and stores the current cart items (product ID, variant ID, title, price, image, quantity). The Add to Cart buttons on the product catalog should add items to this context. Add a cart icon in the top-right header that shows a badge with the total item count. When clicked, it should open a slide-out cart sidebar showing each item with its image, name, price, a quantity increment/decrement control, a remove button, and a subtotal at the bottom. Include a Checkout button at the bottom of the sidebar — we will wire it to Shopify Checkout in the next step.
Paste this in Lovable chat
Expected result: Clicking Add to Cart on any product updates the cart count in the header. Opening the cart sidebar shows all added items with quantities, prices, and a subtotal. The Checkout button is visible but not yet functional.
Wire Shopify Checkout and go live
Wire Shopify Checkout and go live
The final step connects your cart to Shopify's hosted checkout page, where customers enter their payment and shipping details. Shopify handles all payment processing, tax calculation, and order creation — your Lovable app just needs to create a Shopify Checkout object from the cart contents and redirect the customer to it. Send the prompt below to Lovable. The AI will generate code that calls the Shopify Storefront API to create a checkout with the customer's current cart line items, retrieves the Shopify-hosted checkout URL from the response, and redirects the browser to that URL when the customer clicks the Checkout button in the cart sidebar. The customer completes their purchase on Shopify's secure checkout page, which handles credit cards, Shop Pay, Apple Pay, and any other payment methods you have enabled in your Shopify admin. After sending the prompt, test the full flow in the Lovable preview: add a product to cart, open the sidebar, and click Checkout. You should be redirected to a checkout.shopify.com page with your products already in the cart. If you want to test a real purchase, you can use Shopify's test credit card numbers in your store's test mode. Once the checkout flow works in preview, publish your Lovable app using the Publish button in the top-right corner. Your custom Shopify storefront is now live. All orders will appear in your Shopify admin as normal — inventory is decremented, order confirmation emails are sent, and all your existing Shopify workflows (fulfillment, shipping, returns) continue to work exactly as before.
Wire the Checkout button in my cart sidebar to Shopify's hosted checkout. When the customer clicks Checkout, call the Shopify Storefront API to create a checkout with all current cart line items (using the variant IDs and quantities from CartContext). Get the webUrl from the checkout response and redirect the browser to that URL. Show a loading spinner on the Checkout button while the API call is in progress, and show a toast error message if the checkout creation fails. After the redirect, clear the local cart state.
Paste this in Lovable chat
Expected result: Clicking Checkout in the cart sidebar redirects the customer to a Shopify-hosted checkout page (checkout.shopify.com) with all cart items pre-populated. Completed orders appear in your Shopify admin.
Common use cases
Generate a product catalog page
Use Shopify with Lovable to generate a product catalog page. This is one of the most common use cases when integrating Shopify into your Lovable application.
I have Shopify connected as a shared connector. Build me a product catalog page that fetches all published products from my Shopify store using the Storefront API. Show each product in a card with its main image, title, price, and an Add to Cart button. Use a responsive grid layout — 1 column on mobile, 2 on tablet, 3 on desktop. Show a loading skeleton while products are fetching, and an empty state message if no products are found. Use Tailwind CSS and shadcn/ui components for the UI.
Copy this prompt to try it in Lovable
Add shopping cart state and a cart sidebar
Take your Shopify integration further by add shopping cart state and a cart sidebar. This builds on the basic setup to create a more complete experience.
Add shopping cart functionality to my Shopify storefront. Create a CartContext that wraps the whole app and stores the current cart items (product ID, variant ID, title, price, image, quantity). The Add to Cart buttons on the product catalog should add items to this context. Add a cart icon in the top-right header that shows a badge with the total item count. When clicked, it should open a slide-out cart sidebar showing each item with its image, name, price, a quantity increment/decrement control, a remove button, and a subtotal at the bottom. Include a Checkout button at the bottom of the sidebar — we will wire it to Shopify Checkout in the next step.
Copy this prompt to try it in Lovable
Wire Shopify Checkout and go live
Prepare your Shopify integration for production by wire shopify checkout and go live. Ensures your integration works reliably for real users.
Wire the Checkout button in my cart sidebar to Shopify's hosted checkout. When the customer clicks Checkout, call the Shopify Storefront API to create a checkout with all current cart line items (using the variant IDs and quantities from CartContext). Get the webUrl from the checkout response and redirect the browser to that URL. Show a loading spinner on the Checkout button while the API call is in progress, and show a toast error message if the checkout creation fails. After the redirect, clear the local cart state.
Copy this prompt to try it in Lovable
Troubleshooting
Shopify connector shows 'Connection failed' after entering credentials
Cause: The Storefront API token may be incomplete, the store domain may include https:// or a trailing slash, or the Storefront API scopes were not enabled before the token was generated.
Solution: Go back to your Shopify admin, open the app you created, and click the API credentials tab. Verify the Storefront API access token is fully copied — they are long strings and it is easy to miss the last few characters. Check that your store domain is entered as your-store.myshopify.com with no prefix or suffix. If the scopes were not set before you installed the app, go to the Configuration tab, update the Storefront API scopes, save, then regenerate the token from the API credentials tab.
Products load in Lovable preview but show 'undefined' for price or image
Cause: The Storefront API GraphQL query generated by Lovable may not include the priceRange or images fields, or the product in Shopify may have no images or an empty price.
Solution: Ask Lovable to update the Storefront API query to include priceRange { minVariantPrice { amount currencyCode } } and images(first: 1) { edges { node { url altText } } } in the product fields. Also verify in your Shopify admin that the affected products have at least one image uploaded and a price set — products in draft status or with no variants will not have pricing data.
Checkout redirect works but the cart on Shopify's checkout page is empty
Cause: The checkout was created with incorrect or missing variant IDs — the Shopify Storefront API requires the full variant globalId (gid://shopify/ProductVariant/123456) not a plain integer, and the lineItems array may be malformed.
Solution: Ask Lovable to verify that the cart items being sent to the Shopify createCheckout mutation are using the variantId in the format gid://shopify/ProductVariant/{id} and that the lineItems array has the correct shape — each item should be an object with variantId and quantity as separate fields. In the Lovable chat, say: 'The Shopify checkout is being created with empty line items — check that the createCheckout mutation is correctly mapping cart items to lineItems with variantId and quantity fields.'
Best practices
- Always use Shopify's Storefront API for custom storefronts — never the Admin API in a client-side app. The Admin API has full store access including orders and customer data, and exposing its token in frontend code is a serious security risk.
- Store your Shopify Storefront API token through the Lovable Connectors panel, not in your chat messages or code. On Lovable's free plan, chat history may be publicly visible — a token pasted in chat could be exposed.
- Enable only the Storefront API scopes your storefront actually needs. For a read-only product catalog with checkout, you only need unauthenticated_read_product_listings, unauthenticated_read_product_inventory, and unauthenticated_write_checkouts — no customer data access required.
- Test checkout flows using Shopify's built-in test payment gateway (Bogus Gateway) before going live. Enable it in your Shopify admin under Settings → Payments → Bogus Gateway. This lets you complete test orders end-to-end without real payment details.
- Sync product data carefully — your Lovable storefront reads live data from Shopify on each page load, so any product changes in Shopify admin (price updates, new images, inventory changes) appear immediately without redeploying your Lovable app.
- Use Shopify Collections to organize products and prompt Lovable to add collection filtering to your catalog page. This is much more maintainable than hardcoding product IDs — you manage the catalog from Shopify admin and the storefront reflects it automatically.
- Keep all order management, discounts, and customer accounts inside Shopify admin — do not try to replicate these in Lovable. Your Lovable app is the storefront layer; Shopify is the commerce engine. Keeping that separation makes both tools easier to maintain.
- After publishing your Lovable storefront, update your Shopify admin's allowed domains in Apps → your app → Configuration if you have content security policies or checkout domain restrictions enabled, so the checkout redirect works correctly from your production URL.
Alternatives
Choose WooCommerce if your products are already on a WordPress/WooCommerce site — it requires manual Edge Function integration rather than a native connector, but is the right choice if you are already invested in the WordPress ecosystem.
Choose BigCommerce if you need enterprise-grade catalog management with B2B features or multi-currency support out of the box — it integrates with Lovable via manual Edge Function setup.
Choose Magento (Adobe Commerce) if you are building a large-scale retail operation with complex custom catalog rules — it is the most powerful e-commerce platform but requires advanced manual integration with Lovable.
Frequently asked questions
Does the Shopify integration work on Lovable's free plan?
Yes. Shared connectors including Shopify are available on all Lovable plans, including the free tier. You will use credits to generate and iterate on your storefront code, but the Shopify connector itself has no extra cost. The free plan gives you 5 daily credits (up to 30 per month), which is enough to build a basic storefront with a few rounds of iteration.
Will my Shopify orders, inventory, and payments still work normally after connecting to Lovable?
Yes. Your Lovable storefront is a custom frontend that sits on top of Shopify — all orders still go through Shopify Checkout, inventory is managed in your Shopify admin, payment processing is handled by Shopify, and all existing integrations (email, fulfillment, analytics) continue to work exactly as before. Lovable only reads product data and creates checkout sessions; it does not touch your Shopify admin or backend settings.
Can I show only some of my Shopify products in my Lovable storefront?
Yes. The easiest way is to use Shopify Collections — create a collection in your Shopify admin and add only the products you want to feature. Then ask Lovable to fetch products from that specific collection handle instead of fetching all products. You can also ask Lovable to filter by product tag or availability status. Alternatively, prompt Lovable to build a collection-based navigation so customers can browse by category.
What happens to the cart if the customer navigates away from my Lovable app?
By default, Lovable generates cart state using React context, which is stored in memory and lost on page refresh or navigation away from the app. To persist the cart across sessions, ask Lovable to save cart contents to localStorage — prompt: 'Save the cart contents to localStorage so they survive page refreshes.' This is a common follow-up improvement and takes one prompt to add.
Can I use Shopify's discount codes or gift cards in my Lovable storefront?
Yes, but you need to ask Lovable to add that functionality explicitly. Shopify's Storefront API supports applying discount codes to a checkout via the checkoutDiscountCodeApplyV2 mutation. Prompt Lovable: 'Add a discount code field to the cart sidebar. When the customer enters a code and clicks Apply, call the Shopify Storefront API to apply the discount to the checkout and display the updated price.' For complex promotional scenarios, RapidDev's team can help configure multi-step discount flows.
Is this a headless Shopify storefront? Do I need a Shopify Hydrogen plan?
Yes, this is technically a headless storefront — a custom frontend connected to Shopify's Storefront API. You do not need Shopify Hydrogen or any special Shopify plan for this. The Storefront API is available on all Shopify plans including the Basic plan. Hydrogen is Shopify's own React framework for building headless storefronts, but since Lovable generates the frontend code for you, you get a headless storefront without needing to use Hydrogen at all.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation