AI Folks
  • Courses
  • Web Of AI
  • Pricing
  • Enterprise
Log in
PreviousPayments in India with RazorpayNextWhen to fine-tune

Vibe Coder · Unit 18: Email, Payments and Commerce · Lesson 5 of 5

Selling products with Shopify

If you sell goods rather than software, do not build a shop. Use Shopify for the catalogue, cart, checkout and orders, and connect your own site or app through the Storefront API.

Read the short notes and pictures.Do everything inside a blue frame.

Software or goods

The last three lessons were about charging for software: a plan, a subscription, access. Selling physical or digital goods is a different job. There are products with variants and stock, a cart, shipping rates, tax by region, order status and returns. Every one of those is a project. Shopify exists so that you do not build them.

Two ways in

Pale linen, hand-drawn. Two cards: their storefront, with a theme and no code; your own front end, with Shopify behind it.
Use Shopify’s storefront, or put your own in front of it.

Their storefront

Choose a theme.
Add products.
Connect payments.
You are selling.

Your own front end (headless)

Your site, landing page or app shows
the products and the cart.
Shopify holds the catalogue, takes the
payment and records the order.
Start with their storefront unless your product’s experience is the reason people buy.

The Storefront API

The Storefront API is how your own front end talks to Shopify. It is a GraphQL API: you send a query describing the fields you want and get exactly those back. It covers browsing products and collections, managing a cart, and getting a checkout URL.

Pale linen, hand-drawn. Three nodes: your site or app asks for products, the Storefront API in GraphQL, Shopify with the catalogue and cart.
Your front end asks; Shopify answers.

Tokenless access

Products, collections, search and cart can be read without a token, within a complexity limit.

Public access token

For browsers and mobile apps. Safe to ship in a front end.

Private access token

Kept secret and used only on a server.

Headless channel

Adding it in the Shopify admin gives you the tokens.

Hydrogen

Shopify’s own React framework for headless shops.

A query

query {
  products(first: 3) {
    nodes {
      title
      handle
      priceRange {
        minVariantPrice { amount currencyCode }
      }
    }
  }
}

What you ask your builder for

"Show the first three products from my
Shopify store on the landing page, using
the Storefront API. Add an 'Add to cart'
button that creates a cart and a
'Checkout' button that goes to the
cart’s checkout URL."
You do not need to write GraphQL yourself. You do need to recognise it when the builder shows it to you.

Checkout and payment

In a headless shop your site builds the cart, and when the customer is ready you send them to the checkout URL that Shopify provides. Shopify’s checkout takes the payment and creates the order. You never handle the card, as with Stripe. In India, Razorpay offers a plugin for Shopify.

Orders as events

  1. 1

    Trigger on a new order

    n8n has Shopify nodes. A new order starts the workflow.

  2. 2

    Do the back-office work

    Update a stock sheet in Airtable, message the team, create a shipping task.

  3. 3

    Tell the customer

    An order email through Resend, in your own voice.

  4. 4

    Watch for failures

    With the error workflow from the n8n unit.

Check current plans and fees

Shopify charges a subscription and, depending on how you take payment, transaction fees. These change and vary by country. Read the current pricing page and your payment provider’s terms before you set your own prices.

Tokens

A public Storefront token is meant for the browser. A private one, and anything from the Admin API, is not. Keep those on a server or in an n8n credential.

ActivityYour turnWrite it yourself first, then compare.

You sell three printed posters and want them on your existing landing page, which is built in Framer or Lovable. Which approach do you choose and why?

ActivityBuild stepA product that can charge

Decide how your product sells, and publish the unit

If your product sells goods, set up a Shopify development store with two products and show them on your site through the Storefront API, with a working checkout link and a new-order workflow. If it does not, write why, and move on. Then push this unit’s work to GitHub.

Done when

Your product can now send email and take money. Keep everything in test mode until the launch unit.

Keep these

  • For goods, let Shopify hold the catalogue, cart, checkout and orders.
  • The Storefront API connects your own front end to it.
  • New orders can trigger your n8n workflows.
Previous lessonPayments in India with RazorpayProject · milestone 18A product that can charge