API and AI agents: how to connect to Mercatren
What is open without credentials (catalog, search, Markdown, MCP server), what needs a store token (payment links and catalog sync) and how to request access.
In one line
Reading the catalog is public. Creating payment links and syncing catalogs needs a store token issued by the team. There is no OAuth server, and we don't publish one that doesn't exist.
What is public
| What | Where | What for |
|---|---|---|
| Catalog in batches | GET /datos/catalogo?pagina=1&todas=1 | Published products, 24 per batch; q= searches by words (with synonyms). |
| Suggestions | GET /datos/buscar?q= | Products and stores that match while typing. |
| MCP server | POST /datos/mcp | JSON-RPC 2.0, Streamable HTTP: buscar_productos, ver_producto, listar_tiendas, ver_tienda. |
| Markdown for agents | any page with Accept: text/markdown | The product, store, article or home page in Markdown, with x-markdown-tokens. |
| Health | GET /datos/salud | ok, and whether the database answers. |
| OpenAPI 3.1 | /datos/openapi.json | The spec for all of the above and for the partner API. |
How it is discovered
- /.well-known/api-catalog — the API catalog (RFC 9727).
- /.well-known/mcp/server-card.json — the MCP server card.
- /.well-known/agent-skills/index.json — the skills: “buy on Mercatren” and “get paid through Mercatren”, with their SHA-256.
- /.well-known/ai-catalog.json — the ARD manifest.
- /auth.md and /.well-known/oauth-protected-resource — how to get access and which resource is protected.
- /llms.txt — the summary for assistants.
Try the MCP in thirty seconds
POST to /datos/mcp with {"jsonrpc":"2.0","id":1,"method":"tools/list"} and you get the four tools. Then {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"buscar_productos","arguments":{"consulta":"bicicleta"}}} and you get the results with title, price, store and link.
The partner API (with token)
With Authorization: Bearer <store token>, a system creates payment links (POST /datos/socios/cobro), checks their status (GET /datos/socios/cobro?referencia=), reactivates and cancels them, pushes its catalog (POST /datos/socios/productos) and reads what changed here (GET /datos/socios/cambios?desde=). The token is issued by the team when the store is linked: write to hola@mercatren.com with the store name and the intended use. A partner platform gets each store's token with its partner key at POST /datos/socios/vincular.
Keep it safe
The token lives on the server, never in a browser or a public repository. To rotate or revoke it, write to hola@mercatren.com.