Adobe Commerce GraphQL
Adobe Commerce GraphQL connector for storefront operations.
Overview
The Adobe Commerce GraphQL connector talks to the storefront GraphQL API of Adobe Commerce (formerly Magento 2). It is designed for shopper-facing operations: searching the catalog, building carts, applying shipping and payment, placing orders, and managing the logged-in customer's account.
Spojit users reach for this connector when they are building headless storefronts, AI shopping assistants, or guest-checkout automations that need to behave as if they were the shopper. Pair it with the Adobe Commerce REST connector when the workflow also needs admin-side capabilities like invoicing or shipment creation.
What You Can Do
The Adobe Commerce GraphQL connector exposes these tools:
search-products- Search the catalog by keyword, filter, and sort.get-product-detail- Fetch a product's full storefront detail including variants and media.get-categories- List the storefront category tree.get-category- Fetch a single category with its products.get-cms-page- Fetch a CMS page by identifier.get-store-config- Read storefront config (currency, locale, base URLs).get-countries- List supported countries and regions for address forms.create-cart- Create a new (guest or customer) cart and return its ID.get-cart- Fetch the current state of a cart with items and totals.add-to-cart- Add one or more items to an existing cart.set-shipping-address- Apply a shipping address to a cart.set-shipping-method- Apply a shipping method to a cart.set-payment-method- Apply a payment method to a cart.place-order- Convert a fully configured cart into an order.create-customer- Register a new storefront customer account.get-customer- Read the logged-in customer's profile.update-customer- Update the logged-in customer's profile.generate-customer-token- Exchange email and password for a customer auth token.raw-graphql- Run any GraphQL query against the storefront API for fields not covered by a dedicated tool.
Authentication
The storefront GraphQL API uses two distinct auth contexts. The connection itself authenticates as the storefront (typically an Integration access token minted in Admin -> System -> Integrations), and individual customer-scoped calls additionally require a customer token obtained via generate-customer-token.
For the connection, create an integration in Adobe Commerce admin, grant the storefront resources you need, activate the integration, and copy the access token. You also need the GraphQL endpoint URL for your store (typically https://your-store.com/graphql).
Setting Up Your Connection
- In Adobe Commerce admin, open System -> Integrations -> Add New Integration, grant the storefront resources, save and activate, then copy the access token.
- Note your GraphQL endpoint URL (usually
https://your-store.com/graphql). - In Spojit, go to Connections and click + Add Connection.
- Search for Adobe Commerce GraphQL and select it.
- Paste the endpoint URL and access token. Name the connection something descriptive (e.g.
Adobe Commerce - Production Storefront). - Click Save. Spojit calls
get-store-configto verify the connection works.
Using in a Workflow
Add a Connector node, select your Adobe Commerce GraphQL connection, and pick a mode:
- Direct Mode - Best for deterministic flows like a guest-checkout pipeline where the sequence (
create-cart->add-to-cart->set-shipping-address->set-shipping-method->set-payment-method->place-order) is fixed. - Agent Mode - Best for shopping-assistant style workflows where the AI picks tools based on the shopper's prompt (e.g. "find me a black t-shirt under $30 and add it to my cart").
For catalog browsing pages that fetch many product fields, prefer raw-graphql with a tailored query so you only return the fields you actually need.
Tips
- Reuse cart IDs. Once you have a cart ID from
create-cart, store it on the user's session and reuse it across steps - creating a new cart for every step is the most common cause of "empty cart" bugs. - Customer tokens expire. Refresh them with
generate-customer-tokenwhen calls start returning auth errors instead of treating it as a hard failure. - Use
raw-graphqlfor aggregations. Storefront GraphQL lets you fetch related categories, products, and CMS content in one round trip. - Cache
get-store-config. Currency code, locale, and base URLs rarely change - cache the result for the session. - Read country lists once.
get-countriesis large; call it once per workflow and reuse the result.
Common Pitfalls
- Storefront vs admin scope. This connector cannot create invoices, shipments, or admin records. Use Adobe Commerce REST for those operations.
- Out-of-stock variants.
add-to-cartwill fail atplace-ordertime rather than at add time if the variant becomes unavailable between steps. Handle the failure on order placement. - CORS and HTTPS. The storefront GraphQL endpoint must be reachable from Spojit's servers; private staging stores need to be exposed or IP-allowlisted.
- Currency formatting. Totals come back with a currency code and a numeric value - never assume USD.
- Guest vs customer carts. A cart created without a customer token cannot later be claimed by a logged-in customer without explicit merge logic.
Common Use Cases
- Sync Adobe Commerce Orders to NetSuite
- Build an AI Agent That Manages Your E-commerce Store
- Getting Started with E-commerce Integrations
- Create a Product Catalog Knowledge Base for AI Queries
- Manage Multi-Channel Inventory Across Stores
Related Articles
For technical API details and field specifications, see the Adobe Commerce GraphQL connector documentation.