StoreOSv0.15.0
GraphQL API

GraphQL API

What the StoreOS GraphQL API is and when to use it over REST.

What is the GraphQL API?

GraphQL is another way to call the same StoreOS backend. Instead of many REST URLs, you send one POST with a query describing exactly the fields you need.

POST https://storefront-api.storeos.dev/graphql
RESTGraphQL
StyleOne URL per action (/products, /orders)One endpoint, query in body
Package@storeos/storefront-client REST, or React SDK (gqlClient)Your own client (Apollo, urql, fetch)
Best forMost storefront appsCustom field selection, existing GraphQL stack
DocsREST · SwaggerThis section

Both expose the same catalog, auth, and orders. Data is identical — only the calling style differs.


Headers

HeaderWhat it does
Content-Type: application/jsonQuery/mutation in body
x-tenantYour store's tenant UID — every request
Authorization: Bearer <jwt>Logged-in customer — when required

What you can do (same four areas as REST)

Catalog — read products & collections

Queries: products, productById, productByHandle, collections, collection

Use for shop pages and product detail. No login required.

Queries reference

Store config — read tenant settings

Query: storeFront

Delivery charges, support info, legal policies. Use at checkout and in footer.

Queries reference

Auth — customer sign-in

Mutations: register, login, sendOtp, verifyOtpToLogin, logout
Query: me

Returns JWT accessToken — store it in your app like REST auth.

Authentication

Orders — checkout & history

Mutations: createOrder, verifyCoupon, cancelOrder
Queries: myOrders, orderDetailsById

Place orders (guest or logged-in), track by invoice UID.

Mutations · Checkout guide


Prefer less boilerplate?

Prefer the typed clients when you can:

  • REST@storeos/storefront-client (StoreFront)
  • GraphQL + React@storeos/storefront-client/react (gqlClient, providers)

TypeScript SDK · React SDK


Pages

On this page