docs: 402 body now mirrors the x402 challenge (x402Version, accepts) - #67
Closed
VickyXAI wants to merge 2 commits into
Closed
docs: 402 body now mirrors the x402 challenge (x402Version, accepts)#67VickyXAI wants to merge 2 commits into
VickyXAI wants to merge 2 commits into
Conversation
added 2 commits
August 30, 2026 21:39
BlockRun's 402 responses now spread x402Version/accepts at the top level of the JSON body, not just the signed headers — v1-era x402 clients that only parse the body were silently failing to auto-pay. Updates every endpoint doc's 402 example plus the x402 protocol pages to match.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BlockRun's gateway now spreads
x402Version/acceptsat the top level of every402JSON body, in addition to the signedPAYMENT-REQUIRED/X-Payment-Required/WWW-Authenticateheaders — see BlockRunAI/blockrun#TBD for the code change. Pre-v2-era x402 clients (earlyx402-fetch/x402-axios, third-party wrappers) only ever parsed the body and, finding no top-levelaccepts, silently gave up instead of auto-paying.This PR brings every doc's 402 example in line with the new body shape:
docs/api-reference/errors.md— canonical 402 shape + new explanatory paragraphdocs/x402/payment-flow.md— the "402 Response" step now shows the mirrored fields, with a note on what the headers carry that the body mirror omits (resource,extensions)docs/x402/how-it-works.md— one-line update to the "requirements are base64-encoded..." paragraphWhile touching
docs/api-reference/responses.mdI also picked up an upstream fix already onmain(fee-inclusiveprice.amountwording) via the merge — no separate action needed, just noting it so the diff isn't a surprise.Not in this PR
.gstack/*local browse-session artifacts have unrelated pre-existing local diffs on this machine and are left out.Test plan
blockrunPR (code + tests) merges around the same time so the two stay in sync