Skip to main content

What are you looking for?

Explore our services and discover how we can help you achieve your goals

Headless Magento with Next.js: planning the build

A headless Magento build keeps Magento as the commerce engine for catalogue, cart and checkout while a Next.js front end calls its GraphQL API and renders every page itself. Plan it against that API's documented coverage: catalogue, cart, checkout and customer tokens are in the schema; anything it does not name needs a custom resolver or a REST call.

Submit a project See the reward shop record

Reviewed by Huy Nguyen (David), CEO · Updated 25 Oct 2026 · 12 min read

star

OutsourcingVN is operated by Netbase JSC. Deciding whether to decouple at all is the headless vs traditional e-commerce guide's question, and whether Next.js fits the front end is the Next.js platform page's; this guide assumes both are settled and plans the Magento-specific build, as headless commerce defines the architecture in general. Choosing Magento itself over another commerce platform is the Magento vs WooCommerce guide's question.

Contents

Which system owns each part of a headless Magento and Next.js build?

Adobe's own GraphQL schema documentation describes coverage for core and B2B Commerce functionality on Magento, alongside service-based features such as Catalog Service, Live Search and Recommendations; B2B-specific fields, such as a customer's job title, requisition lists, role, status, team and telephone, are Adobe Commerce B2B features layered on the Customer object, not a Magento Open Source default.

Record Owned by Why
Product catalogue and category navigation Magento Catalog and category queries are the source of truth; Next.js reads them per page
Cart Magento Cart tasks cover quantities, totals, coupons, and the shipping and payment details checkout needs
Checkout and payment Magento The checkout schema manages payment tokens and checkout agreements for the payment methods it documents by name
Customer session A Magento customer token A Bearer token from the generateCustomerToken mutation, one hour by default, revocable on logout
Rendering, caching and revalidation Next.js Each route picks its own rendering strategy and cache lifetime, on its own release schedule

Magento's own schema-definition documentation describes how a custom module adds what the default schema does not cover: defining a new query or mutation, declaring its input and output attributes, and writing the resolver class behind it; the same documentation describes query caching through a @cache(cacheIdentity:...) directive, noting that queries relating to products, categories and CMS content may be cached this way. Where the reference does not name a query for something the storefront needs, that extension path, or a REST call for the one operation, is the usual route, not a sign that GraphQL was the wrong choice.

Diagram of where a headless Magento and Next.js build's records live: Magento owns catalogue, cart, checkout and session tokens, while Next.js owns rendering, caching and store-view language variants (opens the full-size diagram in a new tab)
Diagram of where a headless Magento and Next.js build's records live

How does a store move page type by page type?

  1. List every page type against GraphQL's own coverage

    Category, product, CMS, cart, checkout and customer-account pages each map to a documented query or mutation, or to a gap worth naming before work starts.

  2. Stand up the Next.js front end against the same GraphQL endpoint

    , in parallel with the coupled storefront, so both read one catalogue while the build is proven.

  3. Cut over category and product pages first

    Magento's own catalog and category queries cover them directly, so they carry the least rendering risk.

  4. Cut over cart and checkout once every payment method in use is confirmed

    against the checkout schema's own documented list, closing any gap with a custom resolver or a REST call for that one step.

  5. Cut over customer-account pages once the Bearer-token login flow is tested end to end

    , including what happens when the one-hour default token expires mid-session.

  6. Decide CMS and marketing-page handling

    Content that is Magento's own CMS pages can stay there; a content set that a separate team edits on its own schedule is a WordPress to headless CMS migration question instead.

  7. Verify redirects, SEO parity and caching for every migrated page type

    , then retire the coupled theme's equivalent template.

Worked scenario: a two-language storefront cutting over by page type

A hypothetical outdoor-gear retailer runs English and French store views on one Magento website and wants a faster, search-friendly front end without rebuilding checkout from scratch.

  • Milestone one stands up Next.js against the existing GraphQL endpoint, reading both store views' catalog and category queries, and cuts over category and product pages first since those queries are the most complete.
  • Milestone two cuts over cart and checkout once the store's two payment methods are each confirmed against the checkout schema's documented list, with one gap closed by a small custom resolver.
  • Milestone three moves customer-account pages once the token login and expiry flow is proven in both languages, then retires the matching pages in the coupled theme.

Each store view keeps its own language throughout, since Magento's website, store and store view hierarchy, not the front end, is what carries that distinction.

What has Netbase built with headless Magento and Next.js?

For a Dubai-based loyalty and rewards technology company that is not named, Netbase delivered a headless multi-store reward shop platform on Magento 2 Open Source with a Next.js front end: individually branded reward shops per client programme, a hybrid points-plus-cash checkout, merchandise, gift cards and travel bookings, a multi-vendor module with fulfilment routing and service-level breach alerts, Arabic and English, integrations with the client's points middleware, ordering service and product catalogue by webhook and scheduled sync, single sign-on, payment gateways, mobile SDK interface components for client apps, a centralised super-administrator dashboard and AWS or on-premise deployment, in four phases over 3.5 to 4.5 months; see the reward shop record. The redemption rules, fulfilment routing and multi-brand shop design inside that kind of build are planned in full on the loyalty and rewards platform guide; this guide stays on the Magento and Next.js mechanics underneath it.

Plan the next step for your project

Where does AI fit in a headless Magento and Next.js build?

The clearest AI use sits on the Next.js side: a search or recommendation widget that calls a model and renders the result, and an on-page assistant that answers catalogue or order-status questions without a full support ticket, each calling a service the front end renders rather than code embedded in the rendering layer itself. None of it replaces the catalogue, cart, checkout and session rules this guide plans on the Magento side. E-commerce development scopes where a front-end AI feature earns its place against the back end that has to serve it.

What should you check in Magento's and Next.js's own documentation?

Next.js's own version-specific upgrade guides run from version 14 to version 16; its caching documentation states that new App Router apps created with the recommended create-next-app defaults already have Cache Components enabled, caching data and UI through a use cache directive paired with a cache lifetime, while the previous caching model, still current for applications that have not adopted Cache Components, revalidates a page on a time-based schedule or on demand through revalidatePath and revalidateTag, and exposes the result on the response as x-nextjs-cache: HIT, STALE, MISS or REVALIDATED. Next.js's own deployment documentation states that a static export does not support the features a dynamic storefront needs, so a headless Magento front end deploys as a Node.js server, a Docker container or a supported adapter instead. Confirm before scoping a build:

  • Which GraphQL queries and mutations the storefront needs are already documented, and which page types need a custom resolver or a REST call to close a gap.
  • Which payment methods the checkout schema documents by name, such as Braintree and several PayPal integration types, against the gateways the store actually uses.
  • Which Next.js caching model the project is on: Cache Components with use cache and a cache lifetime, or the previous time-based and on-demand revalidation model, since the two are configured differently.
  • How many websites, stores and store views the catalogue needs, since that hierarchy, not the front end, is what carries multi-store and language variants.

What goes wrong in a headless Magento and Next.js build?

  • Treating GraphQL coverage as complete without checking it. A checkout step, a payment method or a B2B feature assumed to be native turns into unplanned custom-resolver work discovered mid-build.
  • Token expiry left untested. A customer's one-hour session token lapsing mid-checkout, with no refresh or re-login handled gracefully, loses a cart that was otherwise ready to convert.
  • One caching strategy applied to every route. A product page revalidated as often as a cart wastes the cache; a cart rendered as statically as a category page shows stale stock.
  • Store views bolted on after launch. Multi-store and language support are easier to model against Magento's own hierarchy from the start than to retrofit once templates assume one locale.

Which questions should you ask a headless Magento supplier?

  • Which page types does the current GraphQL schema cover out of the box, and which need a custom resolver or a REST call?
  • Which payment methods are in scope, and are they each confirmed against the checkout schema's own documented list?
  • Which Next.js caching model is the build on, and how is a cache lifetime chosen per route?
  • How are redirects and SEO parity verified for each page type as it cuts over?
  • How is scope fixed? Most Netbase projects are agreed as fixed-scope contracts after discovery, with milestone-based arrangements also available.

How this guide is sourced and where it stops

The Magento GraphQL facts are read from Adobe's own developer documentation, and the Next.js facts from Next.js's own documentation, on the dates cited. Netbase's delivery lifecycle: discovery and strategic alignment; team assembly and architecture planning; agile execution with outcome-based milestones; modular components; training and rollout; ongoing support. The cutover sequence and the worked scenario are editorial planning guidance.

Common questions

Mostly: catalogue, category navigation and cart are native, and checkout documents its payment methods by name; a page type the schema reference does not name is closed with a custom resolver or a REST call instead.

A customer token is valid for one hour by default, configurable in Magento's own admin settings, and can be revoked on logout.

Yes. Adobe describes one website and one store with several store views as a common way to support different languages; the front end reads whichever store view a request targets.

Not by requirement, but Next.js's caching documentation states that new App Router apps created with the recommended create-next-app defaults already have Cache Components, with a use cache directive and a cache lifetime, enabled; an existing project not yet on it uses the previous time-based and on-demand revalidation model instead.

The reward shop platform record, described above in the chapter on what Netbase has built on this pairing.

Plan your headless Magento build

Bring your current GraphQL coverage gaps, your payment methods and your store-view list to a brief. E-commerce development scopes the build, the custom resolvers it needs and the page-by-page cutover; a store still deciding whether to decouple at all starts with headless vs traditional e-commerce first, and a store on an older Magento release starts with the Magento 2 upgrade guide instead.

OutsourcingVN is Netbase's own outsourcing-services platform. Submit a project with your GraphQL coverage gaps and payment methods, and a person will reply with the fit.

E-commerce development, built, extended or replatformed as a project E-commerce development, built, extended or replatformed as a project

A store built, extended or replatformed on Magento, WooCommerce or headless, as scoped milestones.

Learn More
line

Tell us what you want to build or automate.

Submit a project