docs: fix Python x402 header and API inconsistencies #79
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
This PR fixes all Python code examples in the documentation to be consistent with the API reference and x402 v2 specification.
Issues Fixed
1. ✅ Uppercase Header Names
Changed all instances of uppercase
PAYMENT-SIGNATUREandPayment-Signatureto lowercasepayment-signature(required by x402 v2 HTTP transport spec).2. ✅ Authorization Header Usage
Replaced old
Authorization: Bearer <token>format with the newpayment-signatureheader format.3. ✅ Deprecated API Methods
Replaced deprecated
payments.requests.isValidRequest()/is_valid_request()with the proper x402 v2 facilitator API:payments.facilitator.verify_permissions()payments.facilitator.settle_permissions()build_payment_required()helperFiles Changed
docs/development-guide/process-requests.mdx- Fixed headers and removed Bearer token logicdocs/development-guide/query-agents.mdx- Fixed 9 header instances and streaming exampledocs/getting-started/quickstart.mdx- Fixed header casedocs/integrate/patterns/charge-credits.mdx- Updated to show proper verify/settle flowdocs/integrate/patterns/validate-requests.mdx- Rewritten to use correct x402 v2 APIdocs/integrate/quickstart/python.mdx- Fixed header casedocs/integrations/google-a2a.mdx- Fixed header referencedocs/integrations/mcp.mdx- Fixed header caseBefore vs After
Before (❌ Incorrect):
After (✅ Correct):
Testing
/docs/api-reference/python/payment-signatureper x402 v2 specRelated
/docs/api-reference/python/directory🤖 Generated with Claude Code