# Second Nature public catalog API

This is the existing Medusa 2.20.1 Store API plus the storefront's existing /store/catalog filter endpoint. The published profile documents GET operations only. No account or payment actions are advertised.

- API base: https://secondnature.ws/medusa
- [OpenAPI description](https://secondnature.ws/openapi.json)
- [API catalog](https://secondnature.ws/.well-known/api-catalog)
- [Agent skills](https://secondnature.ws/.well-known/agent-skills/index.json)
- [Product sitemap](https://secondnature.ws/sitemap.xml)
- [Google product feed (US/USD)](https://secondnature.ws/feeds/google.xml)

## Access

Send x-publishable-api-key on every Store API request. This is the same public sales-channel key used by the storefront, not a secret admin credential or customer access token:

```text
x-publishable-api-key: pk_8e4f4e07540015f3b17d3c98a3c69846e4298c8f73b6f172d5ff83b4dac79278
```

Do not send customer cookies or bearer tokens for public browsing. A missing or invalid key is an error, not an empty catalog. Private customer uploads, account data and orders are not public resources.

## Select region and language

GET https://secondnature.ws/medusa/store/regions?limit=100 and choose the region whose countries contain the shopper's destination country. Use its id as region_id for product and catalog queries. Do not hardcode region IDs or assume all shoppers use USD. Send x-medusa-locale: en-US or es-ES for translations. Pagination uses limit and offset unless stated otherwise.

## Search and filters

GET https://secondnature.ws/medusa/store/catalog?region_id=REGION_ID&q=mask&page=1&limit=12

Optional: min_price, max_price (major currency units), in_stock=true, on_sale=true, catalog_tags[]=readyToShip or makeOnDemand, sort_by=price_asc. This endpoint uses page starting at 1; follow nextPage until null. archive defaults to false. The response contains products, count, currentPage and nextPage. The fields selection is controlled by the server. Native /store/products supports limit/offset, q and handle filters.

## Product and variant details

GET https://secondnature.ws/medusa/store/products/PRODUCT_ID?region_id=REGION_ID&fields=%2Bvariants.calculated_price,%2Bvariants.inventory_quantity

For a handle, GET /store/products?handle=HANDLE&region_id=REGION_ID with the same fields parameter. Use calculated_price.calculated_amount and currency_code for each variant. Medusa amounts are already in major units (49.99 means 49.99, not 0.4999). Missing price or inventory is unknown. Check manage_inventory, allow_backorder and inventory_quantity; backorder support is not a promise of immediate shipping. Stock and final totals are checked again by the normal checkout.

Product links: https://secondnature.ws/en/products/HANDLE?v_id=VARIANT_ID (or /es). Read the product page for production lead times and the exact selected variant. Collections and product categories are available via the GET endpoints in OpenAPI. Only currently published storefront products should be presented as available catalog entries; an archived example is not an offer to buy.

## Read public pages as Markdown

Request a normal public page URL with Accept: text/markdown. This works for /en and /es homepages, store, search, products, categories, collections, public information and policies. It converts anonymous server-rendered HTML and retains public JSON-LD, including the selected product offer. The non-sensitive _medusa_country_code cookie selects the pricing country, just as for the browser. No account/session cookies are forwarded. Markdown is not shared-cacheable; ordinary HTML remains available with Accept: text/html.

## Errors and boundaries

Respect 400 (invalid query), 401/403 (access/key), 404/410 (missing or removed resource), 429 (rate limit) and 503 (temporary outage). Honor Retry-After; never turn an error into a stock or delivery claim. Do not assume a prepared cart is a paid order. This first-stage discovery profile does not advertise MCP, WebMCP, delegated OAuth, ACP, UCP or machine-payment support.
