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

# Quickstart

> From zero to a working cart + checkout link in five minutes.

By the end of this page you'll have:

1. Minted a Storefront Access Token in the dashboard.
2. Listed products via the public API.
3. Created a cart, added a line item, and produced a Stella-hosted
   checkout URL your customer can pay on.

Total time: \~5 minutes. No SDK required — `curl` is enough.

<Note>
  These examples target the staging environment at
  `https://api-dev-app.stella-commerce.com`. Once production is live
  the host will switch to `https://api.stella-commerce.com`.
</Note>

## Step 1 — Mint a Storefront Access Token

In the [Stella dashboard](https://dev-app.stella-commerce.com), navigate
to **Settings → Storefront access tokens** and click **Create token**.

* Give it a name (`local-dev` or `kasa-prod`).
* Add the origins your storefront will call from (e.g.
  `https://kasa.com`, `http://localhost:3000`). Origin enforcement is
  active when this list is non-empty.
* Hit **Create**.

The token is shown **once** in a reveal modal as `stk_live_…`. Copy it
now — Stella stores only the hash.

You'll also need your `site_id` (visible on the same page; example:
`kasa`).

## Step 2 — List products

```bash theme={null}
curl -H "X-Site-ID: kasa" \
     -H "X-Stella-Token: stk_live_..." \
     https://api-dev-app.stella-commerce.com/api/storefront/products
```

Response shape (truncated):

```json theme={null}
{
  "items": [
    {
      "id": "01HXYZ...",
      "title": "Sherpa Beanie",
      "handle": "sherpa-beanie",
      "price": 950.00,
      "currency": "NPR",
      "variants": [
        { "id": "01HXYZ...A", "title": "Blue", "inventory": 6 }
      ]
    }
  ],
  "next_cursor": null
}
```

Pick a `variant.id` you want to add to the cart.

## Step 3 — Create a cart and add an item

Cart creation is a POST with no body. The returned `id` is the cart
identifier you'll reference in subsequent calls.

```bash theme={null}
curl -X POST \
     -H "X-Site-ID: kasa" \
     -H "X-Stella-Token: stk_live_..." \
     https://api-dev-app.stella-commerce.com/api/storefront/cart
```

```json theme={null}
{ "id": "cart_01HXYZ...", "items": [], "subtotal": 0, "currency": "NPR" }
```

Add a line item. The `Idempotency-Key` header makes this safe to retry —
Stella replays the cached response on duplicate keys.

```bash theme={null}
curl -X POST \
     -H "X-Site-ID: kasa" \
     -H "X-Stella-Token: stk_live_..." \
     -H "Idempotency-Key: $(uuidgen)" \
     -H "Content-Type: application/json" \
     -d '{"variant_id": "01HXYZ...A", "quantity": 1}' \
     https://api-dev-app.stella-commerce.com/api/storefront/cart/cart_01HXYZ.../items
```

```json theme={null}
{
  "id": "cart_01HXYZ...",
  "items_count": 1,
  "subtotal": 950.00,
  "checkout_url": "https://checkout-dev-app.stella-commerce.com/c/chk_..."
}
```

## Step 4 — Redirect to checkout

Take the `checkout_url` from the response above and redirect the
customer's browser to it. Stella's hosted checkout SPA handles
shipping, payment (Stripe Payment Element), and confirmation. On
success, an `order.created` webhook fires (see
[Webhooks](/concepts/webhooks)).

```javascript theme={null}
// In your storefront code:
window.location.href = cart.checkout_url
```

That's the full path from "merchant signs up" to "customer pays."

## What's next

<CardGroup cols={2}>
  <Card title="Customer accounts" icon="user" href="/auth/customer-token">
    Add login, address book, and order history with the Customer
    Account API.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/concepts/webhooks">
    Wire your fulfillment/email/analytics systems to Stella events.
  </Card>

  <Card title="Agent capability" icon="robot" href="/auth/agent-token">
    Let AI agents act on a customer's behalf, scoped and audited.
  </Card>

  <Card title="Full API reference" icon="code" href="/api-reference">
    Every endpoint, every parameter, with try-it-out playground.
  </Card>
</CardGroup>
