Your own frontend
Build your store's frontend yourself, such as a Next.js site, on the store's JSON API.
You can sell from a frontend you build yourself instead of a Liquid theme. Your site reads the store and its products, keeps a cart, and checks out through the same JSON API the store's own pages use, on the store's domain:
GET https://<store domain>/api/store
GET https://<store domain>/api/products?page=1&pageSize=20
GET https://<store domain>/api/products/<url slug>
POST https://<store domain>/api/cart/synchronizeThe store domain is its .mynovinzo.com subdomain or its custom domain. Every route of the storefront API is available: cart, payment methods, checkout, sign-in and orders.
Allow your site
A browser only lets a page on your site read the store's answers if the store allows your site. In the dashboard, open Settings › Developers and add your site under Allowed sites, such as https://www.example.com. Add http://localhost:3000 while you develop.
Calls from an allowed site get CORS headers with Access-Control-Allow-Credentials: true, and their preflights are answered. A store allows at most 20 sites. A site it does not list can still read nothing, and its POST requests are refused with 403.
Your server can call the same routes without allowing anything: a request with no Origin is not a browser's.
Read the catalog
const store = "https://shop.example.com";
const { items, pagination } = await fetch(`${store}/api/products?page=1&pageSize=20`).then((r) =>
r.json(),
);
const product = await fetch(`${store}/api/products/${items[0].urlSlug}`).then((r) => r.json());| Route | Query or path | Answers |
|---|---|---|
GET /api/store | What StorefrontGetStore answers: the store's name, currency, policies and logo. | |
GET /api/products | page, pageSize, search | What StorefrontProductList answers: live products, 20 a page by default, at most 100. |
GET /api/products/:slug | the product's URL slug | What StorefrontGetProductByUrlSlug answers, or 404 PRODUCT_NOT_FOUND. |
Image URLs are absolute. The edge closest to the caller keeps each answer until the store's content changes, and a browser may keep one for a minute. A call the edge answers counts against no limit; the others share the cart tier's limit of 60 requests a minute per client and store, so cache them on your server when you render pages there.
Cart and checkout
Keep the cart in your site and price it with POST /api/cart/synchronize, then check out with POST /api/checkout/initiate, as described under Checkout. To send the buyer to the store's pay page instead, create a checkout session from your server.
Signed-in shoppers
Shopper sign-in uses a cookie on the store's domain. Browsers send it to your site's calls only when the store's domain and your site are the same site: give the store a custom domain under your own, such as shop.example.com beside www.example.com, and call the API with credentials: "include". Browsers that block third-party cookies refuse it otherwise.
