Dev

GraphQL Storefront API

Build headless storefronts with the CloudCart Storefront GraphQL API.

The Storefront API is a public-facing GraphQL API for building custom storefronts, mobile apps, and other customer-facing experiences. It powers Nitrogen storefronts and is designed to be safe to call from the browser: it exposes only what a customer is allowed to see.

Endpoint

POST https://{shop}.cloudcart.com/api/sf

Authentication

Two token types, used together:

TokenHeaderIdentifies
Storefront Access TokenX-Storefront-Access-TokenYour storefront app (required on every request)
Customer JWTAuthorization: Bearer …The logged-in customer (only for account operations)
X-Storefront-Access-Token: YOUR_STOREFRONT_TOKEN
Content-Type: application/json

Where do I get a storefront token?

Each Nitrogen storefront gets its own API tokens and environment configuration, managed in Admin → Nitrogen → Storefront Settings. If you use the Nitrogen CLI, cloudcart nitrogen env pull writes the token into your .env — you never handle it manually.

Storefront token ≠ Admin credentials

The storefront token is scoped to public catalog data and cart operations. It cannot read other customers' data or modify your store — that's what makes it safe to ship in client-side code. Admin work belongs to the Admin API.

First query

curl -X POST https://mystore.cloudcart.com/api/sf \
  -H "X-Storefront-Access-Token: $STOREFRONT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ products(first: 3) { edges { node { id title } } } }"}'

What's in this section

  • Nitrogen — the fastest way to a production storefront on this API
  • Dev MCP Server — schema-validated GraphQL from your AI assistant (Storefront schema support coming soon)

On this page