# Agent guide — buying at GoodGoods.cz

Audience: autonomous AI agents and the developers who build them. It describes how to search the
catalogue, build a basket and place a real, legally binding order on behalf of a human buyer.

## 1. What this is

GoodGoods.cz is a Czech e-shop that ships across the European Union.

- **Prices are returned as configured by the shop; see `commerce_policy.prices_include_vat` in
  `get_shop_info`.** Tax is computed by the shop. Never recompute, add or strip tax yourself — use
  the amounts returned by the API.
- **Languages:** `cs`, `sk`, `pl`, `de`, `en`. **Currencies:** `CZK`, `EUR`, `PLN`. Catalogue tools
  accept `language` and `currency` arguments; for a basket both are fixed at creation time.
- **Delivery:** anywhere a carrier is available. Country availability follows the carrier list, not
  the buyer's residence.
- **Seller identity, legal documents and dispute resolution** are returned by `get_shop_info` and
  repeated in every preview and order result.

Two equivalent interfaces expose the same operations; both are serializations of one internal tool
layer, so nothing exists in one and not the other.

**MCP server** — Streamable HTTP at `https://goodgoods.cz/mcp`.

- Supported protocol revisions: **`2026-07-28`** (stateless: no `initialize`, no sessions; mandatory
  `server/discover`; every request carries `_meta."io.modelcontextprotocol/protocolVersion"` and
  the `MCP-Protocol-Version`, `Mcp-Method`, `Mcp-Name` headers must match the body) and the legacy
  revisions **`2025-11-25`**, **`2025-06-18`**, **`2025-03-26`** (classic `initialize` →
  `notifications/initialized` handshake).
- Responses are **always `application/json`** — no SSE, no sessions. An `Mcp-Session-Id` header is
  tolerated and ignored; the server never issues one.
- `POST` only. `GET` and `DELETE` return `405`. `Origin` is validated (`403` on mismatch).
- With no session, **basket state is an explicit opaque handle**: `basket_id` (`bsk_…`), passed as
  a tool argument on every basket call.
- Resources: `goodgoods://guide`, `goodgoods://guide/cs`, `goodgoods://shop-info`,
  `goodgoods://legal/{terms|privacy|withdrawal|complaints|shipping}`, `goodgoods://product/{id}`.
  Prompts: `find_and_buy`, `track_order`.
- Skill `goodgoods-shopping` (MCP skills extension `io.modelcontextprotocol/skills`, SEP-2640): a
  short working procedure for buying here, with this guide as `references/agent-guide.md`. Clients
  with the extension load it via `skills/list` → `skills/get`
  (`uri: skill://goodgoods-shopping/SKILL.md`); any other client reads the same files via
  `resources/read` (`skill://goodgoods-shopping/SKILL.md`, listed in `resources/list`). Public, no
  key needed.

**REST API** — `https://goodgoods.cz/agent/v1`, described by OpenAPI 3.1 at `https://goodgoods.cz/agent/openapi.json`. Same operations, HTTP
verbs and status codes. A generic fallback `POST https://goodgoods.cz/agent/v1/tools/{name}` accepts any tool by name
with a JSON object of arguments.

**Discovery** — `https://goodgoods.cz/.well-known/agent-commerce.json` lists protocols, endpoints, capabilities, limits, legal links
and the operator contact; `https://goodgoods.cz/llms.txt` points here from its `## For AI agents` section.
All endpoints live under `https://goodgoods.cz`. Every HTML page also carries `<link rel="alternate">` tags
and an HTTP `Link` header pointing to the manifest, this guide and `llms.txt`.

**In the browser (WebMCP)** — every shop page registers the same tools through
`document.modelContext` (WebMCP), so an agent browsing the site sees them immediately, without
anyone configuring a server. The in-page tools call the MCP endpoint above, therefore a `basket_id`
created in the page works in a direct MCP session and vice versa. Two extras exist only in the page:
`get_current_page` (which product or category the browser is showing) and, on both sides,
`get_agent_access` (how to connect directly: MCP URL, REST, OpenAPI, guide, API keys). Prefer the
direct MCP server for anything longer than a single page visit.

## 2. Identity and limits

- **No key needed to browse.** Anonymous agents may browse *and* complete an order. Rate limit **120
  requests/minute per IP**.
- **API key (optional):** `Authorization: Bearer ggak_…`, issued by the shop on request. It gives a
  higher rate limit (600/min by default), a stable principal that owns its baskets, and access to
  **cash on delivery**. Keys carry scopes: `catalog`, `basket`, `checkout`, `orders`.
- **Web Bot Auth:** sign requests per RFC 9421 and send a `Signature-Agent` header; the signature
  is verified (Ed25519, JWKS fetched from your host) and you are recognised automatically as
  principal `wba:<host>` — no registration needed. A verified signature **identifies** you, it does
  **not** authorise you: you get a name in the shop's audit trail and a stable principal, but the
  same scopes and the same rate limit as an anonymous caller. Anything that needs the shop's trust
  (**cash on delivery**, a higher rate limit, machine payment rails reserved for identified agents)
  requires an API key issued by the shop.
- **429** responses carry `Retry-After` (seconds) and `details.retry_after`. Back off; do not retry
  faster.
- **`Idempotency-Key: <uuid>`** is accepted on REST writes. Use it on `POST …/order` and other
  non-GET calls so a network retry cannot create a second order. In MCP the same role is played by
  `preview_token` (order placement) and by the MPP challenge id.
- **Defaults:** basket TTL **72 h**, max **30** lines per basket, max **50** units per line, preview
  token **15 min**, handoff link **15 min**, MPP challenge **15 min**. The values actually in force
  are published in `https://goodgoods.cz/.well-known/agent-commerce.json` and in `get_shop_info`
  (`commerce_policy.agent_purchase_limits`).

## 3. Recommended purchase flow

MCP tool → REST equivalent.

1. **Find the product** — `search_products` → `GET https://goodgoods.cz/agent/v1/catalog/search` (`query`, `page`,
   `limit`, `category_id`, `in_stock_only`, `language`, `currency`). Never invent product ids; take
   them from search, `list_categories` or a product URL.
   *Filters and sorting:* narrow the result set with `price_min` / `price_max` (in the currency of
   the request, on the same basis as `product.price.amount`, i.e. VAT included), `brand`
   (manufacturer name, case-insensitive; an unknown brand returns zero results), `category_id` and
   `in_stock_only`; order it with `sort` = `relevance` (default), `price_asc`, `price_desc`,
   `name_asc` or `newest`. `total` is the count **after** filtering and the response echoes what
   was applied in `filters`. If the query names a product type that is also a shop category, the
   results are narrowed to that category automatically — `filters.category_auto` tells you which
   one and how many other matches were left out; pass `category_id` to search elsewhere. A
   `category_id` with no matches is dropped and reported in `filters.category_ignored`.
   *Product type:* results are restricted to goods that really **are** the product type named by
   the query — goods that only mention it (accessories "for" it, parts, cases) are left out.
   `filters.type_filter` (`kept`, `dropped`, `dropped_heads`) tells you how many were left out and
   **what they are called** (e.g. "letka", "končík"). They are not unavailable, they are a
   different product type: if the customer wants them, search for them by their own name. When the
   query names a target ("arrows for a crossbow"), only goods for that target pass
   (`type_filter.qualifier`).
   *Quoting a price:* use `price_range` (cheapest and most expensive of the WHOLE matching set,
   with `cheapest_id`/`cheapest_name`) — the cheapest item is often not on the first page. Use `fields: full` when you also need the category list of each
   product (`compact`, the default, leaves it out to save context). `page` is capped at 200 —
   refine the query instead of paging through the catalog.
2. **Read the detail** — `get_product` → `GET https://goodgoods.cz/agent/v1/catalog/products/{product_id}` (also
   accepts `reference` or `url`). Check `availability.state`, `min_quantity`, `requires_variant`
   and **`agent_purchasable`** — `false` means the item cannot be ordered through this channel and
   needs `hosted_checkout`.
   *Shipping before an address:* when the customer asks "how much is delivery to Germany?", answer
   with `estimate_shipping` → `GET https://goodgoods.cz/agent/v1/shipping/estimate`. Pass `country` (ISO 3166-1
   alpha-2) and either `basket_id`, or `items` (`[{product_id, quantity}]`), or the `product_id` +
   `quantity` shortcut; `zip` is optional and is only validated against the postcode format of the
   country. You get back the carriers that can really take this order to that country, each with
   `price` (VAT included, in the currency of the request), `delay`, `is_free` and
   `requires_pickup_point`, plus a `note` for the customer in their language. The prices are
   **indicative**: quote them as such and confirm them with `get_shipping_options` once the
   delivery address is set. This call is deliberately cheap to use but expensive for the shop, so
   it has its own limit of **20 requests/minute per caller** (429 with `Retry-After` above it), at
   most **20** `items` with up to **50** units each, and the answer for an `items` estimate is
   cacheable for **5 minutes** (`Cache-Control: public, max-age=300`) — reuse it instead of asking
   again for the same country and items.

3. **Create the basket** — `create_basket` → `POST https://goodgoods.cz/agent/v1/baskets` with `language`,
   `currency`; you get `basket_id`, `expires_at` and `next_steps`. One basket per purchase.
4. **Add items** — `add_to_basket` → `POST https://goodgoods.cz/agent/v1/baskets/{basket_id}/items` with
   `product_id`, `quantity`, optional `combination_id`. For a product with variants the call fails
   with `variant_required` (422) and `details` lists the combinations with attributes, prices and
   stock — pick one and repeat. Edit with `update_basket_item` (`quantity: 0` removes) or
   `remove_basket_item`; re-read with `get_basket`.
   *Discount codes:* if the customer has one, apply it with `apply_discount_code` →
   `POST https://goodgoods.cz/agent/v1/baskets/{basket_id}/discounts` (`code`) and drop it again with
   `remove_discount_code` → `DELETE https://goodgoods.cz/agent/v1/baskets/{basket_id}/discounts/{code}` (the code is
   one URL segment, so percent-encode it). Both return the recalculated basket: the reduction is in
   `totals.discounts` and the list of applied codes in `discounts_applied`. Never guess codes — use
   only what the customer gave you. **Every** rejected code — unknown, expired, out of quota or not
   combinable — fails with the same `discount_invalid` (422) and the same generic message, on
   purpose: differing reasons would let codes be guessed. The only distinct answers are „already
   applied" and „discount codes are not available in this shop". Repeated failures are rate limited
   (**10 rejected attempts/minute**, then 429), so never iterate over candidate codes. Automatic
   shop promotions appear in `discounts_applied` without a `code` and cannot be removed.
5. **Set the customer** — `set_customer` → `PUT https://goodgoods.cz/agent/v1/baskets/{basket_id}/customer`:
   `email`, `first_name`, `last_name`, `address` (`street`, `city`, `zip`, `country` ISO2, plus
   `state` where the country has states), optional `invoice_address`, `phone` (required for cash on
   delivery and pickup points), `buyer_type` (`consumer` | `business`; business requires
   `company_id`), optional `agent_cc_email` for your own copy.
   - **`buyer_type: business` (plus `company_id`) removes the statutory 14-day consumer right of
     withdrawal.** Send it ONLY when the customer is genuinely buying for their business under a
     company ID. Delivery to a workplace, a company address or a company name on the label does
     NOT make someone a business buyer — keep `consumer` and put the company in `company` only.
     If you are unsure, ask; in case of doubt `consumer` applies.
   - `preview_order` then shows `disclosure.buyer_type` and `disclosure.withdrawal.applies_to_buyer`
     (`false` = the buyer has no right of withdrawal), and the summary says so in words. **The e-mail must be the buyer's
   own** (see §5). An e-mail that also has a registered account does not block the purchase: the
   order is placed as a guest order and you get the warning `email_registered` (it will not show
   up in that account's history; track it with `get_order` by reference + e-mail). An agent never
   takes over an existing account — if the customer wants to order under it, use `get_handoff_link`. Handoff also works for a basket without a
   customer; the human fills in the address in the web checkout.
6. **Choose delivery** — `get_shipping_options` → `GET https://goodgoods.cz/agent/v1/baskets/{basket_id}/shipping-options`;
   each option has `carrier_id`, `name`, `delay`, `price` and `requires_pickup_point`. Where a pickup
   point is required, call `search_pickup_points` (`GET https://goodgoods.cz/agent/v1/pickup-points`; city/ZIP `query`
   or `lat`/`lng`), then `set_shipping` (`PUT https://goodgoods.cz/agent/v1/baskets/{basket_id}/shipping`) with
   `carrier_id` and `pickup_point_id`.
   Before a customer exists, `estimate_shipping` (step 2) answers the same question for a country
   only — it never replaces this step, because only the real address decides the final price.

7. **Choose payment** — `get_payment_options` → `GET https://goodgoods.cz/agent/v1/baskets/{basket_id}/payment-options`.
   Unavailable methods come back with `available: false` and an `unavailable_reason`. See §4.
8. **Preview the order** — `preview_order` → `POST https://goodgoods.cz/agent/v1/baskets/{basket_id}/preview` with
   `payment_method`. Returns `preview_token` (15 min), `totals` including VAT, delivery and payment
   fee, `seller`, the statutory `disclosure` block and `display_to_user`.
9. **Include `display_to_user.text` in your reply to the human.** It is the "order with obligation
   to pay" statement in the basket language: quote it as returned (do not paraphrase or translate it).
   The buyer's instruction to purchase, given in the conversation, is sufficient authority — you do
   not need to ask them to confirm a second time. Ask only when you have no purchase instruction at all.
10. **Place the order** — `place_order` → `POST https://goodgoods.cz/agent/v1/baskets/{basket_id}/order` with
    `preview_token`, the same `payment_method`, `confirm: true` (the buyer asked you to buy) and
    `agree_terms: true`. `presented_to_user` and `email_belongs_to_buyer` are optional recorded
    declarations — set them when true. A basket changed since the preview yields
    `basket_changed`: preview again and include the new text in your reply.
11. **Handle the result** — `status` is one of:
    - `order_placed` — `order` carries `reference`, `order_token`, `total`, `status`. Store
      `reference` **and** `order_token`; together they open `get_order` without the buyer's e-mail.
    - `payment_required` — MPP challenge, see §4.
    - `handoff` — `handoff.url` must be opened by the human; no order exists yet.

*Ending without an order:* when the conversation stops before `place_order` — the customer wants to
think it over, the shop or the payment method needs a human, or you simply run out of turns — call
`send_handoff_link` → `POST https://goodgoods.cz/agent/v1/baskets/{basket_id}/handoff/send`. The shop e-mails the
customer a single-use link to the prepared basket, valid for 24 hours, and you get back
`{sent, expires_at, remaining}` — **never the URL itself**, because that link belongs to the human
and not to you. Call it **only on the customer's explicit request** ("mail it to me", "I will finish it tonight")
and pass `customer_requested: true` — a recorded declaration that a human asked for it. Without it
the call fails with 422. Never send it on your own initiative, as a reminder, or to re-engage a
customer who went quiet: an unsolicited e-mail is unlawful commercial communication.
It requires `set_customer` first (that is where the address of the e-mail comes
from; without it you get `customer_required`, 409) and is limited to three e-mails per RECIPIENT
per 30 days (`recovery_mail_limit`, 429 — a new basket does not reset it). It places no order and
charges nothing. Use `get_handoff_link`
instead when the customer is right there and can open the link immediately.

### MCP `tools/call` (revision 2025-11-25)

```http
POST https://goodgoods.cz/mcp
Content-Type: application/json
Accept: application/json
MCP-Protocol-Version: 2025-11-25
```

```json
{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": {
    "name": "add_to_basket",
    "arguments": { "basket_id": "bsk_…", "product_id": 1421, "quantity": 1 }
  }
}
```

The result carries a readable `content[0].text` plus the machine payload in `structuredContent` —
the same JSON the REST endpoint returns.

### MCP `server/discover` (revision 2026-07-28)

```http
POST https://goodgoods.cz/mcp
Content-Type: application/json
MCP-Protocol-Version: 2026-07-28
Mcp-Method: server/discover
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "server/discover",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}
```

The response returns `serverInfo`, `instructions` and the tool/resource/prompt inventory with
`resultType`, `ttlMs` and `cacheScope`. Honour `ttlMs`; do not poll `tools/list` every turn.

### REST order placement

```bash
curl -sS -X POST "https://goodgoods.cz/agent/v1/baskets/bsk_…/order" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b7e-6d2a-4c1f-9d0a-2b7e6f1c2b7e" \
  -H "Authorization: Bearer ggak_…" \
  -d '{
        "preview_token": "prv_…",
        "payment_method": "bank_transfer",
        "confirm": true,
        "agree_terms": true,
        "presented_to_user": true,
        "email_belongs_to_buyer": true,
        "customer_note": "Please ring the bell."
      }'
```

## 4. Payment methods

| id | kind | what happens |
|---|---|---|
| `card_online` | human payment | The order **is created** and you receive `payment.url` — a Comgate payment page (card, Apple Pay, Google Pay) with an expiry. Give the link to the buyer; you cannot pay it yourself. |
| `bank_transfer` | instructions | The order **is created** and awaits payment. You receive IBAN, variable symbol, amount and an **SPD string** you may render as a QR code. The shop also e-mails the instructions to the buyer. |
| `cash_on_delivery` | instructions | Identified agents only (API key; the shop does not offer it to anonymous agents). Phone number required. The fee is shown in `preview_order` and included in the total. |
| `hosted_checkout` | handoff | **No order is created.** You receive a one-time handoff URL valid **15 minutes** that opens the prepared basket in the shop's web checkout. Give it only to the person you act for; do not log it, do not share it, do not open it yourself. Used for card/PayPal when a human must finish, and for anything marked `requires_human_checkout`. |
| `mpp` | machine | Machine Payments Protocol (`draft-httpauth-payment`). Placement returns **HTTP 402** with `WWW-Authenticate: Payment id=… realm=… method=… intent=… expires=… request=…`. Retry the same request with `Authorization: Payment <credential>`, or call `pay_order` with `payment_credential`. **Availability depends on the shop enabling a payment rail** — check `get_payment_options` and `protocols.mpp.methods` in `https://goodgoods.cz/.well-known/agent-commerce.json` before designing a flow around it. Some rails are reserved for identified agents; an anonymous caller then sees `available: false` with `unavailable_reason.reason = identified_agent_required` and must use an API key. |

In MCP an MPP challenge is not an error: the tool returns `isError: false` with
`structuredContent.payment_required` holding the challenge and a `how_to_pay` hint. Challenges are
single-use; a replayed or expired credential is rejected and nothing is created.

## 5. Legal obligations you must respect

You act for a human buyer under EU and Czech consumer law, and the shop relies on the declarations
you send.

- **Never order without the buyer's instruction.** An order is a contract that obliges them to pay.
- **Present the summary.** `display_to_user.text` from `preview_order` must reach the human as
  returned, with the subject of the purchase, the total, delivery and any payment fee — in the same
  reply in which you place the order is fine. A second "are you sure?" is not required when the buyer
  already instructed you to purchase. `presented_to_user: true` records that you showed the text.
- **Make the whole `disclosure` block available to the buyer before confirmation**, not only
  `display_to_user.text`: the withdrawal instruction and its exceptions, the rights from defective
  performance, the seller identification, the terms and the complaints procedure. Offer the full text
  (or the linked documents) whenever the human asks for details — the summary is a recap, not a
  replacement for the statutory information.
- **Use the buyer's own e-mail address.** The order confirmation, the statutory withdrawal
  information and payment instructions go there. Your own address belongs in `agent_cc_email`, never
  in `email`. `email_belongs_to_buyer: true` asserts this.
- **14-day withdrawal right** from receipt of the goods, with the statutory exceptions; full text,
  form and return address in `preview_order.disclosure.withdrawal` and `get_withdrawal_info`.
- **Prices are the amounts actually charged** (tax handling as configured, see
  `commerce_policy.prices_include_vat`). Do not present a different figure.
- **Some products are `agent_purchasable: false`** (age- or licence-restricted, or otherwise
  excluded): `add_to_basket` refuses them and the human must buy them via `hosted_checkout`.
- **Terms, privacy policy, complaints procedure and the withdrawal form** are linked from
  `get_shop_info` and from every preview and order result, in the basket language. If a mandatory
  document is missing in that language, `preview_order` returns `requires_human_checkout`.
- **Out-of-court dispute resolution:** the Czech Trade Inspection Authority (Česká obchodní
  inspekce), https://adr.coi.cz. The EU ODR platform is discontinued and is not used.
- **Data protection.** The name, address, e-mail and phone you send are processed by the shop as
  controller for the purchase. The shop records that the order came from an AI agent — client name,
  principal, protocol, IP, timestamp — for fraud prevention and as evidence that the pre-contractual
  information was presented. Send only data the buyer gave you for this purchase.

## 6. Errors

Errors are JSON: `{"error": "<code>", "message": "<EN text>", "details": {…}}` with a matching HTTP
status. In MCP they come back as `isError: true` with the same JSON in `structuredContent`.

| code | HTTP | meaning / what to do |
|---|---|---|
| `basket_not_found` | 404 | Unknown or foreign handle. Create a new basket. |
| `basket_expired` | 409 | Older than the TTL (72 h). Create a new basket and re-add the items. |
| `basket_locked` | 409 | Another placement is in flight. Do not retry in a loop; re-read with `get_basket`. |
| `basket_changed` | 409 | Contents/address/carrier differ from the preview. Re-run `preview_order` and re-confirm with the human. |
| `variant_required` | 422 | Pick a `combination_id` from `details`. |
| `insufficient_stock` | 409 | Lower the quantity or choose another product; `details` carries what is available. |
| `customer_required` | 409 | Call `set_customer` first (shipping and totals need an address). |
| `email_registered` | — (warning) | Since 1.1.1 no longer an error: `set_customer` returns it in `warnings` — the e-mail also has a registered account, the order is placed as a guest order. Offer `get_handoff_link` only if the customer wants to use their account. |
| `pickup_point_required` | 422 | The carrier needs `pickup_point_id`; use `search_pickup_points`. |
| `phone_required` | 422 | Pickup-point carriers and cash on delivery need a phone number; add it via `set_customer`. |
| `pickup_search_unavailable` | 409 | Packeta pickup points are chosen by the customer in the web checkout — `get_handoff_link`. |
| `payment_unavailable` | 409 | The method is not available for this basket; re-read `get_payment_options`. |
| `requires_human_checkout` | 409 | This purchase must be finished by the human — request a handoff link. |
| `preview_expired` | 409 | The `preview_token` is older than 15 min. Preview again and re-confirm. |
| `validation_failed` / `invalid_argument` / `invalid_arguments` | 422 | Bad or missing argument (`invalid_arguments` = MCP input-schema error, `details.errors` lists them); `details` names it. Fix the payload — do not retry unchanged. |
| `rate_limited` | 429 | Honour `Retry-After`. |
| `invalid_api_key` | 401 | Key unknown, inactive or out of scope. |
| `invalid_credential`, `challenge_expired`, `credential_replayed` | 402 | MPP: the credential was rejected, the challenge timed out, or it was already used. A new challenge is returned; nothing was charged or created. |

`503` (module disabled or shop in maintenance) and `5xx` are JSON too, never HTML. Retry `503` with
backoff; never retry a `4xx` unchanged.

## 7. Order tracking

- `get_order` → `GET https://goodgoods.cz/agent/v1/orders/{reference}?order_token=…` (or `?email=…`). Returns status
  (`paid`, `shipped`, `delivered`), items, totals, carrier and tracking, payment state and history.
  Either the `order_token` from placement or the buyer's e-mail is required — a reference alone is
  never enough.
- `get_payment_instructions` → `GET https://goodgoods.cz/agent/v1/orders/{reference}/payment`. Re-issues the transfer
  details (IBAN/VS/SPD) or the Comgate payment link for an unpaid order.
- `get_withdrawal_info` → `GET https://goodgoods.cz/agent/v1/withdrawal`. The withdrawal period, instructions, form
  and return address in the requested language; pass `reference` to tailor it to an order.

### 7.1 Customer identity — more than one order

A reference plus `order_token` or e-mail opens **one** order. To see all orders of a customer, or to
**write** (send a message to the shop, submit a cancellation, withdrawal or complaint), prove that the
person you act for controls the e-mail address:

1. `request_customer_code` (`{email}`) → the shop e-mails a 6-digit code to that address (only if it
   has orders; the reply is the same either way). Valid 15 minutes, 3 codes per hour per address.
2. Ask the human for the code; `verify_customer_code` (`{email, code}`) → `customer_token` (up to
   24 h, 5 attempts per code). It is bound to **your** agent identity — it does not work for anyone
   else. Keep it in this conversation only; never write it into logs or URLs; discard it when the
   conversation ends.
3. Use `customer_token` instead of `order_token`/`email` in every order tool, and in `list_orders`
   (last 24 months, at most 50 orders).
4. The customer can end the access at any time: call `revoke_customer_access` when they ask. The
   shop records who acted, when and on whose instruction (mandate log, kept 4 years).

### 7.2 Messages, cancellations, withdrawals, complaints (customer portal)

Available when the shop runs its customer portal; the tools reuse it, so the customer sees the same
threads and requests in the portal and by e-mail.

- `get_order_messages` / `post_order_message` — the conversation with the shop team about an order.
  Both require `order_token` or `customer_token` (an e-mail alone is not enough for message texts);
  posting also needs `customer_requested: true`. The team replies to the customer's e-mail.
- `get_request_options` — what the order allows right now: cancel (only before shipping), withdrawal
  (14-day right, consumer only), complaint, with the resolutions the customer may ask for and whether a
  bank account for the refund is needed. Read it before `submit_order_request`.
- `get_order_requests` — requests already filed and their status.
- `submit_order_request` (`{reference, type, items?, resolution?, note?, bank_account?,
  customer_requested: true}`) — files the request on the customer's instruction. The shop sends the
  statutory confirmation to the customer's e-mail; you get `request_id`, `status` and a
  `human_message` to relay. Photos cannot be attached here — offer `get_portal_link` for that.
- `get_portal_link` — asks the shop to **e-mail** the customer a sign-in link into the customer
  portal (for photos, documents and anything you cannot do here). Requires `customer_token`; the
  link itself never reaches you — tell the customer to check their inbox.

## 8. Good practice

- **Keep `basket_id` private.** It is a bearer handle to a basket that may hold the buyer's
  address: never log it in shared traces, never put it in a URL, never reuse it across buyers.
- **Do not create baskets in a loop.** One basket per purchase intent, reused while you refine it.
- **Respect `ttlMs` and `cacheScope`.** Catalogue and discovery responses are cacheable
  (`public`); baskets and orders are `private` and must not be cached or shared.
- **Match language and currency to the buyer**, not to yourself — they are fixed at `create_basket`
  and a wrong choice means starting over.
- **Never invent product ids, references or URLs.** Use `search_products`, `list_categories` or
  `get_product` with the URL.
- **Deep-research clients:** OpenAI-shaped `search` → `{results:[{id, title, url}]}` and `fetch` →
  `{id, title, text, url, metadata}` tools are exposed in the expected shape, so the shop works as a
  read-only source without the commerce tools.
- **Prefer the structured payload** (`structuredContent` / REST JSON) over the text rendering: the
  text is a convenience, the JSON is the contract.

## 9. Changelog and versions

| item | value |
|---|---|
| Module | `ggagentcommerce` 1.3.0 |
| MCP revisions supported | `2026-07-28` (stateless, `server/discover`), `2025-11-25`, `2025-06-18`, `2025-03-26` (`initialize`) |
| REST API | v1 (`https://goodgoods.cz/agent/v1`), OpenAPI 3.1 at `https://goodgoods.cz/agent/openapi.json` |
| MPP | `draft-httpauth-payment` (HTTP 402 `WWW-Authenticate: Payment`); methods published in `https://goodgoods.cz/.well-known/agent-commerce.json` |
| Discovery document | `https://goodgoods.cz/.well-known/agent-commerce.json`, versioned by date |

The interface is versioned and **additive**: new fields and new tools may appear without notice, so
parse leniently and ignore what you do not know. Removals and behavioural changes are announced in
the discovery document first; legacy MCP revisions are retired only once the traffic logs show they
are unused.

For an API key, higher limits, or the separate terms for agent operators, contact `info@goodgoods.cz`.
