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/eventsoperatorsadmin token
GET /api/payment-attempts, POST /api/payment-attempts/{id}/resolveoperatorsadmin token
GET /api/transactions, GET /api/transactions/{id}operatorsadmin token
/mcpagentspayment
/a2a, /.well-known/agent-card.jsonagentspayment; the card is public
/acp/…, /.well-known/acp.jsonagentsbearer token; discovery is public

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

Authentication

SchemeHeaderApplies to
OperatorAuthorization: Bearer <server.adminToken>receipts, events, payment attempts and transactions; 404 when no token is configured
ACPAuthorization: Bearer <protocols.acp.auth.token>every ACP checkout route
x402 paymentPAYMENT-SIGNATURE: <base64 proof>paid resources over HTTP
MPP paymentAuthorization: Payment <credential>resources whose first enabled rail is MPP
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 KiB. The invoke route also accepts plain text or an empty body.
  • Amounts are decimal strings in display units — "0.01", never floats.
  • Timestamps are ISO 8601 strings.
  • Resource invocation outcomes carry a gateway-generated requestId that links logs, events and receipts. A valid client X-Request-Id ([A-Za-z0-9._:-]{1,64}) is logged for correlation; it does not replace the audit ID.
  • Browsers need an origin in server.allowedOrigins; agent traffic gets no CORS headers.
  • Gateway failures use the error envelope; framework errors such as malformed JSON and unknown routes use their own format.