{"uid":"cap_B82ZfmAOM1JQxiBanXIae","slug":"x402-doctor-fix-broken-x402-endpoint-3ff6827d","name":"x402 Doctor - Fix Broken x402 Endpoint","description":"How do I fix my broken x402 endpoint? Diagnoses it, then returns per problem the concrete change as code for your stack (Express, Next.js, Hono or raw HTTP), filled in with your own payTo, amount, network and route.","url":"https://x402-doctor.fizzl.eu/api/v1/fix?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Your x402 endpoint (public http(s) URL)."},"stack":{"enum":["express","next","hono","node","python","generic"],"type":"string","description":"Your stack, if detection from response headers is wrong. Default: detected."},"method":{"enum":["GET","POST"],"type":"string","description":"HTTP method of the endpoint. Default: try GET, then POST."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["url","fixes"],"properties":{"url":{"type":"string"},"fixes":{"type":"array","items":{"type":"object","required":["title","why","steps","code"],"properties":{"why":{"type":"string"},"code":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"stack":{"type":"string"},"snippet":{"type":"string"},"language":{"type":"string"}}}},"steps":{"type":"array","items":{"type":"string"}},"title":{"type":"string"},"checks":{"type":"array","items":{"type":"string"}},"recipe":{"type":"string"},"verify":{"type":"string"},"severity":{"enum":["fail","warn"],"type":"string"}}}},"stack":{"type":"object","properties":{"id":{"enum":["express","next","hono","node","python","generic"],"type":"string"},"name":{"type":"string"},"detected_from":{"type":"string"}}},"overall":{"enum":["pass","warn","fail"],"type":"string"},"summary":{"type":"string"},"unfixed":{"type":"array","items":{"type":"object"}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dvKgIYVfv4T9qn6v1Fttb","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Diagnoses a broken x402 payment endpoint and returns concrete, stack-specific code fixes (Express, Next.js, Hono, or raw HTTP) with your own payTo, amount, network, and route filled in.","exampleAgentPrompt":"My x402 endpoint at https://api.myapp.com/premium-data is broken and I can't figure out why — can you diagnose it and give me the exact Express code to fix it?","exampleUseCases":[{"title":"Fix broken Next.js x402 paywall","prompt":"My Next.js route at https://mysite.com/api/protected isn't handling x402 payments correctly — diagnose what's wrong and give me the Next.js code snippets I need to fix it."},{"title":"Repair misconfigured Hono payment route","prompt":"My Hono server endpoint at https://hono-api.example.com/data has a broken x402 setup, can you figure out what's misconfigured and show me exactly what code changes to make?"},{"title":"Debug generic x402 endpoint errors","prompt":"Something is wrong with my x402 endpoint at https://api.example.com/pay — can you diagnose all the issues and generate the fix code for a generic Node HTTP server?"}],"resultDescription":"Returns an overall status (pass/warn/fail), a summary, the detected server stack, and an array of fixes — each with a title, severity, explanation of why it's broken, ordered steps to resolve it, and ready-to-use code snippets labeled by stack (Express, Next.js, Hono, raw HTTP) with your actual payTo address, amount, network, and route already filled in.","failureModes":["Endpoint URL is not publicly reachable — returns error or empty fixes","Stack auto-detection fails if server sends no recognizable framework headers (use 'stack' param to override)","Endpoint is already correct — returns overall:pass with no fixes","Invalid or malformed URL provided — request fails validation","Endpoint behind auth or firewall that blocks the diagnostic probe"],"whenToPreferThis":"Use this endpoint when you have an x402 payment endpoint that is misbehaving and you want both a diagnosis and ready-to-paste code fixes tailored to your specific server framework. Prefer this over the plain diagnosis endpoint when you need actionable code output, not just a description of what's wrong. It's ideal for automated CI workflows that need to self-heal x402 configurations or for developer agents that should suggest concrete pull-request-ready patches.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T18:33:23.527Z","isFirstParty":false,"canonicalSlug":"x402-doctor-fix-broken-x402-endpoint-3ff6827d"}