Protocol Integration
x402 Integration
x402 integration via response header and payment metadata.
This section is advisory.
x402 uses HTTP 402 responses to negotiate payments. Legal context can be included in the response header and in payment metadata.
Response Header
X-ALC-Hash: 0x7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069The X-ALC-Hash header carries the content hash in the 402 response (proposal phase). The agent can verify the terms before proceeding with payment.
Payment Metadata
In payment metadata, use the alc: prefix format:
alc:sha256:0x7f83b165...Integration Flow
- Service returns 402 with
X-ALC-Hashheader containing thecontentHash - Agent fetches the terms document from the URL known via
/.well-known/legal-context.json(discovered earlier) - Agent computes SHA-256 of the downloaded document and compares to the
X-ALC-Hashvalue - If match, agent saves the document locally and proceeds with payment
- Resource delivered with the same hash reference in the receipt