Adobe Commerce · updated

Which GraphQL endpoints does an Adobe Commerce storefront call?

It depends on the platform. On Adobe Commerce on cloud infrastructure or on-premises there are separate schemas: the core GraphQL endpoint at https://<commerce-server>/graphql, and service endpoints such as Catalog Service. On Adobe Commerce as a Cloud Service there is one endpoint that combines them. Every request sends Content-Type: application/json, and the store view is chosen with a header, not in the address.

In plain words

A storefront asks Commerce for data by sending a question to a web address. Older set-ups have two addresses: one for the shop itself and one for the fast catalogue service. The newer cloud service has a single address for both.

Endpoints

PlatformEndpointWhat it serves
PaaS and on-premises: corehttps://<commerce-server>/graphqlThe core schema: catalogue, cart, checkout, customer and the rest
PaaS: Catalog Service, productionhttps://catalog-service.adobe.io/graphqlCatalog Service and productSearch queries
PaaS: Catalog Service, testinghttps://catalog-service-sandbox.adobe.io/graphqlThe same, for sandbox environments
Commerce as a Cloud Service, productionhttps://<region>.api.commerce.adobe.com/<tenant-id>/graphqlOne combined schema
Commerce as a Cloud Service, testinghttps://<region>-<environment>.api.commerce.adobe.com/<tenant-id>/graphqlThe same, where environment is a type such as sandbox

Adobe's overview says the PaaS schemas do not natively interact but can be integrated with API Mesh. The SaaS schema removes all deprecated queries, mutations and fields, and replaces the core products and categories queries with their service-based equivalents, which are not backward compatible with the core ones.

Headers for core GraphQL

HeaderValueWhen
Content-Typeapplication/jsonRequired for all requests
StoreThe store view code: default, or the code set when the store view was createdTo pick a store view
AuthorizationBearer, then a customer or admin tokenFor customer or admin data
Content-CurrencyA currency codeOnly when the currency is not the store view's default
X-Adobe-CompanyA company IDWhen a company user belongs to more than one company

Headers for Catalog Service

HeaderWhat Adobe says
Magento-Environment-IdThe SaaS data space ID shown in the Commerce Services Connector settings
Magento-Website-CodeThe code of the website for the active store view, for example base
Magento-Store-CodeThe code of the store for the active store view, for example main_website_store
Magento-Store-View-CodeThe code of the active store view, for example default
Magento-Customer-GroupThe customer group code, which decides discounts and tax class for prices
X-Api-KeyPaaS only. The API key generated for your Commerce environment

Adobe's storefront configuration page says Adobe Commerce as a Cloud Service does not require API keys or environment IDs in the default configuration.

Caching

For core GraphQL, Adobe says only queries submitted with an HTTP GET operation can be cached; POST queries cannot. The cached queries include products, categories, categoryList, cmsPage, cmsBlocks, route and storeConfig. Cart, customer and order queries are explicitly not cached. If a call mixes a cached and an uncached query, the cache is bypassed for all of them. Adobe's headers page shows the GET form for core GraphQL: the query goes in the address as a query parameter named query, URL-encoded where needed. Mutations must be POST requests.

Where AEM fits

  • Edge Delivery storefront: the endpoints sit in config.json as commerce-core-endpoint and commerce-endpoint.
  • AEM CIF on Cloud Service: the endpoint is the Cloud Manager environment variable COMMERCE_ENDPOINT. Adobe says it must use HTTPS and be publicly available. This applies to sites that already run CIF: Adobe says the CIF storefront is in maintenance mode and should not be used in new projects.

A core GraphQL request with curl (our example; the query is shortened from Adobe's full text search sample)

curl -X POST 'https://<commerce-server>/graphql' \
  -H 'Content-Type: application/json' \
  -H 'Store: default' \
  --data-raw '{"query":"{ products(search: \"Yoga pants\", pageSize: 2) { total_count items { name sku } } }"}'

How to find out what your storefront calls

  1. Ask which platform the shop runs on: PaaS (cloud infrastructure or on-premises) or Adobe Commerce as a Cloud Service.
  2. On an Edge Delivery storefront, open /config.json and read the two endpoint keys.
  3. On an existing AEM CIF site, ask for the COMMERCE_ENDPOINT value of the environment in Cloud Manager.
  4. Note the store view code. It is the Store header for core GraphQL and the Magento-Store-View-Code header for Catalog Service.
  5. Send one small read-only query to a test environment before wiring anything else.

Related tools and pages on this site

Questions

Does the store view go in the URL?

No. For core GraphQL it is the Store request header. For Catalog Service it is the Magento-Store-View-Code header, with the store and website codes alongside.

Can I use the core products query on Commerce as a Cloud Service?

No. Adobe's page says Adobe Commerce as a Cloud Service does not support the core products query and tells you to use the Catalog Service products query instead.

What is API Mesh for?

Adobe describes API Mesh for Adobe Developer App Builder as an orchestration layer for integrating private and third-party APIs, and says it can combine the core and Catalog Service schemas on PaaS.

Does the query builder on this site send requests?

No. It writes the query, a curl command and a fetch snippet with placeholders. You run them yourself.

Sources

Facts about Adobe's products on this page are from the linked Adobe pages, read on the date shown beside each. Explanations, steps and examples are ours unless marked as Adobe's. If Adobe's page and this one differ, Adobe's page is right.

Surge Migrate is not affiliated with Adobe and claims no Adobe partner status. Adobe product names are trademarks of Adobe.

Surge Migrate

Moving the website itself

This page answers one Adobe Commerce question. Surge Migrate moves a website from any CMS to any CMS. Converted automatically. Checked before you install.

  1. 1

    Scan

    Names the system behind your site, counts pages and templates, lists the blocks to build and the work no tool does, and gives an effort range with its working.

    Scan a site →
  2. 2

    Convert

    Each page becomes an Edge Delivery document, an AEM Core Component page and import files for 7 other systems. 10 pages free; 500 or 2,000 pages in one paid run.

    Convert your pages →
  3. 3

    Verify

    A download is offered only when its own format check passes. The report lists every field not found and every component kept as plain content. Compare old and new pages side by side.

    Parity check →
  4. 4

    Install

    You import with the target system's own tool, on your own environment. Each download's README gives the command. Your system changes only when you run it.

    How each import was tested →