Overview

API reference

The gateway's HTTP surface: agent routes, public discovery, operator routes and protocol mounts.

The gateway serves JSON over HTTP at merchant.publicBaseUrl http://localhost:8080 in every example below. Routes split by audience, and the split is enforced.

Routes

RouteAudienceAuth
GET /health, GET /readyprobesnone
GET /.well-known/agent-commerceanyonenone
GET /api/resourcesanyonenone
POST /api/resources/{id}/invokeagentspayment, not authentication
GET /api/receiptsoperatorsadmin token
GET /api/events, /streamoperatorsadmin token
/mcpagentspayment
/a2a, /.well-known/agent-card.jsonagentspayment
/acp/…, /.well-known/acp.jsonagentsbearer token

A2A and ACP routes exist only while those protocols are enabled.

Authentication

SchemeHeaderApplies to
OperatorAuthorization: Bearer <server.adminToken>receipts and events; 404 when no token is configured
ACPAuthorization: Bearer <protocols.acp.auth.token>every ACP checkout route
PaymentPAYMENT-SIGNATURE: <base64 proof>paid resources over HTTP
MandateAgent-Authorization: <base64url envelope>resources that require AP2

Tokens are compared in constant time. A token is never accepted as a query parameter.

Conventions

  • Request bodies are JSON (content-type: application/json), capped at 256 KB.
  • Amounts are decimal strings in display units — "0.01", never floats.
  • Timestamps are ISO 8601 strings.
  • X-Request-Id is accepted as [A-Za-z0-9._:-]{1,64}; every outcome carries a requestId that also appears in logs, events and receipts.
  • Browsers need an origin in server.allowedOrigins; agent traffic gets no CORS headers.
  • Failures use one error envelope.