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.
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.
The mutation returns the cart object including entityId (the cart UUID), lineItems, amount, and currencyCode — store the entityId for subsequent cart operations.
To add items to an existing cart, use the addCartLineItems mutation with the cartEntityId and additional lineItems input; to update quantity use updateCartLineItem.
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
GraphQL cart mutations require a Storefront API token; they cannot be called with server-side REST API credentials — the two auth systems are distinct.
The variantEntityId is required when a product has options/variants; omitting it when the product has variants will return a validation error.
Carts created via the Storefront GraphQL API are ephemeral and expire; check current BigCommerce documentation for the default cart expiry period for your plan.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp