Create a BigCommerce Storefront cart via GraphQL

domain: bigcommerce.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Obtain a Storefront API JWT token scoped to the appropriate channel (see the token generation route above) and include it as Authorization: Bearer {token} on GraphQL requests.
  2. Send a GraphQL mutation to https://store-{hash}.mybigcommerce.com/graphql using the createCart mutation, providing an input object with lineItems — each item specifying productEntityId, variantEntityId (if applicable), and quantity.
  3. The mutation returns the cart object including entityId (the cart UUID), lineItems, amount, and currencyCode — store the entityId for subsequent cart operations.
  4. To add items to an existing cart, use the addCartLineItems mutation with the cartEntityId and additional lineItems input; to update quantity use updateCartLineItem.
  5. Redirect the customer to the checkout by constructing the URL: https://{storefront-domain}/cart.php?action=loadInCheckout&id={cart-entityId} or use the redirect URLs returned by the checkout API.

Known gotchas

Related routes

Generate a BigCommerce GraphQL Storefront API token
bigcommerce.com · 5 steps · unrated
Query BigCommerce product catalog and cart data via the GraphQL Storefront API including complex variant selection and pricing
developer.bigcommerce.com · 5 steps · unrated
Build a BigCommerce headless storefront using the Catalyst framework and connect it to the GraphQL Storefront API
bigcommerce.dev · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans