Skip to main content

Documentation Index

Fetch the complete documentation index at: https://colossal.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The Storefront API is a public GraphQL endpoint for building commerce experiences. It powers the Storefront SDK under the hood, but you can also query it directly with any GraphQL client.

Endpoint

POST https://api.colossal.sh/api/v1/graphql
Authenticated with a storefront API key. Safe to call from the browser.

When to use the API directly

Most developers use the Storefront SDK (React hooks). Use the raw GraphQL API when:
  • You’re not building with React
  • You need server-side data fetching
  • You want full control over queries and caching

Available operations

AreaQueriesMutations
ProductsBrowse products, variants, pricing, and media
CartFetch cart with line itemsCreate cart, add/update/remove items
CheckoutGet checkout session detailsCreate, update, and complete checkout
OrdersView order details
StoreFetch store config by UID, slug, or domain
CustomersCreate customer records

Making requests

import { GraphQLClient } from "graphql-request";

const client = new GraphQLClient("https://api.colossal.sh/api/v1/graphql", {
  headers: {
    Authorization: `Bearer ${STOREFRONT_API_KEY}`,
  },
});

const data = await client.request(query, variables);

Mutation responses

All mutations return a consistent result type:
{
  success: Boolean!
  data: Entity
  message: String
  error_code: String
  field: String
}
Check success before using data. If success is false, inspect error_code and message for details.

Error codes

CodeDescription
NOT_FOUNDResource doesn’t exist
VALIDATION_ERRORInvalid input data
INTERNAL_ERRORServer error
An Admin API with full read/write access for server-side operations is coming soon.