{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bynn-com/json-schema/bynn-com-bynn-v1-entities-preflight-schema.json",
  "title": "Bynn_V1_Entities_Preflight",
  "description": "Bynn_V1_Entities_Preflight model",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bynn-com-sessions-api-openapi.yml#/components/schemas/Bynn_V1_Entities_Preflight",
  "type": "object",
  "properties": {
    "entity_id_document_type": {
      "type": "string",
      "enum": [
        "id_card",
        "passport",
        "drivers_license",
        "residence_permit"
      ],
      "description": "Identified ID document type (only for ID documents). "
    },
    "entity_id_state": {
      "type": "string",
      "enum": [
        "none_received",
        "front_received_but_needs_resubmission",
        "front_received_awaiting_back",
        "front_received_and_back_received_but_back_needs_resubmission",
        "id_received_awaiting_liveness",
        "awaiting_liveness",
        "awaiting_nfc",
        "awaiting_poa",
        "awaiting_pof",
        "awaiting_a4_document",
        "completed"
      ],
      "description": "ID state (only for ID documents)."
    },
    "extra_data": {
      "allOf": [
        {
          "$ref": "#/$defs/Bynn_V1_Entities_PreflightScreenExtraData"
        }
      ],
      "description": "Additional data derived from preflight analysis of the document/image."
    },
    "session_id": {
      "type": "string",
      "description": "Unique session token"
    },
    "screen": {
      "allOf": [
        {
          "$ref": "#/$defs/Bynn_V1_Entities_PreflightScreen"
        }
      ],
      "description": "Preflight screen information, including the screen to display and its configuration parameters."
    },
    "requirement": {
      "allOf": [
        {
          "$ref": "#/$defs/Bynn_V1_Entities_PreflightRequirement"
        }
      ],
      "description": "Requirement"
    }
  },
  "required": [
    "entity_id_document_type",
    "entity_id_state",
    "extra_data",
    "session_id",
    "screen",
    "requirement"
  ],
  "$defs": {
    "Bynn_V1_Entities_PreflightRequirement": {
      "type": "object",
      "properties": {
        "requirement_type": {
          "type": "string",
          "enum": [
            "identity_document",
            "liveness",
            "proof_of_address",
            "proof_of_funds",
            "phone_verification",
            "email_verification"
          ],
          "description": "Requirement type"
        },
        "status": {
          "type": "string",
          "enum": [
            "preconditions_pending",
            "not_checked",
            "received",
            "analyzed",
            "passed",
            "rejected",
            "failed",
            "matched",
            "bypassed",
            "manual_approved",
            "manual_rejected",
            "manual_review",
            "manual_review_bynn",
            "awaiting_receipt",
            "could_not_check"
          ],
          "description": "Status"
        }
      },
      "required": [
        "requirement_type",
        "status"
      ]
    },
    "Bynn_V1_Entities_PreflightScreen": {
      "type": "object",
      "properties": {
        "show": {
          "type": "string",
          "enum": [
            "waiting_for_previous_call_to_complete",
            "consent_screen",
            "scan_id_document_front_screen",
            "scan_id_document_back_screen",
            "scan_a4_document_screen",
            "proof_of_address_screen",
            "proof_of_funds_screen",
            "nfc_capture_screen",
            "liveness_screen",
            "input_screen",
            "qr_scan_screen",
            "cancel_screen",
            "completed_screen",
            "successful_screen",
            "rejected_screen",
            "phone_verification_screen",
            "email_verification_screen"
          ],
          "description": "Screen to show."
        },
        "parameters": {
          "allOf": [
            {
              "$ref": "#/$defs/Bynn_V1_Entities_PreflightScreenParams"
            }
          ],
          "description": "Configuration parameters for the preflight screen."
        }
      },
      "required": [
        "show",
        "parameters"
      ]
    },
    "Bynn_V1_Entities_PreflightScreenExtraData": {
      "type": "object",
      "properties": {
        "detect_blur_and_bright_spot": {
          "type": "object",
          "description": "Detection results for image quality issues such as blur and bright spots. Contains detailed metrics if available."
        },
        "difficult_to_read": {
          "type": "boolean",
          "description": "Indicates whether the document or image is difficult to read due to poor quality or blurriness."
        },
        "entire_document_not_in_frame": {
          "type": "boolean",
          "description": "Indicates if the entire document is not captured within the frame."
        },
        "document_type": {
          "type": "string",
          "description": "The detected type of document, if applicable."
        },
        "wrong_side": {
          "type": "boolean",
          "description": "Indicates if the wrong side of the document has been captured."
        },
        "finger_cover": {
          "type": "boolean",
          "description": "Indicates whether a finger is covering part of the document."
        }
      },
      "required": [
        "detect_blur_and_bright_spot",
        "difficult_to_read",
        "entire_document_not_in_frame",
        "document_type",
        "wrong_side",
        "finger_cover"
      ]
    },
    "Bynn_V1_Entities_PreflightScreenParams": {
      "type": "object",
      "properties": {
        "camera": {
          "type": "string",
          "enum": [
            "back",
            "front"
          ],
          "description": "Indicating use of the back camera (main camera), of the front camera (selfie camera). If null, then no camera is allowed."
        },
        "camera_quality": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high",
            "ultra"
          ],
          "description": "Camera image quality"
        },
        "allow_manual_upload": {
          "type": "boolean",
          "description": "Allow the user to upload an image or document already on the device"
        },
        "multipage": {
          "type": "boolean",
          "description": "If true, allow multiple pages to be scanned and upload when the user confirms the complete scan."
        },
        "autocapture": {
          "type": "boolean",
          "description": "If true, automatically capture the document when it is well-framed and in focus."
        },
        "title": {
          "type": "string",
          "description": "Title text to display at the top of the screen."
        },
        "text": {
          "type": "string",
          "description": "Additional text to display at the bottom of the screen."
        }
      },
      "required": [
        "camera",
        "camera_quality",
        "allow_manual_upload",
        "multipage",
        "autocapture",
        "title",
        "text"
      ]
    }
  }
}