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/sfAuthentication
Two token types, used together:
| Token | Header | Identifies |
|---|---|---|
| Storefront Access Token | X-Storefront-Access-Token | Your storefront app (required on every request) |
| Customer JWT | Authorization: Bearer … | The logged-in customer (only for account operations) |
X-Storefront-Access-Token: YOUR_STOREFRONT_TOKEN
Content-Type: application/jsonWhere 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
- Products & Browsing — catalog queries, images, prices, cursor pagination
- Cart & Checkout — the stateless cart and checkout hand-off
- Customer Accounts — JWT auth for orders and addresses
- Error Handling — GraphQL error shape and retry guidance
Related
- 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)