Marketplace
The PayWeave Marketplace is where your paid endpoints become discoverable to agents and humans. Every App route registered through payweave.route(), every Gateway endpoint, every Function, and every paid File is a potential listing. Publishing is semi-automatic: your SDK registers routes as they execute, the platform pulls them when you click Sync endpoints, and the marketplace surfaces them through a single discovery API.
How a listing happens
| Step | Actor | What happens |
|---|---|---|
| 1. Register | Your server (SDK) | payweave.route() adds the route to an in-memory manifest keyed by appId. |
| 2. Expose | Your server (SDK) | payweave.mountSync(app) mounts GET /_payweave/sync returning the manifest. |
| 3. Pull | Platform dashboard | Clicking Sync endpoints calls your /_payweave/sync, writes rows to endpoint_manifest. |
| 4. Publish | Platform API | Rows with discoverable=true + price are exposed via /api/discovery/skills. |
| 5. Discover | Marketplace + agents | Marketplace UI, Skills API, MCP server, LLMs.txt, and AI Plugin all read the same feed. |
What gets published
Only routes created with payweave.route() are registered in the manifest. Routes using the lower-level payweave.charge() middleware are not published — they'll accept payments but stay off the marketplace.
Each listing inherits the following fields from your route definition:
| Field | Source | Used where |
|---|---|---|
| name | route options → name (fallback: description) | Marketplace title, MCP tool name, skill.md header. |
| description | route options → description | Marketplace body, 402 challenge meta, skill.md body. |
| priceUsd | route options → price (string or function) | Marketplace price column, 402 amount, analytics. |
| httpMethod, httpPath | route() arguments | Marketplace endpoint column, OpenAPI spec. |
| inputSchema / outputSchema | route options (Zod or JSON Schema) | OpenAPI spec, MCP input schema, Skills input/output, playground. |
| discoveryConfig | route options → exampleInput, exampleOutput | Playground default payload, Skills example section. |
Making an app discoverable
Discoverability is a per-app toggle stored on the apps table (column discoverable, default true). You control it from the dashboard on an app's Settings tab — toggle it off to keep an app's routes private even after syncing. Individual endpoints inherit the flag from their parent app.
Publishing a listing end-to-end
This is the minimal flow — define a route, mount sync, push Sync from the dashboard. Within seconds the endpoint is live on the marketplace.
import { Hono } from 'hono';
import { Payweave } from '@payweave/hono';
import { z } from 'zod';
const app = new Hono();
const payweave = new Payweave(
process.env.PAYWEAVE_APP_ID!,
process.env.PAYWEAVE_APP_SECRET!
);
payweave.route(app, 'post', '/api/summarize', {
name: 'Text Summarizer',
description: 'Summarize any text to 3 bullet points.',
price: '0.002',
inputSchema: z.object({ text: z.string().min(1) }),
outputSchema: z.object({ bullets: z.array(z.string()) }),
handler: async (_c, body) => ({
bullets: summarize(body.text),
}),
});
// Exposes GET /_payweave/sync so the platform can pull your manifest.
payweave.mountSync(app);
export default app;After deploy:
1. Set your app's domain in Settings → Domain. This is the base URL the platform calls /_payweave/sync on.
2. Open Apps → [your app] → Endpoints and click Sync endpoints. Your routes appear in the table.
3. Visit the marketplace — your endpoint is listed with its price, method, schemas, and a playground.
Consuming the marketplace feed
The marketplace UI, MCP server, AI Plugin, and Skills API all read the same unified discovery endpoint. Agents can query it directly:
curl https://api.payweave.app/api/discovery/skillsThe response is a DiscoveryItem[] array unioning Apps, Gateways, Functions, and Files. See the Discovery → Skills API section for the full shape and filter parameters.
Re-syncing & updates
The sync pull is idempotent — routes are upserted by (appId, httpMethod, httpPath). Change a price or description, redeploy, click Sync endpoints again, and the marketplace reflects the update within seconds. Routes removed from your code disappear from the manifest on the next sync.
mountSync() call is behind a WAF or additional auth, whitelist the platform's sync origin so the pull succeeds.