Skip to main content
The discovery API is public, read-only JSON. It needs no API key; requests count against the per-client rate limit. Listings appear here only while their state is published; see Cataloging for how they get there.

List resources

payTo, scheme and network must hold for one and the same payment option: a resource that pays one address on testnet and another on pubnet does not match payTo of the first with network=stellar:pubnet. A filtered resource shows only the payment options that matched, so asking for network=stellar:testnet never returns a pubnet price. Every parameter is validated. A malformed value or an unsupported parameter is refused with HTTP 400 and discovery_invalid_parameter; nothing is silently ignored.
On the hosted service this returns the public demo seller’s HTTP resources (apps/demo-seller). Its POST /translate route also declares the payment-identifier extension, so extensions=payment-identifier returns that resource alone. The responses below show what an item looks like.

One resource on several networks

The catalog keeps one listing per network: a settlement proves a payTo on its own network only, so each network’s listing has its own owner, trust and version history. Discovery shows the listings of one resource as one item. Its accepts holds every network’s payment options, which is how the resource’s own 402 response offers them, and rail402.listings names the listing behind each network. A resource is cataloged on a network once a payment on that network settles through Rail402.

Stable pagination

Resources are returned in catalog order: the order in which each was first published on any network. Every response carries pagination.asOf, the time it was read at; pass it back as asOf with the next offset and the pages of one pagination leave out anything published since, so a new resource never shifts them. A resource withdrawn while you page drops out and moves the later ones up by one. pagination.total is the number of resources that match the filters, read from the same snapshot as the page.

Response

The item shape is x402 v2’s discovery item. Rail402-specific facts are kept under rail402, so a stock client sees exactly the specification’s fields. The example is illustrative: its ids, addresses and timestamps do not come from a recorded run.

Get a listing

Returns one listing, on its one network, as an item in the same shape, with an extra state field (pending, published or quarantined). A quarantined listing is still readable here by its id, but is not listed or searched. An unknown or malformed id returns HTTP 404 with discovery_listing_not_found.

Version history

Every version of the listing, oldest first. Each entry is a full snapshot of what was published. An illustrative example:
cause is settlement, origin_verification, ownership_transfer, domain_verification or quarantine. transaction is present when a settlement caused the version. content uses the catalog’s internal field names (kind for the type, method or toolName, bazaar, accepts, and extensions for the keys of the other declared extensions).

Errors

Discovery errors use the transport error body: