Public API

SoMerch exposes a small set of unauthenticated HTTP endpoints for crawlers, AI agents, and uptime monitors. The machine-readable description is available as an OpenAPI 3.1 document and discoverable through the RFC 9727 API catalog.

Base URL

https://somerch.co

All endpoints accept GET and respond with permissive CORS headers (Access-Control-Allow-Origin: *).

Authentication

Authenticated endpoints accept Supabase-issued JWT access tokens via Authorization: Bearer <token>. Agents can discover how to obtain a token from /.well-known/openid-configuration (OpenID Connect) or /.well-known/oauth-authorization-server (RFC 8414). The supported flow is authorization_code + PKCE. Once a token is obtained, call /api/protected/me to verify it. Resource-server metadata (RFC 9728) is published at /.well-known/oauth-protected-resource and is also advertised via the WWW-Authenticate header on 401 responses from protected endpoints. Agent registration instructions live at /auth.md (auth.md convention), so agents can auto-discover the full chain: catalog → auth.md → protected resource → authorization server → token.

Model Context Protocol (MCP)

SoMerch publishes a read-only MCP server so AI agents can query the public catalog without scraping. Discover it via the server card at /.well-known/mcp/server-card.json (SEP-1649). The server is reachable at /api/mcp using the streamable-HTTP transport (protocol version 2025-06-18) and requires no authentication. Available tools: search_products, get_product, list_categories, list_brands, list_collections, get_header_menu, and get_static_page. All accept an optional lang argument (en, de, fr).

Endpoints

Discovery