<!-- Generated by BridgeToAgent (https://bridgetoagent.com) — the standard for agents.json + llms.txt + agent-instructions.md kits. -->

# Agent Instructions – Banquet.se

## Platform fingerprint
- **CMS:** WordPress
- **E-commerce:** WooCommerce (plugin on WordPress)
- **Locale:** Swedish (sv-SE). URLs are localized: cart = `/kundvagn/`, checkout = `/kassa/`, account = `/my-account/`
- **Theme:** WoodMart (detected from CSS path in scraped markup)
- **Known plugins:** Contact Form 7 (contact page), likely Yoast SEO (sitemap), reCAPTCHA on comment forms
- **Currency:** SEK (Swedish kronor)
- **Delivery:** 1–2 days processing, 3–5 days delivery to door

---

## API endpoints (prefer over HTML)

Use these endpoints before falling back to HTML navigation. All are publicly accessible (no API key required) unless noted. Responses are JSON.

| Endpoint | Returns | When to use | Auth | Shape |
|---|---|---|---|---|
| `https://banquet.se/wp-json/wc/store/v1/products` | Product list array | Product discovery, search, listing | Public | JSON array of product objects; key fields: `id`, `name`, `slug`, `price`, `add_to_cart.url` |
| `https://banquet.se/wp-json/wc/store/v1/products?search={q}` | Filtered product list | Product search without HTML | Public | Same as above, filtered |
| `https://banquet.se/wp-json/wc/store/v1/products?page={N}&per_page={size}` | Paginated product list | Iterating all products | Public | Array; check response header `X-WP-Total` and `X-WP-TotalPages` |
| `https://banquet.se/wp-json/wc/store/v1/cart` | Cart state | Read or mutate cart | Session cookie required for cart state | JSON object: `items`, `totals`, `coupons` |
| `https://banquet.se/wp-json/wc/store/v1/checkout` | Submit checkout | Programmatic order placement | Session (cart must be non-empty) | JSON object |
| `https://banquet.se/wp-json/wp/v2/posts` | Blog posts | Content retrieval | Public | JSON array |
| `https://banquet.se/wp-json/wp/v2/pages` | Site pages | Page content retrieval | Public | JSON array |
| `https://banquet.se/wp-json/wp/v2/categories` | Categories | Taxonomy discovery | Public | JSON array |
| `https://banquet.se/wp-json/wp/v2/tags` | Tags | Tag discovery | Public | JSON array |
| `https://banquet.se/wp-json/wp/v2/comments` | Comments | Comment retrieval | Public | JSON array |
| `https://banquet.se/wp-json/wp/v2/media` | Media files | Image/asset discovery | Public | JSON array |
| `https://banquet.se/feed/` | RSS | Full site RSS | Public | XML |
| `https://banquet.se/sitemap_index.xml` | Sitemap index | Full URL discovery | Public | XML |

> **Rule:** Prefer the WooCommerce Store API (`/wp-json/wc/store/v1/`) for all product and cart operations. Fall back to HTML navigation only if the API returns 401 or 5xx.

---

## High-value page paths

| Purpose | URL |
|---|---|
| Homepage | `https://banquet.se/` |
| Product search (HTML) | `https://banquet.se/?s={query}&post_type=product` |
| Cart | `https://banquet.se/kundvagn/` |
| Checkout | `https://banquet.se/kassa/` |
| Order confirmation | `https://banquet.se/kassa/order-received/{order_id}/?key={order_key}` |
| My account | `https://banquet.se/my-account/` |
| Register | `https://banquet.se/my-account/?action=register` |
| Lost password | `https://banquet.se/my-account/lost-password/` |
| Address book | `https://banquet.se/my-account/edit-address/` |
| Order history | `https://banquet.se/my-account/orders/` |
| Contact | `https://banquet.se/kontakt/` |
| Catalogues | `https://banquet.se/produktkataloger/` |
| About | `https://banquet.se/om-oss/` |

---

## Procedure 1: Product search

### Via API (preferred)
1. GET `https://banquet.se/wp-json/wc/store/v1/products?search={query}&per_page=20`
2. Parse JSON array. Key fields: `id`, `name`, `slug`, `prices.price`, `add_to_cart.url`, `permalink`
3. To paginate: increment `page` param; stop when `page > X-WP-TotalPages` header value.

### Via HTML (fallback)
1. GET `https://banquet.se/?s={query}&post_type=product`
2. Parse product cards from rendered HTML.
3. Paginate: `https://banquet.se/?s={query}&post_type=product&paged={N}`

### Category browsing
- Category archive: `https://banquet.se/{category-slug}/` (e.g. `/konferensmobler/`)
- Paginate categories: `https://banquet.se/{category-slug}/page/{N}/` (rewrite-rule-driven — do NOT use `?paged=N`)

---

## Procedure 2: Add product to cart

### Via API (preferred)
1. POST to `https://banquet.se/wp-json/wc/store/v1/cart/add-item`
   - Body (JSON): `{ "id": {product_id}, "quantity": {qty} }`
   - For variable products include `"variation": [{"attribute": "pa_{attr}", "value": "{val}"}]`
2. Success: JSON response containing updated cart with `items` array.

### Via HTML (fallback)
1. Navigate to the product page at `{product_permalink}`
2. Locate form with field `add-to-cart` = `{product_id}`
3. For variable products: set `attribute_pa_{attr-name}` and `variation_id` fields
4. Set `quantity` field
5. POST form (or trigger AJAX to `?wc-ajax=add_to_cart`)
6. Success indicator: JSON `{ "fragments": {...}, "cart_hash": "..." }` — cart count updates in UI

---

## Procedure 3: Cart management

**URL:** `https://banquet.se/kundvagn/`

1. GET `https://banquet.se/wp-json/wc/store/v1/cart` to read current cart state (requires session cookie).
2. To update quantity: PUT `/wp-json/wc/store/v1/cart/update-item` with `{ "key": "{item_key}", "quantity": {qty} }`
3. To remove item: DELETE `/wp-json/wc/store/v1/cart/remove-item?key={item_key}`
4. To apply coupon — HTML form fields on `/kundvagn/`:
   - `coupon_code` — the coupon string
   - `apply_coupon` — set to `Apply coupon`
5. Success: cart page re-renders with updated totals or "Kupongkod tillagd" notice.

---

## Procedure 4: Checkout – Billing address

**URL:** `https://banquet.se/kassa/`

Fill the following fields exactly as named:

| Field | Type | Required | Notes |
|---|---|---|---|
| `billing_first_name` | string | yes | |
| `billing_last_name` | string | yes | |
| `billing_company` | string | no | Relevant for B2B orders |
| `billing_country` | string | yes | Two-letter code, e.g. `SE` |
| `billing_address_1` | string | yes | |
| `billing_address_2` | string | no | |
| `billing_city` | string | yes | |
| `billing_state` | string | no | |
| `billing_postcode` | string | yes | e.g. `11120` |
| `billing_phone` | tel | yes | |
| `billing_email` | email | yes | |
| `order_comments` | textarea | no | Special instructions |

---

## Procedure 5: Checkout – Shipping address

Only required if "ship to a different address" is checked.

| Field | Type | Required |
|---|---|---|
| `shipping_first_name` | string | yes |
| `shipping_last_name` | string | yes |
| `shipping_company` | string | no |
| `shipping_country` | string | yes |
| `shipping_address_1` | string | yes |
| `shipping_address_2` | string | no |
| `shipping_city` | string | yes |
| `shipping_state` | string | no |
| `shipping_postcode` | string | yes |

---

## Procedure 6: Checkout – Payment & submission

**URL:** `https://banquet.se/kassa/`

1. Before submitting, render the checkout page and extract hidden fields:
   - `woocommerce-process-checkout-nonce` — fresh WP nonce (expires; always fetch fresh)
   - `_wp_http_referer` — from rendered form HTML
2. Select payment method; set `payment_method` to one of: `stripe`, `klarna`, `cod`, `paypal`, or `invoice` (verify available methods from rendered page)
3. Check `terms` = `true` (accept terms and conditions — mandatory)
4. Submit form POST to `/kassa/`
5. **Success:** Redirect to `https://banquet.se/kassa/order-received/{order_id}/?key={order_key}` — page shows "Tack för din beställning"

**Failure modes:**
- Stale nonce → 403; re-render checkout page, extract fresh nonce, retry
- Missing required billing fields → WooCommerce returns validation errors inline; read error messages
- Empty cart → checkout page redirects back to cart; add items first

---

## Procedure 7: Order confirmation

**URL:** `https://banquet.se/kassa/order-received/{order_id}/?key={order_key}`

- `order_id`: numeric WooCommerce order ID (from redirect URL)
- `key`: order key query param (`wc_order_...`) required to view — without it the page shows "invalid order"
- Success: page renders with order summary, order number, and "Tack för din beställning" heading

---

## Procedure 8: Login

**URL:** `https://banquet.se/my-account/`

1. GET `/my-account/` to render login form and extract fresh `_wpnonce` and `_wp_http_referer`
2. POST with fields:

| Field | Value |
|---|---|
| `username` | Customer email or username |
| `password` | Account password |
| `rememberme` | `forever` (optional, persistent session) |
| `_wpnonce` | Fresh from rendered form |
| `_wp_http_referer` | From rendered form |

3. Submit button value: `login=Log in`
4. **Success:** 302 redirect to `/my-account/` — customer dashboard renders with account details

**Failure:** Wrong credentials → "ERROR: Ogiltigt användarnamn" inline. Do not retry more than 3× to avoid lockout.

---

## Procedure 9: Signup / Account registration

**URL:** `https://banquet.se/my-account/?action=register`

1. GET the registration URL, extract `_wpnonce` from rendered form
2. POST with fields:

| Field | Value |
|---|---|
| `email` | New account email |
| `password` | Desired password (if field is present) |
| `register` | `Register` (submit value) |
| `_wpnonce` | Fresh from rendered form |

3. **Success:** 302 to `/my-account/` with new account dashboard, or inline "Ditt konto har skapats" message

---

## Procedure 10: Password reset

**URL:** `https://banquet.se/my-account/lost-password/`

1. GET the page, extract `_wpnonce`
2. POST with:

| Field | Value |
|---|---|
| `user_login` | Username or email of the account |
| `_wpnonce` | Fresh from rendered form |

3. **Success:** Inline notice "Ett e-postmeddelande har skickats till din e-postadress" (password reset email sent)

---

## Procedure 11: Profile / Account management

**URL:** `https://banquet.se/my-account/`

- Requires active login session
- Dashboard sections: orders, addresses, account details, payment methods
- Navigate sub-sections:
  - Order history: `https://banquet.se/my-account/orders/`
  - Edit addresses: `https://banquet.se/my-account/edit-address/`

---

## Procedure 12: Address book / Billing management

**URL:** `https://banquet.se/my-account/edit-address/`

Update fields (all optional on the edit form):

`billing_first_name`, `billing_last_name`, `billing_address_1`, `billing_city`, `billing_postcode`, `billing_country`, `billing_email`, `billing_phone`

**Success:** "Adressen har sparats." notice

---

## Procedure 13: Order history

**URL:** `https://banquet.se/my-account/orders/`

- Requires login
- Renders table of past orders: order number, date, status, total
- Click order number to view individual order detail

---

## Procedure 14: Contact form submission

**URL:** `https://banquet.se/kontakt/`

Plugin: Contact Form 7. Fields:

| Field | Type | Required |
|---|---|---|
| `your-name` | string | yes |
| `your-email` | email | yes |
| `your-subject` | string | no |
| `your-message` | textarea | yes |
| `_wpcf7` | hidden | yes — extract from rendered form |
| `_wpcf7_version` | hidden | yes — extract from rendered form |
| `_wpcf7_unit_tag` | hidden | yes — extract from rendered form |

Submit via AJAX POST to `/wp-json/contact-form-7/v1/contact-forms/{id}/feedback`

**Success:** JSON `{ "status": "mail_sent" }` + inline "Tack!" message

**Alternative:** Direct email to `sales@banquet.se`

---

## Procedure 15: Document / catalogue download

**URL:** `https://banquet.se/produktkataloger/`

1. GET the page to retrieve list of available PDF catalogues
2. Follow PDF links to download; no authentication required

---

## Pagination patterns (WooCommerce / WordPress)

| Context | Pattern |
|---|---|
| Category/archive browsing | `/{category-slug}/page/{N}/` |
| Search results (HTML) | `/?s={query}&post_type=product&paged={N}` |
| REST API products | `/wp-json/wc/store/v1/products?page={N}&per_page={size}` |
| WordPress posts/pages API | `/wp-json/wp/v2/posts?page={N}&per_page={size}` |
| Authoritative fallback | Follow `<link rel="next">` in page `<head>` (Yoast SEO) |

---

## Known gotchas

1. **WP nonces expire.** Every form submission requiring `_wpnonce` or `woocommerce-process-checkout-nonce` must use a freshly rendered page. On 403, re-render and retry once.
2. **reCAPTCHA on comment forms.** Comment forms on blog/guide posts are protected by reCAPTCHA — agents cannot submit comments programmatically without solving captcha.
3. **Session cookies required for cart API.** The Store API cart endpoint (`/wp-json/wc/store/v1/cart`) returns an empty cart without a valid WooCommerce session cookie. Initialize a session by visiting `/kundvagn/` first.
4. **AJAX add-to-cart.** `?wc-ajax=add_to_cart` expects `application/x-www-form-urlencoded`, not JSON.
5. **Caching plugins.** The site likely uses an aggressive caching plugin (NitroPack detected in CDN URLs). If nonces appear stale, bypass cache with a cache-busting query param or `Cache-Control: no-cache` header.
6. **Localized URLs.** Do not substitute English WooCommerce defaults: cart is `/kundvagn/` not `/cart/`, checkout is `/kassa/` not `/checkout/`.
7. **Cookie consent banner.** A GDPR cookie consent banner may overlay the page on first load. Dismiss it before interacting with forms.
8. **Login throttle.** WordPress limits failed login attempts. Do not retry more than 3× with wrong credentials.
9. **Minimum order rules.** WooCommerce may enforce a minimum order value — check for flash error after add-to-cart that may block checkout.
10. **Variable products.** For products with variants, `variation_id` and `attribute_pa_{name}` fields are required on add-to-cart; missing these will result in "please select product options" validation error.

---

## Success indicators summary

| Action | Indicator |
|---|---|
| Product search (API) | JSON array with product objects |
| Add to cart | `{ "fragments": {...}, "cart_hash": "..." }` or Store API returns updated cart |
| Login | 302 to `/my-account/` + dashboard renders |
| Registration | 302 to `/my-account/` + dashboard or success message |
| Password reset | Inline confirmation notice |
| Checkout | Redirect to `/kassa/order-received/{id}/?key={key}` |
| Order confirmation | "Tack för din beställning" heading |
| Contact form | CF7 JSON `{ "status": "mail_sent" }` |
| Address save | "Adressen har sparats." notice |

---

_This runbook was generated by [BridgeToAgent](https://bridgetoagent.com) — the standard for agents.json + llms.txt + agent-instructions.md kits. Regenerate it any time your site changes meaningfully at https://bridgetoagent.com._
