Make an unauthenticated request to the protected resource endpoint
On receiving a 402 response, decode the base64-encoded JSON from the PAYMENT-REQUIRED response header to extract payment requirements (network, asset, amount, payTo, scheme)
Construct and sign the payment object according to the required scheme (e.g., EVM-compatible signature over the payment payload)
Retry the original request with the signed payment encoded in the PAYMENT-SIGNATURE request header
On success, read the PAYMENT-RESPONSE response header which contains the base64-encoded settlement confirmation from the server
Store or forward the settlement confirmation as proof of payment for auditing or idempotency checks
Known gotchas
Payment requirements are in the PAYMENT-REQUIRED response header (base64 JSON), NOT in the response body — parsers that read the body will find nothing
The signed payment must go in the PAYMENT-SIGNATURE request header on the retry, not in an Authorization header or request body
Settlement confirmation arrives in the PAYMENT-RESPONSE response header; failing to capture it means losing proof of the completed payment
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp