# Acme Store for developers

Acme Store is a demonstration shop that people and agents share: eighteen products, search, collections, a cart and a sandbox checkout, with an open API and MCP server.

Call the same operations over plain HTTP, as MCP tools, or from a page through WebMCP. The base URL is `https://acme.ferrite.run`.

## Quickstart

Read something first. This request needs no setup:

```sh
curl -s 'https://acme.ferrite.run/api/products'
```

Search product titles, descriptions and tags, ignoring case. Use it first to find a product's handle; without q it lists the whole catalogue. Returns each product's handle, title, description, price range, availability and page.

Then change something. Send an `idempotency-key` so a retry cannot run twice:

```sh
curl -s -X POST 'https://acme.ferrite.run/api/cart/items' \
  -H 'content-type: application/json' \
  -H 'idempotency-key: add_to_cart-1' \
  -d '{"variant_id":"acme-mug-variant-1"}'
```

To use Acme Store from an AI assistant, add its MCP server:

```sh
claude mcp add --transport http acme https://acme.ferrite.run/mcp
```

## Authentication and API keys

No API key, account or sign-up is needed: the API is keyless, so the first request you send can be a real one.

## Sandbox

The public address is the sandbox. No payment is taken and nothing is shipped, so every read and write is safe to try, including a whole order. Each call to add_to_cart without a cart_id opens a cart of its own, and cancel_order returns an order's stock. Use a made-up name and an address such as `ada@example.com`.

The [sandbox page](/sandbox) is the place to start.

## Endpoints

| Operation | Request | What it does |
| --- | --- | --- |
| `search_products` | `GET /api/products` | Search product titles, descriptions and tags, ignoring case. Use it first to find a product's handle; without q it lists the whole catalogue. Returns each product's handle, title, description, price range, availability and page. |
| `get_product` | `GET /api/products/{handle}` | Read one product with its options and variants. Use it before add_to_cart, which needs the id of one variant. Returns the product with every variant's id, options, price and availability, plus related products. |
| `list_collections` | `GET /api/collections` | List the shop's collections, such as shirts, headwear and drinkware. Use it to see what the shop sells before reading one collection. Returns each collection's handle, title, description and page. |
| `list_collection_products` | `GET /api/collections/{handle}/products` | List the products in one collection. Use it when somebody asks for a kind of product rather than a name. Returns the collection and its products in the same short form as search_products. |
| `get_cart` | `GET /api/cart` | Read a cart and what it would cost. Use it to check the lines before place_order. Returns the cart with its lines, quantities and totals, or a null cart when no open cart matches. |
| `add_to_cart` | `POST /api/cart/items` | Put one unit of a variant in a cart. Use it after get_product has given you the variant id, and keep cart.id from the answer for the next call. Returns the whole cart, or an error when the variant is unknown or out of stock. |
| `update_cart_item` | `POST /api/cart/items/update` | Set how many units of a variant a cart holds. Use it to buy several of one thing, or to take a line out with quantity 0. Returns the whole cart, or an error when there is not that much stock or no open cart. |
| `place_order` | `POST /api/orders` | Turn a cart into an order. Use it once get_cart shows what the customer wants; the checkout is a sandbox, so no payment is taken and nothing is shipped. Returns the order with its number, totals and confirmation_path, or an error when the cart is empty or the stock is gone. |
| `cancel_order` | `POST /api/orders/{order_id}/cancel` | Cancel a sandbox order and put its stock back. Use it to undo place_order; the order stays on record with its original prices. Returns the cancelled order, or a 403 problem when the receipt key does not match. |

The [OpenAPI 3.1 document](/openapi.json) describes every parameter and response. The MCP server at `https://acme.ferrite.run/mcp` exposes the same operations as tools with the same names.

## Example requests

### `search_products`

```sh
curl -s 'https://acme.ferrite.run/api/products'
```

### `get_product`

```sh
curl -s 'https://acme.ferrite.run/api/products/acme-mug'
```

### `list_collections`

```sh
curl -s 'https://acme.ferrite.run/api/collections'
```

### `list_collection_products`

```sh
curl -s 'https://acme.ferrite.run/api/collections/shirts/products'
```

### `get_cart`

```sh
curl -s 'https://acme.ferrite.run/api/cart'
```

### `add_to_cart`

```sh
curl -s -X POST 'https://acme.ferrite.run/api/cart/items' \
  -H 'content-type: application/json' \
  -H 'idempotency-key: add_to_cart-1' \
  -d '{"variant_id":"acme-mug-variant-1"}'
```

### `update_cart_item`

```sh
curl -s -X POST 'https://acme.ferrite.run/api/cart/items/update' \
  -H 'content-type: application/json' \
  -H 'idempotency-key: update_cart_item-1' \
  -d '{"quantity":2,"variant_id":"acme-mug-variant-1"}'
```

### `place_order`

```sh
curl -s -X POST 'https://acme.ferrite.run/api/orders' \
  -H 'content-type: application/json' \
  -H 'idempotency-key: place_order-1' \
  -d '{"email":"ada@example.com","name":"Ada Example"}'
```

## Conventions

- Rate limits: every response carries `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`. A `429` also carries `Retry-After`, in seconds.
- Errors: refusals are RFC 9457 `application/problem+json` with a stable `type`, a `detail` written to be read, and a `hint` when there is a next step.
- Retries: repeat the same `idempotency-key` on a write and you receive the first result again.
- Versioning: this is version 0.1.0. A change that would break a caller is announced with `Deprecation` and `Sunset` headers at least 90 days ahead.
- Markdown: add `.md` to a page path, or send `Accept: text/markdown`.

## Machine-readable descriptions

- [llms.txt](/llms.txt): orientation for agents
- [OpenAPI](/openapi.json): operations and schemas
- [Agent skills](/.well-known/agent-skills/index.json): installable instructions
- [Agentic Resource Discovery](/.well-known/ard.json): the catalogue of everything here
- [Pricing](/pricing.md)

Questions: see the [contact page](/contact).
