Skip to main content
RapidDev - Software Development Agency
bolt-ai-integrationsBolt Chat + API Route

How to Integrate Bolt.new with Magento

Integrate Bolt.new with Magento (Adobe Commerce) by calling its REST API through a Next.js API route. Authenticate using an admin integration token stored in .env — never in client-side code. Fetch products, categories, and orders server-side; render a custom React storefront in the browser. Magento webhooks and real-time order events require a deployed Netlify or Bolt Cloud URL since Bolt's WebContainer cannot accept incoming connections.

What you'll learn

  • How to create a Magento integration and get an admin access token for API authentication
  • How to proxy Magento REST API calls through a Next.js API route to protect admin credentials
  • How to fetch and display Magento products, categories, and inventory in a custom React storefront
  • How to manage guest cart operations and redirect to Magento's hosted checkout
  • When to use Magento's REST API versus GraphQL API in a Bolt.new project
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate16 min read60 minutesE-commerceApril 2026RapidDev Engineering Team
TL;DR

Integrate Bolt.new with Magento (Adobe Commerce) by calling its REST API through a Next.js API route. Authenticate using an admin integration token stored in .env — never in client-side code. Fetch products, categories, and orders server-side; render a custom React storefront in the browser. Magento webhooks and real-time order events require a deployed Netlify or Bolt Cloud URL since Bolt's WebContainer cannot accept incoming connections.

Build a Custom Magento Headless Storefront in Bolt.new

Magento's headless commerce capability — its comprehensive REST and GraphQL APIs — makes it possible to build a fully custom frontend in Bolt.new while keeping Magento as the commerce engine. Product catalog management, inventory, order processing, customer accounts, and pricing rules all remain in Magento's admin panel. Bolt generates the customer-facing React interface that displays products, manages the cart, and hands off to Magento's checkout for payment processing.

Magento provides two API surfaces that serve different purposes in a Bolt integration. The REST API is the primary interface for administrative operations: product management, order processing, inventory updates, and customer data. It requires an admin integration token with specific resource permissions. The GraphQL API is optimized for storefront read operations — it's designed to be called from browser clients for product listings, search, and category browsing, with separate authentication for customer-specific data. For most Bolt projects, you'll use REST via server-side API routes for admin data and optionally GraphQL for storefront performance.

Magento is the most complex e-commerce platform to integrate with among common options — significantly more involved than BigCommerce or WooCommerce. Its REST API has hundreds of endpoints organized around resources (products, categories, orders, carts, customers, inventory). Admin permissions are granular, and many endpoints require specific permission scopes enabled in your integration. For teams without existing Magento infrastructure or Adobe Commerce Cloud, BigCommerce or Shopify are substantially simpler starting points. If your organization runs Magento and needs a custom frontend, this integration delivers significant value — Magento's headless tier eliminates its default Luma theme's performance limitations while keeping all commerce data centralized.

Integration method

Bolt Chat + API Route

Magento exposes a comprehensive REST API (and optionally GraphQL) accessible over HTTP. In Bolt.new, you authenticate with an admin integration token and proxy all Management API calls through a Next.js API route, keeping credentials server-side. React components in the browser call your own /api/ routes, which in turn query Magento's REST endpoints. Magento's GraphQL API can be called directly from client-side code for product catalog queries since it uses a separate, read-optimized public endpoint.

Prerequisites

  • A Magento 2.x or Adobe Commerce store (self-hosted or Adobe Commerce Cloud) with admin access
  • A Magento integration created in System → Extensions → Integrations with appropriate resource permissions (Catalog, Sales, Inventory)
  • Your integration's Access Token (visible in System → Extensions → Integrations → Edit → Integration Info after activation)
  • Your Magento store's base URL (e.g., https://store.yourdomain.com)
  • A Bolt.new project using Next.js (request Next.js explicitly when starting your project for API route support)

Step-by-step guide

1

Create a Magento Integration and Store Your Access Token

In your Magento admin panel, navigate to System → Extensions → Integrations → Add New Integration. Give it a descriptive name like 'Bolt Frontend App'. Set a callback URL (optional for server-to-server integrations) and an identity link URL (also optional). Under the 'API' tab, select the resource permissions your app needs. For a storefront, select: Catalog (Products, Categories), Inventory Management, and Customers (read). For an admin dashboard that writes data, also add Sales (Orders). Click Save. Magento requires you to activate the integration — click Activate in the integrations list, review the permissions, and click Allow. After activation, Magento shows four token values: Consumer Key, Consumer Secret, Access Token, and Access Token Secret. For a simple server-to-server integration, copy only the Access Token — this is all you need for Bearer authentication. In Bolt.new, open the .env file in your project root and add MAGENTO_BASE_URL=https://your-store.com and MAGENTO_ACCESS_TOKEN=your_access_token. Do not prefix these with VITE_ or NEXT_PUBLIC_ — Magento's access token grants admin-level access to your store and must never be exposed in client-side code. If you're using Magento's OAuth 1.0a flow instead of the simpler integration token, you'll need all four values and an OAuth signing library — but for most Bolt projects, the integration token approach is simpler and sufficient.

Bolt.new Prompt

Set up Magento API credentials in my Bolt project. Create a .env file with MAGENTO_BASE_URL and MAGENTO_ACCESS_TOKEN as placeholder variables. Create a lib/magento.ts utility that exports a magentoApi helper function accepting a path string and optional options (method, body, params). The helper constructs the full URL from MAGENTO_BASE_URL + /rest/V1 + path, adds Authorization: Bearer with MAGENTO_ACCESS_TOKEN, and returns the parsed JSON response. Handle HTTP errors by throwing with the status code.

Paste this in Bolt.new chat

lib/magento.ts
1// lib/magento.ts
2const BASE_URL = `${process.env.MAGENTO_BASE_URL}/rest/V1`;
3
4interface MagentoRequestOptions {
5 method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
6 body?: unknown;
7 params?: Record<string, string>;
8}
9
10export async function magentoApi<T>(
11 path: string,
12 options: MagentoRequestOptions = {}
13): Promise<T> {
14 const url = new URL(`${BASE_URL}${path}`);
15 if (options.params) {
16 Object.entries(options.params).forEach(([key, value]) => {
17 url.searchParams.set(key, value);
18 });
19 }
20
21 const response = await fetch(url.toString(), {
22 method: options.method ?? 'GET',
23 headers: {
24 Authorization: `Bearer ${process.env.MAGENTO_ACCESS_TOKEN}`,
25 'Content-Type': 'application/json',
26 Accept: 'application/json',
27 },
28 body: options.body ? JSON.stringify(options.body) : undefined,
29 });
30
31 if (!response.ok) {
32 const errorBody = await response.text();
33 throw new Error(`Magento API ${response.status}: ${errorBody}`);
34 }
35
36 return response.json() as Promise<T>;
37}

Pro tip: Magento's integration tokens do not expire by default, but they can be revoked from the admin panel. For production, create separate integrations with minimum required permissions for each environment (development, staging, production) to limit exposure.

Expected result: The magentoApi helper is available throughout your project. Calling it from Next.js API routes proxies requests to your Magento store with admin authentication.

2

Fetch Products and Build the Catalog Page

Magento's product search API uses a powerful but verbose searchCriteria query parameter pattern. Instead of simple key-value filters, every filter is a structured filterGroup with field, value, and conditionType. For example, fetching visible, enabled products requires filter groups for status (1 = enabled) and visibility (2 = catalog, 3 = search, 4 = catalog+search). The response includes a total_count and items array. Product images are included in the response as media_gallery_entries — the entry with types containing 'image' and position 1 is the main product image. The URL for product images is constructed as {MAGENTO_BASE_URL}/pub/media/catalog/product{file} where file is the media_gallery_entry file path. Magento product prices are split into price (base price) and special_price (sale price when applicable). Always check for special_price first — if it exists and is lower than price, display it as the current price with the original crossed out. For pagination, Magento uses searchCriteria[pageSize] and searchCriteria[currentPage] (1-indexed). The default page size is 20 — increase to 48 or 96 for a typical catalog grid. Building a category tree requires a separate API call to /rest/V1/categories, which returns a nested tree structure you can flatten for a sidebar navigation.

Bolt.new Prompt

Create a products API route at app/api/products/route.ts that fetches enabled, visible products from my Magento store. Use the search criteria: filter for status eq 1 (enabled) and visibility in [2,3,4]. Include media gallery entries in the response. Return the first 24 products with id, sku, name, price, special_price, and the main image URL constructed as MAGENTO_BASE_URL + /pub/media/catalog/product + file. Also create app/api/categories/route.ts that fetches the category tree from /rest/V1/categories and returns a flattened array of id and name. Build a CatalogPage React component that shows products in a grid with category filter buttons.

Paste this in Bolt.new chat

app/api/products/route.ts
1// app/api/products/route.ts
2import { NextRequest, NextResponse } from 'next/server';
3import { magentoApi } from '@/lib/magento';
4
5interface MagentoProduct {
6 id: number;
7 sku: string;
8 name: string;
9 price: number;
10 status: number;
11 visibility: number;
12 media_gallery_entries?: Array<{ file: string; types: string[]; position: number }>;
13 custom_attributes?: Array<{ attribute_code: string; value: string }>;
14}
15
16interface MagentoProductsResponse {
17 items: MagentoProduct[];
18 total_count: number;
19}
20
21export async function GET(request: NextRequest) {
22 const page = request.nextUrl.searchParams.get('page') ?? '1';
23
24 try {
25 const data = await magentoApi<MagentoProductsResponse>('/products', {
26 params: {
27 'searchCriteria[filterGroups][0][filters][0][field]': 'status',
28 'searchCriteria[filterGroups][0][filters][0][value]': '1',
29 'searchCriteria[filterGroups][0][filters][0][conditionType]': 'eq',
30 'searchCriteria[filterGroups][1][filters][0][field]': 'visibility',
31 'searchCriteria[filterGroups][1][filters][0][value]': '2,3,4',
32 'searchCriteria[filterGroups][1][filters][0][conditionType]': 'in',
33 'searchCriteria[pageSize]': '24',
34 'searchCriteria[currentPage]': page,
35 'searchCriteria[sortOrders][0][field]': 'created_at',
36 'searchCriteria[sortOrders][0][direction]': 'DESC',
37 },
38 });
39
40 const baseUrl = process.env.MAGENTO_BASE_URL;
41 const products = data.items.map((p) => {
42 const mainImage = p.media_gallery_entries?.find((img) => img.types.includes('image'));
43 const specialPrice = p.custom_attributes?.find((a) => a.attribute_code === 'special_price')?.value;
44 return {
45 id: p.id,
46 sku: p.sku,
47 name: p.name,
48 price: p.price,
49 salePrice: specialPrice ? parseFloat(specialPrice) : null,
50 image: mainImage ? `${baseUrl}/pub/media/catalog/product${mainImage.file}` : null,
51 };
52 });
53
54 return NextResponse.json({ products, total: data.total_count });
55 } catch (error) {
56 return NextResponse.json({ error: 'Failed to fetch products' }, { status: 500 });
57 }
58}

Pro tip: Magento's searchCriteria syntax looks verbose but is very powerful. You can filter by any product attribute, combine multiple filter groups with AND logic, and sort by any field. Bookmark Magento's search criteria documentation for reference.

Expected result: Visiting /api/products returns a paginated JSON array of your Magento catalog products with images and pricing. The React catalog page renders a grid of products fetched from your store.

3

Implement Guest Cart and Checkout Flow

Magento separates cart operations for guest users versus authenticated customers. For most Bolt storefronts targeting anonymous shoppers, guest cart is the starting point — it doesn't require authentication, just a guest cart token issued by the API. The flow is: (1) Create a guest cart by calling POST /rest/V1/guest-carts — this returns a quoteId string (the guest cart token). (2) Add items to the cart using POST /rest/V1/guest-carts/{quoteId}/items with the product SKU and quantity. (3) Retrieve the cart totals for display. (4) Set shipping and billing addresses. (5) Retrieve available shipping methods. (6) Place the order. In practice, step 5 (place order) is complex to build from scratch — billing, shipping, payment method selection, and order confirmation. For Bolt.new projects, the practical approach is to use Magento's guest checkout page for the actual payment step: set the shipping address via the API, then redirect the user to {MAGENTO_BASE_URL}/checkout with the quoteId. This delegates the payment UI to Magento while giving you full control over the product browsing and cart experience. Important: guest cart tokens are temporary and expire after the session or after a configurable timeout (default 1 hour of inactivity). Store the quoteId in localStorage and create a new cart if the existing one expires. Magento's cart API requires SKU-based line items, not product IDs — always use the product's SKU field when adding to cart.

Bolt.new Prompt

Build a cart API route at app/api/cart/route.ts that handles guest cart operations. POST to this route with action='create' should create a new Magento guest cart via POST /rest/V1/guest-carts and return the quoteId. POST with action='add' should add an item via POST /rest/V1/guest-carts/{quoteId}/items with sku, qty, and quote_id. GET with a quoteId query param should return the cart contents from GET /rest/V1/guest-carts/{quoteId}. Create a useCart React hook in hooks/useCart.ts that stores quoteId in localStorage, provides addToCart(sku, qty) and getCart() functions, and tracks total item count.

Paste this in Bolt.new chat

app/api/cart/route.ts
1// app/api/cart/route.ts
2import { NextRequest, NextResponse } from 'next/server';
3import { magentoApi } from '@/lib/magento';
4
5interface CartItem {
6 sku: string;
7 qty: number;
8 quote_id: string;
9}
10
11export async function GET(request: NextRequest) {
12 const quoteId = request.nextUrl.searchParams.get('quoteId');
13 if (!quoteId) return NextResponse.json({ error: 'quoteId required' }, { status: 400 });
14
15 const cart = await magentoApi(`/guest-carts/${quoteId}`);
16 return NextResponse.json(cart);
17}
18
19export async function POST(request: NextRequest) {
20 const body = await request.json();
21
22 if (body.action === 'create') {
23 const quoteId = await magentoApi<string>('/guest-carts', { method: 'POST' });
24 return NextResponse.json({ quoteId });
25 }
26
27 if (body.action === 'add') {
28 const { quoteId, sku, qty } = body;
29 const item = await magentoApi(`/guest-carts/${quoteId}/items`, {
30 method: 'POST',
31 body: { cartItem: { sku, qty, quote_id: quoteId } as CartItem },
32 });
33 return NextResponse.json(item);
34 }
35
36 return NextResponse.json({ error: 'Invalid action' }, { status: 400 });
37}

Pro tip: Use product SKUs (not product IDs) when adding items to Magento carts — the cartItem.sku field is required. Find a product's SKU in the product data returned by your /api/products route.

Expected result: A guest cart is created and its quoteId stored in localStorage. Adding products to the cart updates the cart count. Users can proceed to {MAGENTO_BASE_URL}/checkout for payment.

4

Handle Magento Webhooks After Deployment

Magento does not have a built-in webhook system in the way Stripe or BigCommerce does — instead, it offers two mechanisms for real-time event notifications. The first is Magento's Observer pattern with REST API callbacks: you can configure event-to-URL mappings in Magento's admin under Stores → Configuration → Services → Webhooks (available in Adobe Commerce Cloud). The second, more commonly used approach for headless setups, is a message queue or event forwarding using third-party plugins like WebhookMagento2 from the Magento Marketplace, or building custom Magento modules that POST to your URL on specific events. For most Bolt.new projects, a simpler polling approach is practical: set up a scheduled job (via Vercel Cron or similar) that polls the Magento Orders API every few minutes for new orders. This avoids the complexity of Magento webhook configuration while keeping your order processing relatively timely. If you need real-time order events, the Adobe Commerce (cloud) edition supports native webhook configuration. In either case, the critical constraint is the same: Bolt's WebContainer cannot receive incoming HTTP traffic during development. Your webhook endpoint or polling API route only works after deploying to Netlify or Bolt Cloud. Test order processing by deploying first and placing a test order through the Magento checkout flow.

Bolt.new Prompt

Create an orders polling API route at app/api/orders/recent/route.ts that fetches orders created in the last 24 hours from Magento using my magentoApi helper. Search for orders with created_at greater than yesterday's date, sorted by created_at descending, limit 20. Return the order id, increment_id, customer_email, grand_total, status, and created_at fields. This will be called by a useRecentOrders hook every 60 seconds to show new orders in an admin dashboard without requiring Magento webhooks.

Paste this in Bolt.new chat

app/api/orders/recent/route.ts
1// app/api/orders/recent/route.ts
2import { NextResponse } from 'next/server';
3import { magentoApi } from '@/lib/magento';
4
5interface MagentoOrder {
6 entity_id: number;
7 increment_id: string;
8 customer_email: string;
9 grand_total: number;
10 status: string;
11 created_at: string;
12}
13
14interface MagentoOrdersResponse {
15 items: MagentoOrder[];
16 total_count: number;
17}
18
19export async function GET() {
20 const yesterday = new Date();
21 yesterday.setDate(yesterday.getDate() - 1);
22 const fromDate = yesterday.toISOString().split('T')[0]; // YYYY-MM-DD
23
24 try {
25 const data = await magentoApi<MagentoOrdersResponse>('/orders', {
26 params: {
27 'searchCriteria[filterGroups][0][filters][0][field]': 'created_at',
28 'searchCriteria[filterGroups][0][filters][0][value]': fromDate,
29 'searchCriteria[filterGroups][0][filters][0][conditionType]': 'gteq',
30 'searchCriteria[sortOrders][0][field]': 'created_at',
31 'searchCriteria[sortOrders][0][direction]': 'DESC',
32 'searchCriteria[pageSize]': '20',
33 'fields': 'items[entity_id,increment_id,customer_email,grand_total,status,created_at],total_count',
34 },
35 });
36
37 return NextResponse.json({ orders: data.items, total: data.total_count });
38 } catch (error) {
39 return NextResponse.json({ error: 'Failed to fetch orders' }, { status: 500 });
40 }
41}

Pro tip: Bolt's WebContainer cannot receive incoming HTTP requests from Magento's webhook system during development. If your use case requires real-time order notifications, deploy to Netlify or Bolt Cloud first, then configure Magento webhooks or polling against your deployed URL.

Expected result: Calling /api/orders/recent returns the most recent Magento orders from the last 24 hours. The admin dashboard refreshes order data every 60 seconds without requiring Magento webhook configuration.

Common use cases

Custom Product Catalog with Category Navigation

Build a performant custom product listing page that fetches from Magento's catalog REST API. Display products in a filterable grid with category navigation, price filtering, and attribute-based filtering (size, color, brand). The frontend renders faster than Magento's built-in Luma theme because it's a modern React SPA.

Bolt.new Prompt

Build a custom Magento product catalog page. Create a Next.js API route at app/api/products/route.ts that fetches products from my Magento store using the REST API endpoint GET /rest/V1/products?searchCriteria[pageSize]=24&searchCriteria[currentPage]=1. Authenticate with the MAGENTO_ACCESS_TOKEN environment variable using the Authorization: Bearer header. Return the items array. Build a React ProductGrid component that fetches from /api/products and displays products in a 3-column grid with image, name, price, and an Add to Cart button. Use MAGENTO_BASE_URL for the store URL.

Copy this prompt to try it in Bolt.new

Order Management and Fulfillment Dashboard

Build an internal dashboard that shows recent orders, allows status updates, and displays order details with line items. Pull data from the Magento Orders API, display in a sortable table, and allow operations like marking orders as shipped without logging into Magento's full admin panel.

Bolt.new Prompt

Create an order management dashboard for my Magento store. Build an API route at app/api/orders/route.ts that fetches recent orders from GET /rest/V1/orders?searchCriteria[sortOrders][0][field]=created_at&searchCriteria[sortOrders][0][direction]=DESC&searchCriteria[pageSize]=50. Display orders in a table with order ID, customer email, grand total, status, and order date. Add a status filter dropdown. Include a detail view that shows line items, shipping address, and payment method for each order. Use MAGENTO_BASE_URL and MAGENTO_ACCESS_TOKEN from .env.

Copy this prompt to try it in Bolt.new

Inventory Monitoring for Warehouse Teams

Build a real-time inventory dashboard showing product stock levels, identifying out-of-stock and low-stock items, and allowing quick quantity updates. Fetch inventory data from Magento's StockItems API and display a dashboard that warehouse teams can use on a tablet without accessing Magento's full admin.

Bolt.new Prompt

Build an inventory management view for my Magento store using the REST API. Fetch products with their stock information from GET /rest/V1/stockItems/lowStock?scopeId=1&qty=10&pageSize=50 to find low-stock items. Also fetch all products from /rest/V1/products and join with stock data. Display a dashboard showing: total products, out-of-stock count, low-stock count. Show a table with SKU, product name, current quantity, and a color-coded status badge. Allow updating stock quantity via PUT /rest/V1/products/{sku}/stockItems/1.

Copy this prompt to try it in Bolt.new

Troubleshooting

API returns 401 Unauthorized with message 'The consumer isn't authorized to access %resources'

Cause: The Magento integration's resource permissions do not include the API endpoint you're calling, or the integration has not been activated in Magento's admin panel.

Solution: Go to Magento admin → System → Extensions → Integrations → Edit your integration → check the API tab resource permissions. Make sure the integration is activated (Status: Active). Re-activate if needed by clicking the Activate link in the integrations list.

searchCriteria queries return empty items array even when products exist in Magento

Cause: Magento's search criteria syntax is strict — incorrect parameter names, wrong condition types, or missing filter group indices result in queries that match nothing rather than returning an error.

Solution: Use numeric indices starting at 0 for filter groups and filters: searchCriteria[filterGroups][0][filters][0][field]. Use conditionType values exactly as Magento documents them: eq, neq, like, in, nin, notnull, null, gt, lt, gteq, lteq, moreq, finset. Test your search criteria in Postman or curl first before integrating into Bolt.

typescript
1// Correct searchCriteria syntax — numeric indices, exact conditionType values
2'searchCriteria[filterGroups][0][filters][0][field]': 'status',
3'searchCriteria[filterGroups][0][filters][0][value]': '1',
4'searchCriteria[filterGroups][0][filters][0][conditionType]': 'eq',
5// Multiple values use 'in' conditionType with comma-separated values
6'searchCriteria[filterGroups][1][filters][0][conditionType]': 'in',
7'searchCriteria[filterGroups][1][filters][0][value]': '2,3,4',

Cart item addition fails with 'The product that was requested doesn't exist' even though the product is visible on the storefront

Cause: Cart items must be identified by SKU, not product ID. If you pass a numeric product ID instead of the string SKU, Magento returns this error. Also triggered if the product is disabled, out of stock, or not assigned to the default website.

Solution: Ensure you're using the product's sku field (a string like 'MH01-XS-Black') not its id (a number) when adding to cart. Check that the product is enabled, in stock, and assigned to the website your store is running on.

typescript
1// Use SKU, not product ID
2const cartItem = {
3 sku: product.sku, // correct: string like 'MH01-XS-Black'
4 // id: product.id, // wrong: numeric ID will cause 'product doesn't exist'
5 qty: 1,
6 quote_id: quoteId,
7};

Magento webhooks or real-time order events never reach the app during development

Cause: Bolt's WebContainer runs in the browser and has no publicly accessible URL. Any incoming HTTP connections — including webhook POST requests from Magento — cannot reach the WebContainer runtime. This is a fundamental architectural constraint of the browser-based development environment.

Solution: Deploy to Netlify or Bolt Cloud to get a public HTTPS URL, then configure Magento webhooks or your polling mechanism to use the deployed domain. For development testing of order processing logic, mock the webhook payload locally by calling your /api route handler directly.

Best practices

  • Always proxy Magento Management API calls through Next.js API routes — the admin integration token grants full store access and must never appear in client-side code or browser network requests
  • Create separate Magento integrations with minimum required permissions for development and production environments — never use an all-permissions integration token in a production app
  • Use Magento's searchCriteria with explicit field lists (fields parameter) to return only the data you need — Magento product objects can be very large, and fetching all fields slows down responses unnecessarily
  • Store guest cart quoteId values in localStorage with an expiration timestamp — Magento's guest cart sessions expire after 1 hour of inactivity by default, and stale quoteIds cause silent cart creation failures
  • Test your complete cart-to-checkout flow by deploying to Netlify or Bolt Cloud early, since Bolt's WebContainer cannot receive incoming Magento connections and some Storefront operations require your deployed domain
  • Use Magento's product SKU as the identifier throughout your app — SKUs are unique string identifiers that stay stable across catalog migrations, while numeric product IDs can change
  • For Magento sites with large catalogs (10,000+ products), implement server-side search and filtering using searchCriteria rather than fetching all products and filtering client-side

Alternatives

Frequently asked questions

How do I connect Bolt.new to Magento?

Create a Magento integration in System → Extensions → Integrations with the API resource permissions your app needs, activate it, and copy the Access Token. Add MAGENTO_BASE_URL and MAGENTO_ACCESS_TOKEN to your Bolt project's .env file. Build a Next.js API route that proxies requests to Magento's REST API using the Authorization: Bearer header. Your React components fetch data from your own /api/ routes — never directly from Magento.

Does Magento work with Bolt.new during development in the preview?

The Management API calls from Next.js API routes work fine in development — server-side routes in Bolt's WebContainer can make outbound HTTP requests to your Magento store. Direct client-side requests to Magento may encounter CORS issues. Webhook events and incoming connections from Magento cannot reach the WebContainer during development — you need to deploy to Netlify or Bolt Cloud to receive those.

Should I use Magento's REST API or GraphQL API in Bolt.new?

For admin operations (managing products, orders, inventory), use the REST API through server-side API routes. For storefront read operations (product listings, search, category browsing), Magento's GraphQL API is an alternative that's designed for client-side use and can be called directly from React without CORS issues. For most Bolt projects, REST through API routes is the simpler and more consistent approach.

Can Bolt.new receive Magento webhook events?

Not during development in Bolt's WebContainer — the browser-based runtime has no public URL and cannot receive incoming HTTP traffic. After deploying to Netlify or Bolt Cloud, your app has a public HTTPS URL you can register as a Magento webhook destination. For Adobe Commerce (cloud edition), configure webhooks in Stores → Configuration → Services → Webhooks using your deployed URL.

Is Magento or BigCommerce easier to integrate with Bolt.new?

BigCommerce is significantly easier. Its REST API is well-documented and more straightforward, it's a fully hosted SaaS platform requiring no server management, and its Storefront API provides a purpose-built client-side cart solution. Magento's REST API is more powerful but has more complex authentication, verbose searchCriteria query syntax, and requires either self-hosting or Adobe Commerce Cloud. Choose Magento if your organization already runs it; otherwise BigCommerce or Shopify reduce integration friction substantially.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.