{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shopsafe-com-au/json-schema/shopsafe-com-au-verification-response-schema.json",
  "title": "VerificationResponse",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shopsafe-com-au-openapi.json#/components/schemas/VerificationResponse",
  "properties": {
    "verification_id": {
      "type": "string",
      "title": "Verification Id"
    },
    "status": {
      "type": "string",
      "enum": [
        "running",
        "complete",
        "failed"
      ],
      "title": "Status"
    },
    "verdict": {
      "anyOf": [
        {
          "$ref": "#/$defs/QuickVerdict"
        },
        {
          "type": "null"
        }
      ]
    },
    "error_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Code"
    },
    "billing_mode": {
      "type": "string",
      "enum": [
        "trial",
        "prepaid",
        "cache"
      ],
      "title": "Billing Mode"
    },
    "cost_aud_cents": {
      "type": "integer",
      "title": "Cost Aud Cents",
      "default": 0
    },
    "reserved_aud_cents": {
      "type": "integer",
      "title": "Reserved Aud Cents",
      "default": 0
    },
    "cached": {
      "type": "boolean",
      "title": "Cached",
      "default": false
    },
    "freshness": {
      "type": "string",
      "enum": [
        "fresh",
        "stale",
        "unavailable"
      ],
      "title": "Freshness",
      "default": "unavailable"
    },
    "recovery": {
      "anyOf": [
        {
          "$ref": "#/$defs/AgentFailure"
        },
        {
          "type": "null"
        }
      ]
    },
    "coverage_guidance": {
      "anyOf": [
        {
          "$ref": "#/$defs/CoverageGuidance"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "verification_id",
    "status",
    "billing_mode"
  ],
  "$defs": {
    "AgentFailure": {
      "properties": {
        "error": {
          "type": "string",
          "title": "Error"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "http_status": {
          "type": "integer",
          "title": "Http Status"
        },
        "retryable": {
          "type": "boolean",
          "title": "Retryable",
          "default": false
        },
        "retry_after_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Retry After Seconds"
        },
        "next_action": {
          "type": "string",
          "enum": [
            "check_credential",
            "request_scope",
            "owner_authorisation",
            "fund_account",
            "wait_and_retry",
            "correct_request",
            "retrieve_original_request",
            "new_request_if_authorised",
            "contact_support"
          ],
          "title": "Next Action"
        },
        "owner_action_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Owner Action Url"
        },
        "quick_price_aud_cents": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quick Price Aud Cents"
        },
        "charge_status": {
          "type": "string",
          "enum": [
            "not_charged",
            "check_original_request"
          ],
          "title": "Charge Status",
          "default": "not_charged"
        },
        "retry_instruction": {
          "type": "string",
          "title": "Retry Instruction",
          "default": "Reuse the original idempotency key and identical parameters after the stated condition changes."
        }
      },
      "type": "object",
      "required": [
        "error",
        "message",
        "http_status",
        "next_action"
      ],
      "title": "AgentFailure"
    },
    "CoverageGap": {
      "properties": {
        "check": {
          "type": "string",
          "maxLength": 48,
          "title": "Check"
        },
        "affected_checks": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 5,
          "title": "Affected Checks"
        },
        "reason": {
          "type": "string",
          "maxLength": 64,
          "title": "Reason"
        },
        "target_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ],
          "title": "Target Url"
        },
        "message": {
          "type": "string",
          "maxLength": 250,
          "title": "Message"
        },
        "next_action": {
          "type": "string",
          "enum": [
            "review_manually",
            "review_destination",
            "wait_for_allowance",
            "contact_service_owner",
            "new_check_if_authorised"
          ],
          "title": "Next Action"
        },
        "action_label": {
          "type": "string",
          "maxLength": 80,
          "title": "Action Label"
        },
        "instruction": {
          "type": "string",
          "maxLength": 300,
          "title": "Instruction"
        }
      },
      "type": "object",
      "required": [
        "check",
        "reason",
        "message",
        "next_action",
        "action_label",
        "instruction"
      ],
      "title": "CoverageGap"
    },
    "CoverageGuidance": {
      "properties": {
        "schema_version": {
          "type": "string",
          "const": "1.0",
          "title": "Schema Version",
          "default": "1.0"
        },
        "based_on": {
          "type": "string",
          "const": "recorded_observations",
          "title": "Based On",
          "default": "recorded_observations"
        },
        "gaps": {
          "items": {
            "$ref": "#/$defs/CoverageGap"
          },
          "type": "array",
          "maxItems": 10,
          "minItems": 1,
          "title": "Gaps"
        },
        "grants_spending_authority": {
          "type": "boolean",
          "const": false,
          "title": "Grants Spending Authority",
          "default": false
        },
        "retry_instruction": {
          "type": "string",
          "title": "Retry Instruction",
          "default": "Retrieving this result or repeating its original request ID returns the saved outcome. It does not fill these gaps. A fresh check needs a new request ID within existing owner authority and limits."
        }
      },
      "type": "object",
      "required": [
        "gaps"
      ],
      "title": "CoverageGuidance"
    },
    "HttpObservation": {
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "observed",
            "blocked",
            "unavailable",
            "unsafe_destination",
            "redirect_limit",
            "invalid_redirect"
          ],
          "title": "Status"
        },
        "observed_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Observed Url"
        },
        "status_code": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status Code"
        },
        "redirects": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 3,
          "title": "Redirects"
        },
        "response_urls": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 4,
          "title": "Response Urls"
        },
        "dns_status": {
          "type": "string",
          "enum": [
            "public",
            "unavailable",
            "unsafe"
          ],
          "title": "Dns Status",
          "default": "unavailable"
        },
        "tls_status": {
          "type": "string",
          "enum": [
            "verified",
            "not_https",
            "unavailable"
          ],
          "title": "Tls Status",
          "default": "unavailable"
        },
        "content_status": {
          "type": "string",
          "enum": [
            "html",
            "non_html",
            "unavailable"
          ],
          "title": "Content Status",
          "default": "unavailable"
        },
        "content_sha256": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Sha256"
        },
        "form_status": {
          "type": "string",
          "enum": [
            "observed",
            "not_applicable",
            "unavailable"
          ],
          "title": "Form Status",
          "default": "unavailable"
        },
        "form_status_reason": {
          "type": "string",
          "enum": [
            "not_inspected",
            "static_html",
            "non_html",
            "xml_response",
            "unsupported_html",
            "limit_exceeded"
          ],
          "title": "Form Status Reason",
          "default": "not_inspected"
        },
        "sensitive_forms": {
          "type": "integer",
          "title": "Sensitive Forms",
          "default": 0
        },
        "insecure_sensitive_forms": {
          "type": "integer",
          "title": "Insecure Sensitive Forms",
          "default": 0
        },
        "cross_origin_sensitive_forms": {
          "type": "integer",
          "title": "Cross Origin Sensitive Forms",
          "default": 0
        },
        "https_downgrade": {
          "type": "boolean",
          "title": "Https Downgrade",
          "default": false
        },
        "strict_transport_security": {
          "type": "boolean",
          "title": "Strict Transport Security",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "status"
      ],
      "title": "HttpObservation"
    },
    "QuickCheck": {
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "url_syntax",
            "public_dns",
            "http_response",
            "https_transport",
            "redirect_transport",
            "sensitive_forms",
            "url_reputation",
            "redirect_reputation"
          ],
          "title": "Code"
        },
        "status": {
          "type": "string",
          "enum": [
            "observed",
            "warning",
            "matched",
            "no_match",
            "unavailable",
            "not_applicable",
            "budget_exhausted",
            "not_configured",
            "stale"
          ],
          "title": "Status"
        },
        "scope": {
          "type": "string",
          "enum": [
            "submitted_url",
            "observed_url",
            "observed_redirects"
          ],
          "title": "Scope"
        },
        "reason": {
          "type": "string",
          "title": "Reason"
        },
        "target_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Target Url"
        }
      },
      "type": "object",
      "required": [
        "code",
        "status",
        "scope",
        "reason"
      ],
      "title": "QuickCheck"
    },
    "QuickVerdict": {
      "properties": {
        "schema_version": {
          "type": "string",
          "enum": [
            "1.1",
            "1.2"
          ],
          "title": "Schema Version",
          "default": "1.2"
        },
        "rules_version": {
          "type": "string",
          "title": "Rules Version",
          "default": "quick-2026-10-19-v4"
        },
        "target_url": {
          "type": "string",
          "title": "Target Url"
        },
        "observed_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Observed Url"
        },
        "scope": {
          "type": "string",
          "const": "submitted_url",
          "title": "Scope",
          "default": "submitted_url"
        },
        "risk_level": {
          "type": "string",
          "enum": [
            "high_risk",
            "elevated_risk",
            "no_known_threats",
            "unknown"
          ],
          "title": "Risk Level"
        },
        "risk_score": {
          "type": "integer",
          "maximum": 100.0,
          "minimum": 0.0,
          "title": "Risk Score"
        },
        "score_is_probability": {
          "type": "boolean",
          "const": false,
          "title": "Score Is Probability",
          "default": false
        },
        "coverage": {
          "type": "string",
          "enum": [
            "complete",
            "partial",
            "incomplete"
          ],
          "title": "Coverage"
        },
        "checked_at": {
          "type": "string",
          "format": "date-time",
          "title": "Checked At"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "title": "Expires At"
        },
        "elapsed_ms": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Elapsed Ms"
        },
        "checks": {
          "items": {
            "$ref": "#/$defs/QuickCheck"
          },
          "type": "array",
          "title": "Checks"
        },
        "observations": {
          "$ref": "#/$defs/HttpObservation"
        },
        "reputation": {
          "$ref": "#/$defs/ReputationEvidence"
        },
        "redirect_reputation": {
          "items": {
            "$ref": "#/$defs/ReputationEvidence"
          },
          "type": "array",
          "maxItems": 3,
          "title": "Redirect Reputation"
        },
        "limitations": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Limitations"
        },
        "advisory": {
          "type": "string",
          "title": "Advisory",
          "default": "Google Web Risk provides URL reputation evidence. Some unsafe sites may be missed and some safe sites may be flagged in error. Neither this evidence nor ShopSafe guarantees the safety of a site or transaction."
        }
      },
      "type": "object",
      "required": [
        "target_url",
        "observed_url",
        "risk_level",
        "risk_score",
        "coverage",
        "checked_at",
        "expires_at",
        "elapsed_ms",
        "checks",
        "observations",
        "reputation"
      ],
      "title": "QuickVerdict"
    },
    "ReputationEvidence": {
      "properties": {
        "provider": {
          "type": "string",
          "title": "Provider"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "target_url": {
          "type": "string",
          "title": "Target Url"
        },
        "match_scope": {
          "type": "string",
          "title": "Match Scope",
          "default": "exact_url"
        },
        "matched_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Matched Url"
        },
        "threat_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Threat Type"
        },
        "observed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Observed At"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires At"
        }
      },
      "type": "object",
      "required": [
        "provider",
        "status",
        "target_url"
      ],
      "title": "ReputationEvidence",
      "description": "One source observation, scoped to the submitted URL, with explicit gaps."
    }
  }
}