Configure discovery with the CDP SDK
- TypeScript
- Python
For every route written as Your explicit
"METHOD /path", createX402Server:- Adds a minimal
extensions.bazaardeclaration derived from the method and path. - Registers the x402 Bazaar resource-server extension.
- Connects the server to the CDP Facilitator.
GET /report. A wildcard method does not contain enough information for
the SDK to generate discovery metadata.Add richer discovery metadata
The generated declaration is enough for a route without inputs. For any route that accepts query parameters, path parameters, or a request body, we strongly recommend adding explicit schemas and examples — without them, agents can discover your endpoint but can’t construct a valid call. UsedeclareDiscoveryExtension and pass its result as the route’s extensions value:bazaar declaration replaces the minimal declaration generated for that
route. Provide accurate examples and JSON Schemas so buyers and agents can construct valid
requests before paying.For a runnable version, see the
TypeScript Express server example
(APPROACH=3 loads routes from a config file, the same shape used above). Every route it declares
through createX402Server is Bazaar-discoverable automatically. See the
CDP SDK x402 reference for all server configuration
options.Validate your endpoint
After deploying the route to a public HTTPS URL, use the validation endpoint to check that it:- Is reachable.
- Returns
402 Payment Required. - Advertises a valid
extensions.bazaarblock. - Would be accepted by the CDP Facilitator for indexing.
valid: true and
simulation.outcome: "accepted". Review preflight for required failures and advisory
recommendations, and inspect bazaarExtension to confirm the metadata served by your
endpoint.
For the complete request and response schema, see
Validate x402 endpoint.
Get featured: curation tiers
Every validated endpoint is eligible for indexing in the CDP Bazaar after a successful settled payment. A hand-selected slice of the highest-quality endpoints is additionally curated and featured to buyers and agents. Curation is how you go from indexed to distributed. Curation is separate from ranking. Ranking orders results within the Bazaar based on real economic usage and listing quality over a rolling 30-day window; new endpoints rank conservatively until usage accrues.Requirements for curation
Meeting these qualifies an endpoint for review — listing remains editorial, based on service quality, category coverage, and ecosystem fit.Staying curated
Curated endpoints are health-probed on a regular interval. An endpoint that fails consecutive probes is first down-ranked and then dropped from the featured tier; it remains discoverable in the general Bazaar and is automatically restored once it recovers. Endpoints that stop returning402 Payment Required are eventually removed from the index
entirely.
Get discovered checklist
Complete these steps before you expect your route to appear in the Bazaar:- Deploy your route to a public HTTPS URL.
- Validate the endpoint.
- For routes that accept inputs, add schemas and examples.
- Complete a successful paid call through the CDP Facilitator.
Troubleshooting discovery
How do I tell whether my discovery metadata was accepted?
How do I tell whether my discovery metadata was accepted?
The CDP Facilitator reports the outcome on verify and settle responses in an
EXTENSION-RESPONSES header. The value is base64-encoded JSON keyed by extension name, and the
bazaar key carries a status of success, processing, or rejected:Rejections are usually strict JSON Schema validation: your declared
input must validate
against schema.properties.input. The settle request also has to carry
paymentPayload.resource, because without it the Bazaar has no resource to attach the
metadata to.Many different URLs collapsed into a single Bazaar entry
Many different URLs collapsed into a single Bazaar entry
The Bazaar normalizes any path segment that consists entirely of a high-cardinality
identifier: a UUID, an EVM address, an EVM transaction hash, a Solana address, or a Solana
transaction hash. Each such segment becomes a generic route template parameter, so
/data/0xabc.../report and /data/0x123.../report surface as one entry rather than two.To keep each resource listed separately, add a prefix or suffix so the segment is not a bare
identifier, such as /user-<uuid> instead of /<uuid>.My ranking has not moved since my last payment
My ranking has not moved since my last payment
Quality metrics (buyer reach, transaction volume, and recency) are recomputed on a six-hour
schedule, so a newly settled payment does not change your position right away. Allow up to six
hours for a ranking change to appear in search results.
My endpoint dropped out of the Bazaar
My endpoint dropped out of the Bazaar
Resources that go 30 days without a settlement are removed from both the catalog and search
results, so a listed route needs ongoing traffic to stay listed. Availability matters
separately: see Staying curated for the health probe behavior that
down-ranks and then removes endpoints that stop responding.
My endpoint is indexed but ranks poorly
My endpoint is indexed but ranks poorly
Ranking weighs listing quality alongside real usage. Three things are under your control:
- Description. Write a natural-language description of what the endpoint does and when to call it. Bare endpoint names and placeholder text score zero on metadata quality. Keep it to 500 characters or fewer, because the CDP Facilitator rejects verify and settle requests whose description exceeds that limit.
- Schemas and examples. Complete input and output schemas with realistic examples raise metadata quality and let an agent construct a valid request without guessing.
- Hosting. Resources on shared tunneling domains such as
ngrok.ioare weighted below those on dedicated domains, and results are capped per domain so no single provider floods a query.
I want a paid route to stay out of the Bazaar
I want a paid route to stay out of the Bazaar
Only routes that declare Bazaar metadata are indexed. In Python, discovery is opt-in, so a
route stays unlisted as long as you do not declare metadata for it. In TypeScript,
createX402Server derives a declaration for every route key written as "METHOD /path", so
keeping a paid route unlisted means assembling that server from the @x402 packages directly
instead.How do I test discovery before going to mainnet?
How do I test discovery before going to mainnet?
Run against the CDP Facilitator on Base Sepolia or Solana Devnet. The same discovery endpoints
surface testnet resources once verify and settle have run through CDP. The
x402.org facilitator maintains its own separate catalog, which
is not the CDP Bazaar.