Step 10 — make x402 actually return 402

Advanced Agentic Commerce: Ship the Full Agent Surface — lesson 12 of 20 (PLAYBOOK)

Publishing /.well-known/x402.json is not enough: the protected route itself must answer HTTP 402 with the full accepts[] set when no X-PAYMENT header is present. If /api/v1 returns 200, the check fails — proxy that path to the paid resource and pass the upstream status through verbatim.

Source: x402 documentation

Previous lesson · Next lesson · Course overview · All courses