> ## Documentation Index
> Fetch the complete documentation index at: https://docs.colossal.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> The Storefront API. A public GraphQL endpoint for products, cart, checkout, and orders.

The Storefront API is a public GraphQL endpoint for building commerce experiences. It powers the [Storefront SDK](/react-sdk/overview) 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-sdk/overview) (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

| Area                                  | Queries                                       | Mutations                             |
| ------------------------------------- | --------------------------------------------- | ------------------------------------- |
| [Products](/api-reference/products)   | Browse products, variants, pricing, and media |                                       |
| [Cart](/api-reference/cart)           | Fetch cart with line items                    | Create cart, add/update/remove items  |
| [Checkout](/api-reference/checkout)   | Get checkout session details                  | Create, update, and complete checkout |
| [Orders](/api-reference/orders)       | View order details                            |                                       |
| [Store](/api-reference/store)         | Fetch store config by UID, slug, or domain    |                                       |
| [Customers](/api-reference/customers) |                                               | Create customer records               |

## Making requests

```ts theme={null}
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:

```graphql theme={null}
{
  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

| Code               | Description            |
| ------------------ | ---------------------- |
| `NOT_FOUND`        | Resource doesn't exist |
| `VALIDATION_ERROR` | Invalid input data     |
| `INTERNAL_ERROR`   | Server error           |

<Info>
  An **Admin API** with full read/write access for server-side operations is coming soon.
</Info>
