{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ucp.dev/draft/schemas/common/types/message_error.json",
  "title": "Message Error",
  "type": "object",
  "required": [
    "type",
    "code",
    "content",
    "severity"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "error",
      "description": "Message type discriminator."
    },
    "code": {
      "$ref": "https://ucp.dev/draft/schemas/common/types/error_code.json"
    },
    "path": {
      "type": "string",
      "description": "RFC 9535 JSONPath to the component the message refers to (e.g., $.line_items[0])."
    },
    "content_type": {
      "type": "string",
      "enum": [
        "plain",
        "markdown"
      ],
      "default": "plain",
      "description": "Content format, default = plain."
    },
    "content": {
      "type": "string",
      "description": "Human-readable message."
    },
    "severity": {
      "type": "string",
      "enum": [
        "recoverable",
        "requires_buyer_input",
        "requires_buyer_review",
        "unrecoverable"
      ],
      "description": "Reflects the resource state and recommended action. 'recoverable': platform can resolve the condition in band, for example by modifying inputs or processing a related Action, and submit a new operation when needed. 'requires_buyer_input': merchant requires information their API doesn't support collecting programmatically (checkout incomplete). 'requires_buyer_review': buyer must authorize before order placement due to policy, regulatory, or entitlement rules. 'unrecoverable': no valid resource exists to act on, retry with new resource or inputs. Errors with 'requires_*' severity contribute to 'status: requires_escalation'."
    }
  }
}