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

> ## Agent Instructions
> Spree 6 (v6.x) is the current version. Pages with /v5/ in their URL document Spree 5: follow them in a project that runs Spree 5, or to see what an upgrade changes.
> Spree 6 differs greatly from Spree 4 and 5: it is fully headless, and older code and tutorials mostly do not apply. Before relying on what you remember about Spree, read https://spreecommerce.org/docs/developer/upgrades/spree-6-vs-older-versions.md
> The current REST APIs are the Store API (store.yaml), the Admin API (admin.yaml) and the Seller API (seller.yaml), all under /api/v3.
> The specs named legacy-v2-*, the Storefront API and Platform API pages and their tutorials document the older API v2, which Spree 5 and earlier serve. Read them to maintain or migrate an API v2 client, and build new work on the current APIs.

# Marketplace Seller Pages

> The opt-in seller directory, seller profiles and "Sold by" links for multi-vendor stores

## What the Seller Pages Are

On a [multi-vendor marketplace](https://spreecommerce.org/docs/developer/how-to/build-a-marketplace.md), shoppers want to see who they are buying from. The storefront ships an optional set of seller pages for that:

| Where | What it shows |
| - | - |
| `/sellers` | A paginated directory of the marketplace's sellers (24 per page, sorted by name), each as a card with logo, cover photo and about text |
| `/sellers/[slug]` | A seller's profile — cover photo, logo, name, about text, the seller's own policies (returns, shipping and so on) — followed by that seller's products, with the same filters, sorting and infinite scroll as a category page |
| Product page | A **Sold by *Seller name*** line under the product title, linking to the seller's profile. Products with no seller (the marketplace's own) show no line |
| Header, mobile menu and footer | A **Sellers** link to the directory |
| Header search | Matching sellers are suggested alongside products and categories |
| `sitemap.xml` and `llms.txt` | The directory and every seller profile, so search engines and AI agents can find them |

The seller pages are an **opt-in addon**. They are off by default; a single-vendor storefront never renders any seller UI.

> [!NOTE]
>
> The seller pages are a starting point, not a fixed feature. They read public seller data from the Store API through `@spree/sdk` (`client.sellers.list` and `client.sellers.get`), so you can restyle them, add fields, or build your own seller experience on the same calls.

## Enabling Seller Pages

Seller pages turn on through a single environment variable:

```env theme={"theme":"night-owl"}
SPREE_MARKETPLACE_ENABLED=true
```

Any other value — or leaving it unset — keeps them off. When off:

* every `/sellers` route returns a real 404,
* the header, mobile menu and footer don't link to sellers,
* product pages don't fetch the seller or show a **Sold by** line,
* header search doesn't look up sellers,
* the sitemap and `llms.txt` leave sellers out.

The variable is server-side only. Set it wherever the storefront is built and run, and redeploy after changing it — pages prerendered at build time read it then.

> [!TIP]
>
> `SPREE_MARKETPLACE_ENABLED` only controls what the storefront displays. Sellers, split checkout, commissions and payouts all live in the Spree backend — see [Build a Multi-Vendor Marketplace](https://spreecommerce.org/docs/developer/how-to/build-a-marketplace.md) to set those up.

## Which Sellers Appear

The storefront shows whatever the Store API returns, and the Store API only returns sellers that can trade:

* **Approved** sellers appear in the directory and have a profile page.
* Sellers still **onboarding**, **suspended**, **rejected**, or **on holiday** are left out of the directory, and their profile URL returns a 404.
* A seller's product listing shows only their **active** products — drafts, proposals awaiting review and rejected listings stay hidden, exactly as on the rest of the storefront.

See [Sellers](https://spreecommerce.org/docs/developer/core-concepts/sellers.md) for the seller lifecycle.

## Checkout and Order History

Nothing needs switching on for checkout. A basket can hold products from several sellers, and the customer checks out once. When the cart reaches more than one seller, completing it produces an **order group** — one order per seller under a single purchase — and the storefront already handles both shapes:

* the order-placed page and confirmation work for a single order or a group,
* **Account → Orders** shows a group as one row (one purchase), not one row per seller,
* the order detail page lists each seller's part of the purchase.

This is independent of `SPREE_MARKETPLACE_ENABLED`: the checkout handles order groups whether or not seller pages are shown.

## Caching

Seller data is cached like the rest of the catalog:

| Data | Cache tags | Lifetime |
| - | - | - |
| Seller directory and profiles | `sellers`, `seller:<slug>` | 10 minutes |
| A seller's product listing | `products`, `seller-products:<id>` | 10 minutes |

Product webhooks (`product.*`, delivered to the storefront's `/api/webhooks/spree` endpoint — see `.env.example` for the event list) expire product lists, so a listing approved or taken down reaches the seller's page right away. Changes to a seller's own profile — name, logo, about text, policies — appear when the 10-minute cache expires.

## Customizing

| File | What it does |
| - | - |
| `src/lib/spree/config.ts` | `isMarketplaceEnabled()` — the switch every seller entry point checks |
| `src/lib/data/sellers.ts` | Server actions and cached fetches: `getSellers`, `getSeller`, `getSellerProducts` |
| `src/app/[country]/[locale]/(storefront)/sellers/page.tsx` | The `/sellers` directory |
| `src/app/[country]/[locale]/(storefront)/sellers/[slug]/page.tsx` | The seller profile and product listing |
| `src/components/sellers/SellerCard.tsx` | A seller's card in the directory |
| `src/components/sellers/SellerHeader.tsx` | The profile header: cover photo, logo, about text and policies |
| `messages/*.json` (`sellers` namespace) | Seller page copy in every shipped language |

To show more about a seller, add the field to `SELLER_CARD_FIELDS` in `src/lib/data/sellers.ts` (the directory requests only the fields a card needs, to keep the cached payload small) or to the `expand` list on the profile page, then render it in the component.

If you build your own storefront, the same data is available from any Store API client:

```ts theme={"theme":"night-owl"}
import { createClient } from '@spree/sdk'

const client = createClient({
  baseUrl: process.env.SPREE_API_URL,
  publishableKey: process.env.SPREE_PUBLISHABLE_KEY,
})

// Directory
const { data: sellers } = await client.sellers.list({ sort: 'name', limit: 24 })

// Profile, with the seller's policies
const seller = await client.sellers.get('acme-goods', { expand: ['policies'] })

// The seller's products
const { data: products } = await client.products.list({ seller_id_eq: seller.id })
```

## Related

* [Build a Multi-Vendor Marketplace](https://spreecommerce.org/docs/developer/how-to/build-a-marketplace.md) — setting up sellers, commissions and payouts on the backend
* [Sellers](https://spreecommerce.org/docs/developer/core-concepts/sellers.md) — the seller model, lifecycle and order splitting
* [Environment Variables](https://spreecommerce.org/docs/developer/storefront/nextjs/environment-variables.md) — every variable the storefront reads


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.