• Product Introduction
  • Quick Start
    • Agent Development
    • Importing a Git Repository
    • Starting From a Template
    • Direct Upload
    • Start with AI
  • Framework Guide
    • Agent
    • Frontends
      • Vite
      • React
      • Vue
      • Hugo
      • Other Frameworks
    • Backends
    • Full-stack
      • Next.js
      • Nuxt
      • Astro
      • React Router
      • SvelteKit
      • TanStack Start
      • Vike
    • Custom 404 Page
  • Project Guide
    • Project Management
    • edgeone.json
    • Configuring Cache
    • Building Output Configuration
    • Error Codes
  • Build Guide
  • Deployment Guide
    • Overview
    • Create Deploys
    • Manage Deploys
    • Deploy Button
    • Using Github Actions
    • Using Gitlab CI/CD
    • Using CNB Plugin
    • Using IDE PlugIn
    • Using CodeBuddy IDE
  • Domain Management
    • Overview
    • Custom Domain
    • HTTPS Configuration
      • Overview
      • Apply for Free Certificate
      • Using Managed SSL Certificate
    • Configure DNS CNAME Record
  • Observability
    • Overview
    • Metric Analysis
    • Log Analysis
  • Functions
    • Overview
    • Edge Functions
    • Cloud Functions
      • Overview
      • Node.js
      • Python
      • Go
  • Agents
    • Overview
    • Quick Start
    • Conversation Storage
    • Observability
    • Sandbox Tool
      • Overview
      • Using the Agent Framework
      • Sandbox Atomic API
      • Network Search Tool
    • Agent Authentication
  • Models
    • Overview
    • Models and Vendors
      • Overview
      • Using Vendor Keys
        • OpenAI
        • Anthropic
        • Google AI Studio
        • DeepSeek
        • MiniMax
        • Hunyuan
        • Zhipu
        • MoonShot AI
    • FAQs
  • Storage
    • Overview
    • KV
    • Blob
  • Middleware
  • AI-Native Development
    • Skills
    • MCP
  • Copilot
    • Overview
    • Quick Start
  • API Token
  • EdgeOne CLI
  • Message Notification
  • Integration Guide
    • AI
      • Dialogue Large Models Integration
      • Large Models for Images Integration
    • Database
      • Supabase Integration
      • Pages KV Integration
    • Ecommerce
      • Shopify Integration
      • WooCommerce Integration
    • Payment
      • Stripe Integration
      • Integrating Paddle
    • CMS
      • WordPress Integration
      • Contentful Integration
      • Sanity Integration
      • Payload Integration
    • Authentication
      • Supabase Integration
      • Clerk Integration
  • Best Practices
    • Adding an AI Chat Assistant to a Website
    • AI Dialogue Deployment: Deploy Project with One Sentence Using Skill
    • Using General Large Model to Quickly Build AI Application
    • Use the DeepSeek model to quickly build a conversational AI site
    • Building an Ecommerce Platform with Shopify
    • Building a SaaS Site Using Supabase and Stripe
    • Building a Company Brand Site Quickly
    • How to Quickly Build a Blog Site
  • Migration Guides
    • Migrating from Vercel to EdgeOne Makers
    • Migrating from Cloudflare Pages to EdgeOne Makers
    • Migrating from Netlify to EdgeOne Makers
  • Troubleshooting
  • FAQs
  • Limits
  • Pricing
  • Contact Us
  • Release Notes

Shopify Integration

This document describes how to build a high-performance website using the Shopify Storefront API and the Next.js framework. With the EdgeOne Makers template, you can quickly integrate Shopify with Next.js and leverage global CDN acceleration to achieve excellent website performance and user experience.

Getting Started

EdgeOne Makers provides a complete Shopify + Next.js integration template. You can click the deployment button in the template for rapid deployment.
This integration guide primarily covers the following two steps: configuring Shopify and deploying to EdgeOne Makers. If you want to understand the specific implementation principles of this solution or need to perform customized development based on your own requirements, you can continue reading the detailed configuration steps below.

Shopify Configuration

Shopify provides the StoreFront API implementation to enable Headless e-commerce. E calls the StoreFront API to request user information, shopping cart information, and displays it on the frontend.

1. Creating a Store

Enter Shopify Dev to register a new account and create a store. After creation, enter your store management backend.


2. Adding a Product

Add your product under Products.


3. Installing the Headless Theme

Custom e-commerce websites implemented using the Storefront API will have their own store domain names. The Shopify Headless Theme needs to be installed to connect Shopify's built-in pages with your custom site.
Download the theme from the Github repository, enter the online store, and click Add Theme->Upload zip file.

Select the downloaded theme package.

After uploading, click Customize to enter the customization interface.

In the settings interface, fill in your site domain name, then click Save to save, and click Publish to publish.

The theme is now successfully activated.

4. Environment Variable Preparation

Click the top search box, manually input App and sales channel setting, and click App and sales channel setting at the bottom.


Click Develop apps in the top right corner.

Initial entry requires enabling the Create a legacy custom app feature.

Click create app, input the name, then click Create app.

After App creation is completed, enter the configuration interface, click Configure Storefront API scopes, and Configure permissions.

For permission configuration, see the following:

After configuration is complete, save. Enter the API Credentials tab, install the application to get Storefront API Access Token.


In the settings interface, you can obtain your store address at the top-left corner.

Get the store address and Storefront API Access Token, then you can use API calls to access the Shopify store API.

Integration Details

API Routing (Backend API)

Shopping Cart API
POST /api/cart/create - Create a shopping cart
GET /api/cart/get - Retrieve shopping cart information
POST /api/cart/add - Add product to shopping cart
POST /api/cart/remove - Remove product from shopping cart
POST /api/cart/update - Update shopping cart product quantity
User Authentication API
POST /api/customers/login - User login
POST /api/customers/register - User registration
POST /api/customers/logout - User logout
GET /api/customers/account - Get user account information
Product and Order API
GET /api/collections - Search product categories
GET /api/collections/[handle] - Get products in a specific category
GET /api/orders - Get user orders
POST /api/checkout/create - Create a checkout session

Main Functional Modules

Shopify Integration Layer
Encapsulate Shopify Storefront API calls, provide a unified GraphQL client and business service layer, handle all data interaction with the Shopify backend.
Core client (src/lib/shopify/client.ts)

User Authentication System
Implement user registration, sign in, and log out in the Shopify customer system, manage user session status and store access tokens locally.
Authentication context (src/context/auth-context.tsx)

Shopping Cart Management
Implement full shopping cart functionality, including adding products, modifying quantity, deleting products, shopping cart state synchronization, supporting local storage and Shopify backend sync.
Shopping cart context (src/context/cart-context.tsx)


Deploying to EdgeOne Makers

1. Add an Environment Variable

Enter the template page Shopify Ecommerce Starter, click Deploy, and after logging in, enter the console deployment page to configure the following environment variables:
SHOPIFY_STORE_DOMAIN: Fill in your Shopify store address.
SHOPIFY_STOREFRONT_ACCESS_TOKEN: Fill in your Storefront API Access Token.
SHOPIFY_API_VERSION: Fill in 2025-04 if no special requirement.

After configuration, click the "Start Deployment" button and wait for deployment to complete. The deployment successful interface will display. If the project deployment fails, you can modify the project based on Build Logs and Build Summary info, or contact staff to resolve.

2. Test Payment

To test the payment process, activate Shopify payment test mode in the referenced document.


ai-agent
You can ask me like
How to Get Started with EdgeOne Makers?