# x402 Payment Failure Doctor

> x402 Payment Failure Doctor is a paid API for AI agents from api.400860.xyz, paid per call via x402, $0.01/call, status down (last checked 2026-10-03).

Diagnoses x402 payment failures and returns retry/stop decisions, replay commands, receipt evidence checklists, and client patches.

## Facts

- Endpoint: GET https://api.400860.xyz/v1/x402/payment-failure-doctor?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: down
- Last checked: 2026-10-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-payment-failure-doctor-a7b0b132
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VpVG08Yttvm_SHS9bTxDC

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-payment-failure-doctor-a7b0b132
```

Example prompt: My x402 payment just failed — can you run a diagnosis and tell me whether I should retry or stop, what the minimal replay command is, and what receipt evidence I need to collect?

## When to prefer this

Use this endpoint when an x402 payment attempt has failed and you need a structured, actionable triage response — including whether to retry, the exact replay command, and what evidence to gather. Prefer this over manual debugging when operating an autonomous agent wallet or MCP client that needs programmatic recovery logic.

## Known failure modes

- Missing or malformed input parameters returns a validation error
- Facilitator timeout results in incomplete diagnosis with timeout-specific handling guidance
- Service unavailable if the paid endpoint cannot be reached (402 required to call it)
- Unknown x402 failure type may return a generic or partial diagnosis

## How this service works

400860 Radar is an AI-operated x402 Web3 opportunity network for humans and agents.

## Output

Returns a structured diagnosis including: the failure title, next step (retry or stop decision), product ID, expected output list, and buyer preparation object with fields for pay-now command, objective, funding action, readiness loop, revenue summary, checkout session, first-sale dry run, payment recovery steps, activation bundle, success condition, and real payment command.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "amount": "99.99",
   "currency": "USD",
   "failureCode": "x402_timeout",
   "paymentMethod": "credit_card",
   "transactionId": "txn_test_12345"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "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",
     "additionalProperties": true
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "title": {
       "type": "string"
      },
      "nextStep": {
       "type": "string"
      },
      "productId": {
       "type": "string"
      },
      "expectedOutput": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "buyerPreparation": {
       "type": "object",
       "properties": {
        "payNow": {
         "type": "string"
        },
        "objective": {
         "type": "string"
        },
        "notRevenue": {
         "type": "array",
         "items": {
          "type": "string"
         }
        },
        "fundingAction": {
         "type": "string"
        },
        "readinessLoop": {
         "type": "string"
        },
        "revenueSummary": {
         "type": "string"
        },
        "checkoutSession": {
         "type": "string"
        },
        "firstSaleDryRun": {
         "type": "string"
        },
        "paymentRecovery": {
         "type": "string"
        },
        "activationBundle": {
         "type": "string"
        },
        "successCondition": {
         "type": "string"
        },
        "realPaymentCommand": {
         "type": "string"
        }
       },
       "additionalProperties": true
      }
     },
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "title": "x402 payment failure doctor",
  "nextStep": "/v1/buyer/payment-recovery",
  "productId": "x402_payment_failure_doctor",
  "expectedOutput": [
   "diagnosis",
   "failureStage",
   "retryDecision",
   "minimalReplayCommand",
   "receiptEvidenceChecklist",
   "revenueEvidenceChecklist",
   "clientPatchSuggestions",
   "settlementTimeoutPlan",
   "repeatTrigger"
  ],
  "buyerPreparation": {
   "payNow": "https://api.400860.xyz/v1/buyer/pay-now?address=0xBUYER_ADDRESS",
   "objective": "Clear funding/readiness before attempting a real x402 payment.",
   "notRevenue": [
    "402 probes",
    "funding-action reads",
    "checkout-session reads",
    "readiness-loop reads",
    "pay-now reads",
    "downloads",
    "manifest views"
   ],
   "focusedDryRun": "curl -i https://api.400860.xyz/v1/x402/payment-failure-doctor",
   "fundingAction": "https://api.400860.xyz/v1/buyer/funding-action",
   "machinePayNow": {
    "price": "$0.01",
    "method": "GET",
    "resource": "https://api.400860.xyz/v1/x402/payment-failure-doctor",
    "payNowUrl": "https://api.400860.xyz/v1/buyer/pay-now?channel=bazaar-x402_payment_failure_doctor",
    "productId": "x402_payment_failure_doctor",
    "nextAction": "Run payCommand once from a local buyer runtime with a funded Base USDC wallet, then verify revenueSummary instead of treating discovery, 402 probes, or downloads as revenue.",
    "notRevenue": [
     "manifest reads",
     "payment quote reads",
     "pay-now reads",
     "402 probes",
     "downloads",
     "self-test payments"
    ],
    "payCommand": "RADAR_TARGET=https://api.400860.xyz/v1/x402/payment-failure-doctor RADAR_METHOD=GET X402_PAY=true X402_PRIVATE_KEY=0xYOUR_FUNDED_X402_PRIVATE_KEY npx --yes --package https://x402.400860.xyz/downloads/400860-x402-client/400860-x402-client-0.1.4.tgz 400860-x402 pay",
    "recoveryUrl": "https://api.400860.xyz/v1/buyer/payment-recovery?address=0xBUYER_ADDRESS&channel=bazaar-x402_payment_failure_doctor",
    "buyerGuideUrl": "https://api.400860.xyz/v1/open-source-agent/buyer-guide",
    "verificationUrl": "https://api.400860.xyz/v1/revenue/summary",
    "successCondition": "eventCount > 0 && hasExternalRevenue === true after a paid protected handler returns for x402_payment_failure_doctor."
   },
   "readinessLoop": "https://api.400860.xyz/v1/buyer/readiness-loop?address=0xBUYER_ADDRESS",
   "revenueSummary": "https://api.400860.xyz/v1/revenue/summary",
   "checkoutSession": "https://
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-payment-failure-doctor-a7b0b132/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.400860.xyz](https://www.zero.xyz/host/api.400860.xyz/llms.txt)
