{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flint-network/json-schema/flint-network-x402-verify-response-schema.json",
  "title": "X402VerifyResponse",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flint-network-openapi.json#/components/schemas/X402VerifyResponse",
  "type": "object",
  "required": [
    "ok",
    "verdict",
    "score",
    "record_id",
    "record_url",
    "signed_record",
    "record",
    "receipt_status",
    "settlement_receipt",
    "receipt_url",
    "receipt_page_url"
  ],
  "properties": {
    "ok": {
      "const": true
    },
    "verdict": {
      "$ref": "#/$defs/VerdictDecision"
    },
    "score": {
      "type": "number",
      "minimum": 0,
      "maximum": 100
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "top_reasons": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "record_id": {
      "type": "string",
      "pattern": "^frv_"
    },
    "record_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Human-readable authorization record URL, derived by FLINT from the record ID."
    },
    "receipt_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Machine retrieval URL for the signed settlement-receipt envelope."
    },
    "receipt_page_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Human-readable Scout service-payment receipt URL."
    },
    "signed_record": {
      "type": "string",
      "description": "ES256 compact JWS for the authorization record."
    },
    "record": {
      "$ref": "#/$defs/HybridEnvelope"
    },
    "step_up": {
      "type": "object"
    },
    "compliance": {
      "type": "object"
    },
    "receipt_status": {
      "type": "string",
      "enum": [
        "issued",
        "unavailable",
        "disabled",
        "not_issued"
      ]
    },
    "settlement_receipt": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "receipt_id",
            "record",
            "idempotent"
          ],
          "properties": {
            "receipt_id": {
              "type": "string",
              "pattern": "^fsr_"
            },
            "record": {
              "$ref": "#/$defs/HybridEnvelope"
            },
            "idempotent": {
              "type": "boolean"
            }
          }
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "HybridEnvelope": {
      "type": "object",
      "required": [
        "jws"
      ],
      "properties": {
        "envelope_version": {
          "type": [
            "string",
            "null"
          ]
        },
        "jws": {
          "type": "string",
          "description": "ES256 compact JWS."
        },
        "pq_signature": {
          "type": [
            "string",
            "null"
          ],
          "description": "Parallel ML-DSA-65 signature when configured."
        },
        "pq_kid": {
          "type": [
            "string",
            "null"
          ]
        },
        "pq_alg": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "VerdictDecision": {
      "type": "string",
      "enum": [
        "allow",
        "step_up",
        "review",
        "block"
      ]
    }
  }
}