{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fiatdock-com/json-schema/fiatdock-com-x402-call-schema.json",
  "title": "X402Call",
  "description": "The relay envelope: what an index-listed x402 endpoint answered — its status, body, decoded 402 (paymentRequired + howToPay) or settlement receipt.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fiatdock-com-x402-api-openapi.yml#/components/schemas/X402Call",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "true when the endpoint answered 2xx"
    },
    "status": {
      "type": "number",
      "description": "The ENDPOINT's HTTP status (a 402 comes back as isError with the decoded challenge instead)"
    },
    "url": {
      "type": "string",
      "description": "The URL that was called"
    },
    "method": {
      "type": "string",
      "description": "GET or POST"
    },
    "paid": {
      "type": "boolean",
      "description": "true when a payment header travelled with the request — yours, or one this package signed"
    },
    "settlement": {
      "description": "The endpoint's decoded PAYMENT-RESPONSE header when it settled: the x402 settlement receipt (tx hash, network, payer)"
    },
    "result": {
      "description": "The endpoint's response body — parsed JSON when it returned JSON, otherwise the raw text"
    },
    "truncated": {
      "type": "boolean",
      "description": "True when the body was cut at 256 KB"
    },
    "note": {
      "type": "string",
      "description": "Present only when truncated"
    },
    "hint": {
      "type": "string",
      "description": "Present on a 405: the endpoint refused this HTTP method — call again with the other one (the index records no method)"
    },
    "allow": {
      "type": "string",
      "description": "The endpoint's Allow header on a 405, when it sent one"
    }
  },
  "required": [
    "ok",
    "status",
    "url",
    "method",
    "paid"
  ]
}