{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "urn:luminetric:canonical:1:request.failed",
 "$comment": "Generated by build_schemas.py. Open by design: accept fields and enum values you do not recognise (COMPATIBILITY.md).",
 "title": "request.failed",
 "description": "A request that produced no statement. Not terminal: a later statement with the same request_id supersedes it.",
 "type": "object",
 "properties": {
  "schema_version": {
   "type": "string",
   "pattern": "^1\\.[0-9]+\\.[0-9]+$",
   "description": "Semantic version of this contract. This schema covers major version 1."
  },
  "event": {
   "type": "string",
   "const": "request.failed"
  },
  "failure_id": {
   "type": "string",
   "pattern": "^flr_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
   "description": "The delivery id."
  },
  "request_id": {
   "type": "string",
   "minLength": 1
  },
  "client_reference": {
   "type": "string",
   "minLength": 1,
   "maxLength": 255
  },
  "failed_at": {
   "type": "string",
   "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z$",
   "description": "When the request failed. ISO 8601, UTC."
  },
  "reason": {
   "type": "object",
   "properties": {
    "code": {
     "type": "string",
     "description": "Why. Known values: not_a_pdf, unreadable_pdf, extraction_failed, validation_failed, internal_error. Values may be added in a minor version. Act on an unknown code by customer_action_required.",
     "x-known-values": [
      "not_a_pdf",
      "unreadable_pdf",
      "extraction_failed",
      "validation_failed",
      "internal_error"
     ]
    },
    "message": {
     "type": "string"
    },
    "customer_action_required": {
     "type": "boolean"
    }
   },
   "required": [
    "code",
    "message",
    "customer_action_required"
   ]
  }
 },
 "required": [
  "schema_version",
  "event",
  "failure_id",
  "request_id",
  "failed_at",
  "reason"
 ]
}
