---
agent:
  instructions: "Use this search API to find Trusteed documentation (pages, blog posts, FAQ, error codes, the agent checkout guide and MCP tools) with keywords, instead of crawling individual pages. Results are returned in Markdown. It does not search store catalogues: for products use POST /api/v1/search."
  endpoint: "https://trusteed.xyz/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---
Source: https://trusteed.xyz/en/developers

For Integrators

# Developer Documentation

Everything you need to integrate Trusteed with your application

## MCP Agent Setup: 3 steps

Configure your AI agent to browse products, create carts, and initiate checkout through the MCP protocol.

1 

### Add the MCP server to your agent

Add Trusteed to your agent's MCP configuration. Replace {slug} with the merchant store slug.

{
  "mcpServers": {
    "trusteed": {
      "url": "https://trusteed.xyz/{slug}/mcp/discovery",
      "headers": { "X-Agent-Api-Key": "agnt\_your\_key" }
    }
  }
}

Discovery reads (search, product details, merchant profile) are public; cart and checkout tools need the key. No key yet? Try the public demo: https://trusteed.xyz/demo-store/mcp/discovery (no auth, read-only), and get a free 24 h sandbox key for checkout.

2 

### Search products with filters

Call search\_products to explore the catalog. Filter by category, price range, or availability.

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "search\_products",
    "arguments": { "query": "running shoes", "max\_price": 200, "limit": 5 }
  }
}

Recommended: only proceed to cart if the merchant's trust level is above your acceptable threshold

3 

### Create cart and complete checkout

Use create\_cart to add items, then preview\_checkout to review totals, and complete\_checkout to finalize. Always confirm with the user before checkout.

// Step 3a — create cart
{ "method": "tools/call", "params": { "name": "create\_cart", "arguments": { "items": \[{ "product\_id": "prod\_abc123", "quantity": 1 }\] } } }

// Step 3b — preview checkout
{ "method": "tools/call", "params": { "name": "preview\_checkout", "arguments": { "cart\_id": "cart\_xyz789" } } }

// Step 3c — complete checkout (checkout\_session\_id comes from preview\_checkout)
{ "method": "tools/call", "params": { "name": "complete\_checkout", "arguments": {"checkout\_session\_id":"<checkout\_session\_id from preview\_checkout>","idempotency\_key":"<uuid-v4, one per purchase attempt>","payment\_method":"MOCK"} } }

complete\_checkout returns a status. COMPLETED carries an order\_id (simulated on demo-store: no money moves). PENDING\_EXTERNAL\_CONFIRMATION means the buyer must first approve or pay at the returned link; then call again with the same checkout\_session\_id and idempotency\_key. Never auto-confirm without user approval.

## Quick Start

No API key? Start with the public demo endpoint. Have a key? Jump to the authenticated REST examples below.

No API key: try now Live

Zero setup. No registration required. Uses MCP protocol (JSON-RPC 2.0). Rate limit: 500 requests per 15 minutes per IP across the API (the global cap, which governs sustained traffic; the discovery bucket allows up to 1000/min per IP inside it).

curl https://trusteed.xyz/demo-store/mcp/discovery \\
  -X POST \\
  -H "Content-Type: application/json" \\
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "search\_products",
      "arguments": { "query": "running shoes" }
    }
  }'

Authenticated REST API (requires X-Agent-Api-Key)

curl

curl -X POST https://trusteed.xyz/api/v1/agent/search \\
  -H "X-Agent-Api-Key: agnt\_your\_key" \\
  -H "Content-Type: application/json" \\
  -d '{"query": "running shoes", "limit": 5}'

Python

import requests

response = requests.post(
    "https://trusteed.xyz/api/v1/agent/search",
    headers={"X-Agent-Api-Key": "agnt\_your\_key"},
    json={"query": "running shoes", "limit": 5}
)
data = response.json()

JavaScript

const res = await fetch(
  "https://trusteed.xyz/api/v1/agent/search",
  {
    method: "POST",
    headers: {
      "X-Agent-Api-Key": "agnt\_your\_key",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ query: "running shoes", limit: 5 })
  }
);
const data = await res.json();

## Authentication

Two authentication methods depending on your integration type.

### Agent API Key (demo-store and sandbox)

`X-Agent-Api-Key: agnt_xxx`

For autonomous AI agents on demo-store and the REST agent API (/api/v1/agent/\*). Create a key once. Use it without a session. On a real merchant the Checkout bucket rejects an API key with 401 and requires OAuth 2.0 machine-to-machine credentials, a payment mandate and an agent trust signal.

- • search: catalog search
- • compare: product comparison
- • cart: cart creation
- • checkout: checkout initiation
- • checkout:delegate: delegated checkout
- • orders:read: order history
- • merchants:read: merchant profiles
- • protocols:discover: protocol discovery

### JWT Bearer

`Authorization: Bearer <token>`

For authenticated users. Obtain via POST /api/v1/auth/login.

### Create an Agent API Key

\# 1. Obtain JWT first
curl -X POST https://trusteed.xyz/api/v1/auth/login \\
  -d '{"email":"you@example.com","password":"..."}' | jq .token

# 2. Create Agent API Key (plaintext returned once: store securely)
#    "name" is required; scopes outside the valid list are rejected with 400
curl -X POST https://trusteed.xyz/api/v1/agent-keys \\
  -H "Authorization: Bearer <jwt>" \\
  -H "Content-Type: application/json" \\
  -d '{"name":"my-agent","scopes":\["search","compare","cart","merchants:read"\]}'

### Try without a key: Demo & Health endpoints

Live

The demo-store MCP endpoint is public (read-only catalog, JSON-RPC 2.0). The health check is also unauthenticated.

Working cURL. Copy and run immediately:

curl https://trusteed.xyz/demo-store/mcp/discovery \\
  -X POST -H "Content-Type: application/json" \\
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"search\_products","arguments":{"query":"shoes"}}}'

- Demo store MCP endpoint (public, no auth) `POST https://trusteed.xyz/demo-store/mcp/discovery`
- Health check (GET, no auth) `GET https://trusteed.xyz/api/v1/health`
- Trust Score v4.1: three weighted dimensions, an optional bonus and confidence caps. Read each response's engine; v2 is only a fallback if the v4.1 calculation fails. `GET https://trusteed.xyz/api/v1/trust/methodology`

### Auth & Compliance

Enterprise-grade authentication and regulatory compliance, machine-readable and verifiable.

✓ 

OAuth 2.1 + PKCE (MCP spec 2025-11-25)

- Authorization server: Auth0
- Discovery: [https://auth.trusteed.xyz/.well-known/oauth-authorization-server](https://auth.trusteed.xyz/.well-known/oauth-authorization-server)(RFC 8414)

✓ 

Protected Resource Metadata

- RFC 9728: declares protected scopes and token endpoint
- Machine-readable: [/.well-known/oauth-protected-resource/{storeSlug}/mcp](https://trusteed.xyz/.well-known/oauth-protected-resource/demo-store/mcp)

✓ 

EU AI Act Art. 50: Transparency headers

- X-Agent-Commerce: 1 on every response from an agent-facing surface
- X-Initiated-By: ai-agent on every response from an agent-facing surface
- X-AI-Act-Transparency: agent-initiated-transaction on transactional and state-changing responses

✓ 

MCP spec 2025-11-25 compliant

- Server card: [/.well-known/mcp.json](https://trusteed.xyz/.well-known/mcp.json)

## MCP Tools

50 tools are listed in the MCP registry (each store serves the subset it enables), including a public discovery subset that works without auth. Read-only tools execute without human confirmation, while write tools always require it.

| Tool | Method | Path | Auth Required | Human Confirmation |
| --- | --- | --- | --- | --- |
| `search_products` Search catalog with filters (public) | POST | MCP tool | No | Never |
| `get_product_details` Full product data with policies (public) | POST | MCP tool | No | Never |
| `browse_categories` Browse product categories (public) | POST | MCP tool | No | Never |
| `compare_products` Side-by-side product comparison (public) | POST | MCP tool | No | Never |
| `nlweb_ask` AI semantic search with NLWeb (public; served only by stores with NLWeb enabled) | POST | MCP tool | No | Never |
| `get_merchant_profile` Trust score, identity verification, policies (public) | POST | MCP tool | No | Never |
| `create_cart` Cart with stock validation | POST | MCP tool | Yes | Required |
| `get_shipping_rates` Calculate shipping costs | POST | MCP tool | Yes | Never |
| `preview_checkout` Order summary before payment: 401 without a token, never asks for human confirmation | POST | MCP tool | Yes | Never |
| `complete_checkout` Places the order: COMPLETED with order\_id, or PENDING\_EXTERNAL\_CONFIRMATION with a link for the buyer | POST | MCP tool | Yes | Required |
| `onx_get_orders` Query fulfilled orders (post-checkout) | POST | MCP tool | Yes | Never |
| `onx_create_return` Initiate product return request (not on Shopify) | POST | MCP tool | Yes | Required |

## Webhooks

Subscribe to events in Settings > Webhooks. All payloads include an X-Webhook-Signature header.

`order.created``order.status_changed``checkout.abandoned`

Example payload: order.created

{
  "event": "order.created",
  "timestamp": "2026-03-19T14:32:00Z",
  "orderId": "ord\_xyz123",
  "merchantSlug": "running-gear-pro",
  "totalAmount": 124.99,
  "currency": "USD",
  "status": "pending"
}

Verify HMAC-SHA256 signature (Stripe-style with replay protection)

Python

import hmac, hashlib, time

# Header format: X-Webhook-Signature: t=<unix\_ts>,v1=<hex\_sig>
# v1 = HMAC\_SHA256(secret, "<unix\_ts>.<raw\_body>")
def verify\_webhook(body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
    ts, v1 = parts.get("t"), parts.get("v1")
    if not ts or not v1: return False
    if abs(int(time.time()) - int(ts)) > tolerance: return False  # replay guard
    signed = f"{ts}.".encode() + body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare\_digest(expected, v1)

Node.js

import crypto from "crypto";

// Header format: X-Webhook-Signature: t=<unix\_ts>,v1=<hex\_sig>
// v1 = HMAC\_SHA256(secret, "<unix\_ts>.<raw\_body>")
function verifyWebhook(body: string, header: string, secret: string, toleranceSec = 300): boolean {
  const parts = Object.fromEntries(header.split(",").map(p => p.split("=", 2)));
  const ts = Number(parts.t);
  if (!ts || !parts.v1) return false;
  if (Math.abs(Math.floor(Date.now() / 1000) - ts) > toleranceSec) return false; // replay guard
  const expected = crypto.createHmac("sha256", secret).update(\`${ts}.${body}\`).digest("hex");
  const a = Buffer.from(parts.v1, "hex");
  const b = Buffer.from(expected, "hex");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

## API Response Format

All agent endpoints return a consistent JSON envelope. Product records are designed to be passed directly to LLM context windows.

{
  "success": true,
  "data": \[
    {
      "id": "prod\_abc123",
      "name": "Ultra Boost Running Shoe",
      "price": 119.99,
      "currency": "USD",
      "stock\_status": "in\_stock",
      "merchant": {
        "slug": "running-gear-pro",
        "trust\_score": 0.91,
        "verification\_level": "STANDARD"
      },
      "policies": {
        "return\_window\_days": 30,
        "free\_shipping\_threshold": 75,
        "shipping\_estimate\_days": "2-4"
      }
    }
  \],
  "meta": {
    "total": 48,
    "page": 1,
    "limit": 5
  }
}

## Rate Limits

Requests cross up to four independent limits, each enforced by a different layer. All of them must have capacity for a call to succeed. The one that bites first is usually not the one you planned for.

MCP Gateway: per-key bucket

| Tier | Internal quota | In force today |
| --- | --- | --- |
| STARTER (alias: FREE, only self-serve tier today) | 30 / min | 30 / min |

MCP store API keys carry no tier information, so the gateway applies the STARTER bucket (30 req/min) to every key — size your backoff against that number. Internal quota tiers above Starter exist in the rate limiter's configuration but are not a plan catalogue: see get\_page\_content("pricing") for what is actually purchasable. This per-key bucket applied to the legacy single /{slug}/mcp endpoint (retired, answers 410); the dedicated bucket endpoints have their own limits (see below). Tier differentiation is real on the agentic REST API below.

Per-tool limits (on top of the per-key bucket)

| Tool | Limit |
| --- | --- |
| `search_products` | 20 / min |
| `search_products_enriched` | 15 / min |
| `complete_checkout` | 10 / min |
| `create_cart` | 20 / min |
| `ucp_create_checkout` | 20 / min |

The other layers

- Global, per IP or authenticated user: 500 requests per 15 minutes. Note the window, it is not per minute. Anonymous traffic hits this one first.
- Dedicated bucket endpoints (/{slug}/mcp/discovery, /customer, /checkout) have their own limits and are not subject to the per-key bucket above: Discovery 1000/min per IP, Customer 200/min per customer, Checkout 60/min per agent, plus 1500/min per agent across the three.
- Demo store (/demo-store/mcp/discovery, no key): 1000 req/min per IP.
- Agentic REST API (/api/v1/agent/\*, X-Agent-Api-Key): per key and minute, by the key's real tier. Starter (the only self-serve plan today, see get\_page\_content("pricing")): 100 req/min. Higher internal tiers exist but are not a plan catalogue — they are not purchasable self-serve.
- Public REST endpoints (trust score, directory): 30 req/min per IP.

Response headers

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 17
X-RateLimit-Reset: 42
Retry-After: 60  // only on 429

Retry logic for agents

1. 1On 429, read X-RateLimit-Reset (seconds remaining until the window resets).
2. 2Wait until that timestamp before retrying.
3. 3Use exponential backoff: 1 s → 2 s → 4 s → 8 s.
4. 4Never retry more than 4 times per call chain.

## Interactive API Docs

Browse and test all endpoints with Swagger UI. Try requests directly from your browser.

[Open Swagger UI](https://trusteed.xyz/api/docs)

GET /api/docs
HTTP/1.1 200 OK

Swagger UI - Interactive
API Documentation

## Developer FAQ

[View full FAQ](https://trusteed.xyz/en/faq)

### What authentication method does the Trusteed API use?

The API uses Bearer token authentication via JWT. Obtain a token by calling POST /api/v1/auth/login, then include it in the Authorization header of subsequent requests.

### Is there an MCP endpoint I can connect AI agents to?

Yes. Each store gets its own MCP endpoints at /{store-slug}/mcp/discovery and /{store-slug}/mcp/checkout. MCP-compatible AI agents can connect to search products, check availability, and initiate checkout flows.

### What rate limits apply to the API?

The MCP Gateway enforces two independent limits: a per-key bucket and a per-tool bucket (e.g. complete\_checkout capped at 10/min). The per-key bucket has internal quota tiers loaded (keyed by API-key tier), but MCP store keys carry no tier, so every key currently gets the STARTER bucket of 30 req/min — plan your backoff against that. The agentic REST API does differentiate by the key's real tier; only Starter (free) is self-serve today, at 100 req/min — see get\_page\_content("pricing"). On a 429, read X-RateLimit-Reset and wait that many seconds before retrying. See the Rate Limits section for all layers.

### Which e-commerce platforms are supported natively?

4 platforms have a built integration as part of our founding merchants program (we onboard you rather than leaving you to self-serve): Shopify, WooCommerce, PrestaShop and Magento. Odoo has one too, in sandbox, in validation with pilot merchants. Any other platform integrates through our REST API by pushing catalog and order data. The current state of each one is published in /en/integrations and in .well-known/agent-commerce.json.

### What is merchant identity verification and how does it affect trust scores?

Merchant identity verification is the process by which we confirm a merchant's legal business identity. There are five levels: UNVERIFIED, BASIC (email and domain control), STANDARD (business review), PREMIUM (business review plus operational history) and QUALIFIED (checked against official business registries via an eIDAS QTSP). Do not confuse them with the trust score bands (EXCELLENT, GOOD, ACCEPTABLE, CAUTION, RESTRICTED), which measure a different thing. Agents should only proceed to checkout with merchants above their acceptable threshold on both axes.

### How do I get an Agent API key for autonomous AI agents?

Create a key via POST /api/v1/agent-keys with your JWT. The plaintext key is returned once. Store it securely. Keys follow the format agnt\_xxx. Valid scopes are search, compare, cart, checkout, checkout:delegate, orders:read, merchants:read, protocols:discover; a new key gets search, compare, cart, merchants:read unless you ask for more. Anything outside that list is rejected with a 400.

### Does the API return structured product data compatible with LLMs?

Yes. Product responses include normalized fields: name, description, price, currency, stock status, return policy, and shipping estimate, designed to be passed directly to LLM context windows.

### How do I handle webhooks for order status updates?

Register a webhook URL in Settings > Webhooks. We POST JSON payloads for events: order.created, order.status\_changed, and checkout.abandoned. Verify payloads with the HMAC-SHA256 signature in X-Webhook-Signature.

### Is there an OpenAPI / Swagger spec I can import?

Yes. The full OpenAPI 3.0 spec is at /api/v1/openapi.json. Import it into Postman or Insomnia.

Related resources

[

Protocol Matrix

ACP, AP2, x402, UCP: full comparison

](https://trusteed.xyz/en/protocol-coverage)[

Market Outlook

Agentic commerce data and forecasts

](https://trusteed.xyz/en/outlook)[

For AI Agents

Trust scores, rate limits, and MCP contracts

](https://trusteed.xyz/en/for-agents)[

SDK Quickstarts

Connect from OpenAI Agents, Claude, or Vercel AI SDK in minutes

](https://trusteed.xyz/en/for-agents/sdk-quickstarts)

## Ready to integrate?

Start free today and connect your store to AI agents.

[Get Started](https://trusteed.xyz/en)
