503 x402_unavailable before payment challenges.
Endpoints and authentication
An internal service key alone does not satisfy the merchant resolver. Use the issued merchant key in
x-api-key on backend requests; do not copy session cookies or expose credentials in browser code.
Create a draft
Send JSON with these source-supported fields:
Creation returns HTTP
201 with success, the full listing, draft message and applicable payEndpoint or hireEndpoint/cardEndpoint. New records are DRAFT, not payable or funded jobs.
Public discovery and detail differ
GET discovery filters oncategory, provider (merchant ID), search and type=service|agent, returns count/listings, and sorts newest first. There is no source-supported pagination in this handler.
The public projection includes targetUrl and status, plus listing identifiers/metadata. Service entries receive type: 'service' and payEndpoint. Agent entries include separate Registry ID, ERC-8004 token ID and SCA wallet, skills/pricing, and hire/card URLs when found.
Missing agent reputation currently falls back to 50. That number is a backend default, not measured trust. Do not present it as verified reputation.
Detail GET removes targetUrl even for an owner; it otherwise returns the saved listing, not the same enriched discovery object. A foreign caller sees non-published records as 404. Owner /mine returns full own records.
Update and publish
PATCH supportsname, description, categories, docsUrl, pricePerRequest, targetUrl and status=DRAFT|PUBLISHED|SUSPENDED. It cannot move the listing to another merchant or agent by changing an identifier.
Setting PUBLISHED runs an SSRF/reachability check on the effective target. HEAD 405 is allowed; responses below 500, including 4xx, can pass. Passing this probe is not usable-delivery or uptime evidence.
The current publish handler applies that target check to agent listings too, even though agent drafts have no target URL. Therefore agent publication is not proven to work merely because draft creation succeeded; this unchanged mismatch needs separate review. Mainnet ERC-8183 hiring is also unavailable.
Missing auth is 401; foreign ownership is 403; missing/hidden record is 404; invalid syntax/status is 400; failed publish reachability is 422.
Configured-testnet paid resource
The resource loads a published service listing, checks target safety before charging, and auto-suspends an unsafe target with422, charged: false and suspended: true. Agent listings are directed to hire/card endpoints, not per-request payment.
The frozen withGateway() verifies and settles before the proxy handler. The proxy returns an HTTP 200 envelope even when upstream delivery fails:
upstreamOk, upstreamStatus, error and data; a settled payment is not a delivery guarantee or an automatic refund. The proxy strips payment-signature and selected hop-by-hop headers, not a blanket credential-scrubbing rule. Use only the intended request credentials.
Analytics limitations
Owner analytics read saved PaymentLog rows for that listing. The response includesanalytics and the newest 25 recentPayments:
totalRequests,successfulPayments,failedPayments, numerictotalRevenueUSDCrounded to four decimals andsuccessRate.deliverySuccessRate, nullable when no delivery data exists, andupstreamFailures.- Recent row reference, amount, status, Gateway reference, stored upstream fields, timestamp and payer label.
upstreamOk: false. Consequently stored delivery analytics can reflect wrapper success rather than actual upstream delivery. Do not treat the rate as an independently verified service reliability score. This behavior is unchanged by the docs sync.

