44 Commits

Author SHA1 Message Date
mintlify[bot]
ba1a65af3e
Document ResourceServerExtension hooks property (#2114)
* Update docs/extensions/overview.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/extensions/overview.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/extensions/overview.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/advanced-concepts/lifecycle-hooks.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-04-24 13:51:49 +09:00
mintlify[bot]
85f6123f30
Update docs/sdk-features.md (#2105)
Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-04-23 15:16:25 +09:00
Ethan Oroshiba
71a223d35a
feat: add MCP Bazaar discovery support across TypeScript, Python, and Go SDKs (#2087)
* add mcp discovery support

* ci fixes and changelog

* rename changelog

* fix failing test

* fail in TS on transport mismatch, return extension info on settlement failure in python

* add e2e

* fix mcp payment payload parsing

* fix python parsing

* add transport to examples and docs
2026-04-22 11:50:32 -07:00
Ryan R. Fox
5543700fd7
docs: add Documentation Checklist + surface chain-contribution flow (#2049)
* docs: add Documentation Checklist + surface chain-contribution flow

DEFAULT_ASSETS.md's 'Adding a New Chain' numbered flow stopped at 'Update
all three SDKs' → 'Submit a PR' and did not mention the user-facing docs
surfaces that also enumerate every chain with default-asset support. As a
result, recent onboarding PRs have shipped with stale docs (e.g. the
Radius PR #2038 updated the SDKs but not the docs table or Go README).
The existing Cross-SDK Checklist at the bottom enumerates only the three
code registries, mirroring the same gap.

network-and-token-support.mdx has a parallel discoverability problem:
the pointer to DEFAULT_ASSETS.md used a repo-relative path that resolves
to a broken link on docs.x402.org, and the pointer sat inside the
'Default Assets for Dollar-String Pricing' intro rather than under
'Adding Support for New Networks' where a would-be contributor actually
looks. The 'Adding' section itself described only runtime registration
(server.register from consumer code) and did not mention the separate
upstream-contribution path, and it also contained a 'Running Your Own
Facilitator' subsection that is about facilitator infrastructure, not
about adding networks — a topical mismatch. The page also ordered the
'Facilitators' section before 'Adding Support for New Networks', which
inverts the natural read → use → extend → operate narrative.

Changes:

  * DEFAULT_ASSETS.md:
      - Promote 'Update user-facing documentation' to a numbered step in
        'Adding a New Chain' (new step 3, between 'Update all three SDKs'
        and 'Submit a PR'), with a cross-reference to the new checklist.
      - Append a new 'Documentation Checklist' section below the existing
        Cross-SDK Checklist, naming the two hot docs surfaces
        (network-and-token-support.mdx and go/mechanisms/evm/README.md)
        that must also be updated on a new chain onboarding.

  * docs/core-concepts/network-and-token-support.mdx:
      - Remove the oddly-placed 'See DEFAULT_ASSETS.md' link from the
        Dollar-String Pricing intro; replace with an in-page anchor
        pointing at the new contribution subsection.
      - Split 'Adding Support for New Networks' into two subsections:
        'Runtime Registration' (the existing content, unchanged) and
        a new 'Contributing a New Default Asset' subsection that links
        to DEFAULT_ASSETS.md via an absolute github.com URL (so the
        link works on the published docs site) and explicitly names
        the cross-SDK + docs checklist.
      - Move 'Running Your Own Facilitator' out of 'Adding Support for
        New Networks' into the existing 'Facilitators' section, where
        it belongs topically.
      - Swap top-level section order: 'Adding Support for New Networks'
        now precedes 'Facilitators', matching the read → use → extend →
        operate narrative.

No code changes. Documentation only.

* docs: revert DEFAULT_ASSETS.md, unify SDK READMEs to link docs

Address review feedback: the Mintlify agent (.github/workflows/update-docs.yml)
keeps docs/ in sync with code, so contributors should only update the three SDK
constants files. Remove the Documentation Checklist and Step 3 from
DEFAULT_ASSETS.md. Apply a consistent two-link block to all three SDK READMEs
(Go/TS/Python) pointing at the mdx default-assets list and the mdx
Adding Support for New Networks section. Soften the mdx Contributing a New
Default Asset blurb to drop manual mdx/README update instructions.
2026-04-21 12:45:06 +09:00
Ethan Oroshiba
d298e14211
add python upto to docs (#2065) 2026-04-20 14:22:07 +09:00
mintlify[bot]
a862793170
Update docs/sdk-features.md (#2052)
Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-04-17 18:16:08 +09:00
mintlify[bot]
11206b0fe4
Add Algorand (AVM) support to documentation (#1993)
* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/sdk-features.md

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/sdk-features.md

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-04-14 02:56:30 +09:00
VIkions
74a9e8e65e
docs(sellers): replace legacy Go import path in Echo example (#2009) 2026-04-13 08:51:53 +09:00
phdargen
cdf3a76c08
improve defaultAsset docs (#1983) 2026-04-10 10:23:46 -07:00
mintlify[bot]
5df77caa01
Add Echo framework documentation (#1783)
* Update docs/sdk-features.md

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* add fastify

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Philippe d'Argent <p.dargent@cern.ch>
2026-04-10 10:23:28 -07:00
Carson Roscoe
81dba6473f
feat: added upto to docs (#1961) 2026-04-08 23:49:52 +09:00
Carson Roscoe
2250caec83
feat: refactor coinbase/x402 references to x402-foundation/x402 (#1912)
* feat: refactor coinbase/x402 references to x402-foundation/x402

* fix: format

* chore: changeset fragments for typescript, python and go
2026-04-02 12:59:07 -07:00
mintlify[bot]
c6fa51b9cb
Add net/http support to Go SDK docs (#1782)
* Update docs/sdk-features.md

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-30 15:59:28 +09:00
mintlify[bot]
3662a353c3
Update docs/sdk-features.md (#1848)
Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-30 15:28:40 +09:00
mintlify[bot]
33de0ea114
Add Fastify adapter documentation (#1788)
* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-30 15:17:19 +09:00
mintlify[bot]
7afc39f22d
Update docs/extensions/bazaar.mdx (#1836)
Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-27 23:37:37 +09:00
erikreppel-cb
170f5c0889
Update website copy (#1767) 2026-03-23 09:16:13 -07:00
mintlify[bot]
c90f52ecde
Update docs/extensions/bazaar.mdx (#1768)
Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-24 01:01:44 +09:00
Carson Roscoe
53ba5b0203
feat: gitbooks permit2 python (#1689)
* feat: add permit2 and gas sponsorship extensions to gitbooks

* feat: added permit2 python sdk changes to gitbooks

* fix: pr feedback
2026-03-19 13:09:31 -07:00
Carson Roscoe
c2de525a79
fix: Solana spec links (#1683) 2026-03-18 16:58:18 -07:00
mintlify[bot]
26d651d842
Document SIWX auth-only routes (#1653)
* Update docs/extensions/sign-in-with-x.mdx

Generated-By: mintlify-agent

* Update docs/extensions/sign-in-with-x.mdx

Generated-By: mintlify-agent

* Update docs/extensions/sign-in-with-x.mdx

Generated-By: mintlify-agent

* Update docs/extensions/sign-in-with-x.mdx

Generated-By: mintlify-agent

* Update docs/extensions/sign-in-with-x.mdx

Generated-By: mintlify-agent

* Update docs/extensions/sign-in-with-x.mdx

Generated-By: mintlify-agent

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-17 18:55:30 +09:00
Alfred Tom
30e0160797
docs: add extensions overview and signed offers & receipts guide (#1617)
* docs: add extensions overview and signed offers & receipts guide

- Add extensions/overview.mdx documenting the extension system
- Add extensions/offer-receipt.mdx
- Add offer-receipt row to sdk-features.md
- Update docs.json navigation with new pages in alphabetical order

* Refined the link to the ecosystem page.
2026-03-16 10:20:03 +09:00
mintlify[bot]
516f55f66a
Add Stellar blockchain support documentation (#1451)
* Update docs/sdk-features.md

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-10 10:17:19 +09:00
Notorious D.E.V.
7cd93d8bf5
Add in-memory cache for in-flight Solana txs (#1468)
* fix: add duplicate settlement mitigation for SVM across all SDKs

Introduce an in-memory SettlementCache to prevent a race condition on
Solana where the same payment transaction could be settled multiple
times before on-chain confirmation. The cache is shared across V1 and
V2 facilitator schemes so that cross-version duplicates are caught.

- Add SettlementCache with 120s TTL in TypeScript, Python, and Go
- Integrate cache check into facilitator settle paths (V1 and V2)
- Add unit tests for duplicate detection in all three languages
- Share cache across V1/V2 in Go facilitator example
- Add duplicate settlement spec to scheme_exact_svm.md
- Document SettlementCache in SVM READMEs for all three SDKs
- Document the race condition in go/FACILITATOR.md Security section
- Add merchant-facing guidance in docs/core-concepts/client-server.md
  and docs/core-concepts/facilitator.md for self-settling servers
- Fix JSDoc lint errors in TypeScript settlement-cache.ts

* refactor: optimize SettlementCache prune with early break on ordered entries

Leverage insertion-order guarantees of Map (TS) and dict (Python) to
break early once a non-expired entry is encountered, avoiding a full
scan of the cache on every isDuplicate call. Go is left unchanged since
map iteration order is not guaranteed.

Also adds prune-specific unit tests for all three SDKs covering:
- mixed expired/fresh entries
- all expired
- none expired
- insertion-order early-break correctness (Python)

* docs: add changelog entries for SVM duplicate settlement fix
2026-03-05 16:16:09 -08:00
mintlify[bot]
23897bfd5c
Update docs/faq.md (#1423)
Generated-By: mintlify-agent

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-03 15:07:22 +09:00
mintlify[bot]
1ae9e24fa2
Document Go OnProtectedRequest hook (#1422)
* Update docs/advanced-concepts/lifecycle-hooks.mdx

Generated-By: mintlify-agent

* Update docs/sdk-features.md

Generated-By: mintlify-agent

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-03 13:37:15 +09:00
mintlify[bot]
0c09ec1ca3
Document Go SDK Bazaar facilitator client (#1418)
* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

* Update docs/sdk-features.md

Generated-By: mintlify-agent

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-03-03 12:34:50 +09:00
mintlify[bot]
e8680beb52
Add Go SDK support to payment-identifier docs (#1253)
* Update docs/sdk-features.md

Generated-By: mintlify-agent

* Update docs/extensions/payment-identifier.mdx

Generated-By: mintlify-agent

* Update docs/extensions/payment-identifier.mdx

Generated-By: mintlify-agent

* Update docs/extensions/payment-identifier.mdx

Generated-By: mintlify-agent

* Update docs/extensions/payment-identifier.mdx

Generated-By: mintlify-agent

* fix conflicts

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Philippe d'Argent <p.dargent@cern.ch>
2026-03-02 17:09:54 -08:00
mintlify[bot]
53a0ce245b
Update PAYMENT-RESPONSE header documentation (#1366)
* Update docs/core-concepts/http-402.md

Generated-By: mintlify-agent

* Update docs/core-concepts/client-server.md

Generated-By: mintlify-agent

* Update docs/core-concepts/facilitator.md

Generated-By: mintlify-agent

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-02-27 11:34:57 +09:00
mintlify[bot]
1428bfaeb4
Pull request for mintlify/docs-update-1771606452015 (#1267)
* Update docs/getting-started/quickstart-for-sellers.mdx

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/guides/mcp-server-with-x402.md

Generated-By: mintlify-agent

* Update docs/guides/mcp-server-with-x402.md

Generated-By: mintlify-agent

* update to builder pattern

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Philippe d'Argent <p.dargent@cern.ch>
2026-02-23 19:23:18 -08:00
Notorious D.E.V.
5cbeb0b781
docs: update x402.org docs for v2 protocol changes and SVM support (#1305)
Update documentation across core concepts, quickstarts, FAQ, and extensions
to reflect v2 protocol changes including PAYMENT-REQUIRED header, CAIP-2
network identifiers, SVM/Solana support, and ecosystem link fixes.
2026-02-23 18:20:34 +09:00
Yu Cheng Tsai
9c29945bfe
Fix wrong links in documentation (#1115)
* Update links in facilitator.md to include file extensions

* Fix links in client-server documentation

Update links to use the correct file paths.
2026-02-23 13:47:35 +09:00
mintlify[bot]
d300c31948
Add MCP tool support to Bazaar extension docs (#1256)
* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

* Update docs/extensions/bazaar.mdx

Generated-By: mintlify-agent

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-02-23 12:34:18 +09:00
mintlify[bot]
eec8f9046b
Add Aptos support to documentation (#1254)
* Update docs/sdk-features.md

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

* Update docs/core-concepts/network-and-token-support.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

* Update docs/getting-started/quickstart-for-buyers.mdx

Generated-By: mintlify-agent

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-02-23 12:33:03 +09:00
mintlify[bot]
eba42dc5b4
Add Python support to payment-identifier docs (#1165)
* Update docs/sdk-features.md

* Update docs/extensions/payment-identifier.mdx

* Update docs/extensions/payment-identifier.mdx

* Update docs/extensions/payment-identifier.mdx

* Update docs/extensions/payment-identifier.mdx

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-02-23 12:29:11 +09:00
mintlify[bot]
6a99ba028b
Add payment-identifier extension documentation (#1097)
* Update docs/sdk-features.md

* Update docs/extensions/payment-identifier.mdx

* Update docs/docs.json

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-02-05 16:28:52 -08:00
mintlify[bot]
57fe12b07e
Add Sign-In-With-X extension documentation (#1071)
* Update docs/sdk-features.md

* Update docs/extensions/sign-in-with-x.mdx

* Update docs/docs.json

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-02-06 08:46:03 +09:00
phdargen
61d637636b
Added hooks to docs (#1026)
* added hooks to docs

* add links to quickstarts

---------

Co-authored-by: Faris Habib <faris.habib@coinbase.com>
2026-01-28 09:29:17 -08:00
phdargen
b8653dc7d7
Sdk features doc (#1027)
* add sdk features doc

* add frameworks
2026-01-28 09:28:38 -08:00
mintlify[bot]
3b7772c2dd
Document onPaymentRequired client hook (#1019)
* Update docs/getting-started/quickstart-for-buyers.mdx

* Update docs/getting-started/quickstart-for-buyers.mdx

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Faris Habib <faris.habib@coinbase.com>
2026-01-24 08:11:36 +09:00
Faris Habib
fa2149cb8d
Update Facilitator language and link to ecosystem page (#1013)
* make facilitator mentions neutral

* update language

* update langauge

* Update docs/core-concepts/bazaar-discovery-layer.mdx

Co-authored-by: phdargen <pdargent@icloud.com>

---------

Co-authored-by: phdargen <pdargent@icloud.com>
2026-01-24 07:51:17 +09:00
Faris Habib
0bba14b2af
Migrate to mintlify (#925)
* migrate to mintlify

* rename README.md to introduction.md for Mintlify compatibility

* add vercel starter kit to docs

* update descriptions

* fix links

* fix legacy link

* nit

* adjust instructions for mintlify agent

* Update to use github api to detect code changes

* fix links

* fix links

* exclude website

* update facilitator token support

* update docs link

* fix minor linting

* update package paths, exlucde legacy

* update docs for python v2 sdk
2026-01-22 12:16:19 -08:00
Carson Roscoe
30a847d7d1
feat: New Python SDK with v2 support (#841)
* chore: renamed python/x402 to python/legacy

* feat: initial Python core SDK

* feat: added core HTTP wrappers

* feat: added core types

* feat: added evm mechanism for exact v1/v2

* feat: added httpx client

* feat: added requests client

* feat: added fastapi middleware

* feat: added flask middleware

* feat: added integration tests

* feat: added Python SDK to e2e tests

* python-v2: fix workflow checks (#863)

* fix format

* fix lint

* fix build

* fix pytest

* Fix syntax errors and missing imports in manual integration example (#902)

- Add missing imports (base64, json, Response, JSONResponse, PaymentPayload, FacilitatorClient)
- Fix function signature syntax error
- Fix dict initialization syntax (colon to equals)
- Add missing return statement after successful payment
- Remove trailing whitespace

* feat: add Python SDK v2 server examples (FastAPI, Flask)  (#879)

* feat: add fastapi example project configuration

* feat: add fastapi example with x402 payment middleware

* docs: add comprehensive README for fastapi example

* feat: add flask example project configuration

* feat: add flask example with x402 payment middleware

* docs: add comprehensive README for flask example

* feat: add test clients for fastapi and flask examples

* docs: add test client usage to READMEs

* chore - remove python-version and test-client.py

* docs - remove test client guide from README.md

* chore - remove license and classifier

* feat - add description and mime type

* feat - update .env-local

* feat: add Python v2 client examples (httpx & requests) (#857)

* feat: add Python v2 client examples (httpx & requests)

Add simple client examples demonstrating httpx (async) and requests (sync) usage with the x402 Python v2 SDK.

- examples/python/clients/example.py - Simple example showing both httpx and requests
- Uses EthAccountSigner with register_exact_evm_client helper
- Minimal configuration required

* refactor: split Python client examples into separate directories

Address PR review feedback:
- Separate httpx/ and requests/ directories
- Add pyproject.toml for uv sync support
- Add environment variable validation
- Add payment response header extraction
- Use context manager for requests session cleanup

Tested on Base Sepolia testnet:
- httpx: tx 0xce49f668aba01c4b0b1af2eb0d9a381f4c62295506a91f20af479e0e834ef350
- requests: tx 0xb83b6feefa5a744b7779ba5b37df33f9c7241f58119454d66102acd97a92f024

* Update examples/python/clients/httpx/main.py

Co-authored-by: phdargen <pdargent@icloud.com>

* Update examples/python/clients/requests/main.py

Co-authored-by: phdargen <pdargent@icloud.com>

---------

Co-authored-by: phdargen <pdargent@icloud.com>

* feat(python): Make v2 framework and client dependencies optional extras (#901)

* python-v2: add svm mechanism (#904)

* add svm mechanism

* add unit tests

* add integration tests

* update server examples

* add e2e tests

* update clients

* make EVM/SVM dependencies optional extras

* fix legacy uv paths

* V2 python bazaar (#929)

* add bazaar extension

* strip query params for discovery

* fix 862

* updated e2e tests

* Add advanced Python client examples (#947)

* Add advanced Python client examples

Implements 5 advanced patterns demonstrating x402 SDK v2 features:
- hooks.py: Payment lifecycle hooks (before, after, failure)
- preferred_network.py: Custom network preference selector
- builder_pattern.py: Network-specific registration with wildcards
- error_recovery.py: Error classification and recovery strategies
- custom_transport.py: Custom httpx transport with retry/timing

Includes:
- CLI entry point (index.py) for running examples
- Comprehensive test suite (40 unit tests)
- E2E integration tests
- README documentation

All tests passing.

* Remove tests and examples beyond TypeScript SDK parity

Address PR review feedback:
- Remove tests directory (tests belong in SDK, not examples)
- Remove custom_transport.py (runtime error, beyond TS parity)
- Remove error_recovery.py (duplicate of hooks.py, beyond TS parity)
- Update index.py, README.md, pyproject.toml accordingly

* Address PR feedback: add SVM support and use optional deps

- Update pyproject.toml to use x402[evm,svm,httpx] instead of
  listing dependencies separately
- Add Solana/SVM network examples to preferred_network.py
- Support both EVM and SVM signers for cross-chain flexibility
- Update .env-local with SOLANA_PRIVATE_KEY option

* Python-v2: facilitator example + e2e (#950)

* add facilitator example

* improve svm signer

* add description to DiscoveredResource

* add facilitator e2e

* add paywall builder (#953)

* Add Python custom client example (#954)

Demonstrates manual x402 v2 payment flow without convenience wrappers.

Shows the 6-step process:
1. Initialize client and register payment schemes
2. Make initial request, receive 402
3. Decode PAYMENT-REQUIRED header
4. Create signed payment payload
5. Retry with PAYMENT-SIGNATURE header
6. Handle success/failure response

Useful for integrating with non-standard HTTP libraries or implementing
custom retry logic.

* feat(v2-sdk): support async dynamic hooks for price and metadata (#900)

* feat(http): implement dual class design for sync/async support

- Add x402HTTPResourceServer (async) for FastAPI/Starlette
- Add x402HTTPResourceServerSync (sync) for Flask/Django
- Share common logic via _x402HTTPServerBase
- Remove dynamic description/resource (keep only dynamic price/payTo)
- Update Flask middleware to use sync server directly
- Integrate with enrich_extensions for bazaar support
- Add per-route hook_timeout_seconds configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(types): add missing Awaitable import and fix test import sorting

- Add Awaitable import to types.py for DynamicPayTo/DynamicPrice type hints
- Fix import block sorting in test_async_hooks.py and test_core.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: simplify API by removing unused types and making timeout opt-in

Address reviewer feedback from @phdargen:
- Remove SyncDynamicPayTo/SyncDynamicPrice (unused types that would require SyncPaymentOption to be useful)
- Change hook_timeout_seconds default to None (opt-in, matching TS/Go parity)
- Export x402HTTPResourceServerSync from http/__init__.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* python-v2: make create_facilitator_config work with both V1 and V2 (#968)

* make create_facilitator_config work with both V1 and V2

* fix lint

* feat: add Python SDK v2 server advanced example (FastAPI) (#952)

* feat - add pyproject.toml, uv.lock for advanced example

* feat - add bazaar extension

* feat - add hooks

* feat - add x402 extensions to pyproject.toml

* feat - add dynamic pricing feature

* feat - add dynamic pay-to and custom money parser features

* docs - add README for advanced server example

* style - apply lint

* chore - add comments for bazaar extension code

* fix: python v2 x402HTTPAdapter retry logic (#978)

* fix: fix consecutive payment bug in x402HTTPAdapter

- Replace instance-level _is_retry flag with per-request header
  to prevent state leakage between consecutive 402 requests.

* tests - add test case for consecutive payment with x402HTTPAdapter

* style - apply lint

* Python-v2: async lifecycle hooks (#975)

* add dual sync/async classes for server/client/facilitator

* update integration/e2e tests

* add unit tests for core, http and implement wrapHttpxWithPaymentFromConfig/wrapRequestsWithPayment

* refactor core server/client/facilitator

* refactor x402_http_server/facilitator_client/x402_http_client

* update exmamples

* add utility function that takes care of html-safe escaping

* add sdk readmes

* add retry unit tests to httpx client

* Update Python SDK Docs for v2 (#976)

* Porting docs and updating for v2 changes (#813)

* porting docs and updating for v2 changes

* update quickstart for sellers

* update quickstarts, miniapps, and mcp docs

* update doc links

* update FAQs

* fix getting started docs

* update core concepts

* remove miniapps guide

* update extensions

* fix bazaar code examples

* fix broken links and yaml file

* remove unnecessary protocol layer doc

* add migration guide

* update documentation for python v2 sdk

* testing pr preview

* docs(python): remove unused os imports and align with TS tab patterns

- Remove unused 'import os' from FastAPI and Flask examples in quickstart-for-sellers
- Update bazaar-discovery-layer Python example to use hardcoded '0xYourPrivateKey' to match TypeScript tab consistency

* update migration doc

* cleanup comments

* cleanup readme

* fix: Python facilitator e2e code

* fix: lint

---------

Co-authored-by: phdargen <p.dargent@cern.ch>
Co-authored-by: somesome <57699892+sohw400@users.noreply.github.com>
Co-authored-by: Logan Kang <kcs93023@gmail.com>
Co-authored-by: 1bcMax <viewitter@gmail.com>
Co-authored-by: phdargen <pdargent@icloud.com>
Co-authored-by: Vladimir Sotnikov <bubert9@gmail.com>
Co-authored-by: Shuhei <shuhei0866@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Faris Habib <faris.habib@coinbase.com>
2026-01-21 16:32:07 -08:00
Faris Habib
6cfee2e096
Porting docs and updating for v2 changes (#813)
* porting docs and updating for v2 changes

* update quickstart for sellers

* update quickstarts, miniapps, and mcp docs

* update doc links

* update FAQs

* fix getting started docs

* update core concepts

* remove miniapps guide

* update extensions

* fix bazaar code examples

* fix broken links and yaml file

* remove unnecessary protocol layer doc

* add migration guide
2025-12-18 16:46:56 -08:00