> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 4.12 Models

> Schemas used by the Decision Lane API.

Schemas from the Decision Lane API OpenAPI document (version 0.1.0). The full document is available at [openapi.json](https://openapi.gitbook.com/o/nQd4uH0AE1HLDTYwsXgN/spec/refundflow-ai-v1-api-reference.json).

### AdminKpis

| Field | Type | Required |
| - | - | - |
| `total_claims` | integer | Yes |
| `pending_approval` | integer | Yes |
| `refunded` | integer | Yes |
| `rejected` | integer | Yes |
| `decision_rate` | number (0 to 1) | Yes |
| `by_status` | object of integers | Yes |

### ApprovalRecord

| Field | Type | Required |
| - | - | - |
| `claim_id` | string | Yes |
| `reviewer_id` | string | Yes |
| `reviewer_name` | string | Yes |
| `decision` | string | Yes |
| `comment` | string | Yes |

### ApprovalRequest

| Field | Type | Required | Description |
| - | - | - | - |
| `decision` | string, `approve` or `reject` | Yes | Reviewer decision; must be either `approve` or `reject`. Example: `approve`. |
| `comment` | string, 3 to 2000 characters | Yes | Reviewer rationale for the decision. |

### AssessmentCriterion

| Field | Type | Required |
| - | - | - |
| `name` | string | Yes |
| `status` | [`CriterionStatus`](#criterionstatus) | Yes |
| `explanation` | string | Yes |
| `evidence_document_ids` | array of strings | No |
| `citations` | array of [`PolicyCitation`](#policycitation) | No |

### AssessmentResult

| Field | Type | Required |
| - | - | - |
| `claim_id` | string | Yes |
| `eligible` | boolean | Yes |
| `proposed_refund_amount` | string | Yes |
| `confidence` | number (0 to 1) | Yes |
| `requires_two_reviewers` | boolean | Yes |
| `summary` | string | Yes |
| `criteria` | array of [`AssessmentCriterion`](#assessmentcriterion) | Yes |
| `model_deployment` | string | Yes |
| `prompt_version` | string | Yes |
| `policy_snapshot_id` | string | Yes |
| `trace_id` | string or null | No |

### ClaimDocument

| Field | Type | Required |
| - | - | - |
| `id` | string | Yes |
| `claim_id` | string | Yes |
| `file_name` | string | Yes |
| `content_type` | string | Yes |
| `size_bytes` | integer | Yes |
| `blob_name` | string | Yes |
| `status` | [`DocumentProcessingStatus`](#documentprocessingstatus), default `uploaded` | No |
| `upload_verification_status` | [`UploadVerificationStatus`](#uploadverificationstatus), default `pending` | No |
| `verified_at` | date-time or null | No |
| `content_sha256` | string or null | No |
| `evidence_type` | [`EvidenceType`](#evidencetype) or null | No |
| `evidence_confidence` | number (0 to 1) or null | No |
| `evidence_validation` | string or null | No |
| `damage_visible` | boolean or null | No |
| `image_quality` | string or null | No |
| `classification_reason` | string or null | No |
| `created_at` | date-time | No |

### ClaimStatus

String enum: `draft`, `uploading`, `scanning`, `processing`, `needs_information`, `pending_approval`, `approved`, `rejected`, `refund_submitted`, `refunded`, `refund_failed`, `pending_ai_capacity`, `closed`.

### ClaimSubmissionResponse

| Field | Type | Required |
| - | - | - |
| `status` | string, constant `scanning` | Yes |
| `workflow_instance_id` | string | Yes |

### ClaimType

String enum: `delayed_delivery`, `non_delivery`, `damaged_item`, `wrong_item`.

### CreateClaimRequest

| Field | Type | Required | Description |
| - | - | - | - |
| `order_id` | string | Yes | Identifier of an order owned by the signed-in customer. |
| `claim_type` | [`ClaimType`](#claimtype) | Yes | Reason category for the refund claim. |
| `reason` | string, 10 to 2000 characters | Yes | Explanation of the refund request. |
| `requested_amount` | number greater than 0, or string | Yes | Requested refund amount; must not exceed the amount paid for the order. |
| `currency` | string, default `CAD` | No | Currency code, which must match the order. Example: `CAD`. |

### CreateOrderRequest

| Field | Type | Required | Description |
| - | - | - | - |
| `id` | string, 1 to 100 characters | Yes | Unique order identifier. |
| `customer_id` | string, at least 1 character | Yes | Entra object ID of the customer who owns the order. |
| `currency` | string, exactly 3 characters | Yes | Three-letter order currency code. Example: `CAD`. |
| `paid_amount` | number greater than 0, or string | Yes | Amount paid for the order. |
| `payment_intent_id` | string, at least 1 character | Yes | Payment provider reference for the order. |

### CriterionStatus

String enum: `pass`, `fail`, `review`.

### DocumentProcessingStatus

String enum: `uploaded`, `malware_scanning`, `malware_rejected`, `safety_scanning`, `safety_review_required`, `safety_blocked`, `ready_for_extraction`, `extracting`, `extraction_complete`, `processing_failed`.

### ErrorResponse

| Field | Type | Required |
| - | - | - |
| `detail` | string | Yes |

### EvidenceClassification

| Field | Type | Required |
| - | - | - |
| `evidence_type` | [`EvidenceType`](#evidencetype) | Yes |
| `confidence` | number (0 to 1) | Yes |
| `image_quality` | string | Yes |
| `shows_product` | boolean or null | No |
| `damage_visible` | boolean or null | No |
| `damage_type` | string or null | No |
| `reason` | string | Yes |
| `validation_status` | string | Yes |
| `analyzer_id` | string | Yes |

### EvidenceType

String enum: `receipt`, `invoice`, `order_confirmation`, `tracking_evidence`, `damage_photo`, `product_photo`, `package_label`, `unreadable`, `other`.

### HTTPValidationError

| Field | Type | Required |
| - | - | - |
| `detail` | array of [`ValidationError`](#validationerror) | No |

### HealthResponse

| Field | Type | Required |
| - | - | - |
| `status` | string, `ok` or `ready` | Yes |

### OrderRecord

| Field | Type | Required |
| - | - | - |
| `id` | string | Yes |
| `customer_id` | string | Yes |
| `currency` | string | Yes |
| `paid_amount` | string | Yes |
| `payment_intent_id` | string | Yes |

### PolicyCitation

| Field | Type | Required |
| - | - | - |
| `policy_id` | string | Yes |
| `policy_version` | string | Yes |
| `chunk_id` | string | Yes |
| `title` | string | Yes |
| `quote` | string | Yes |

### RefundClaim

| Field | Type | Required |
| - | - | - |
| `id` | string | Yes |
| `customer_id` | string | Yes |
| `customer_email` | string | Yes |
| `order_id` | string | Yes |
| `claim_type` | [`ClaimType`](#claimtype) | Yes |
| `reason` | string, 10 to 2000 characters | Yes |
| `requested_amount` | string | Yes |
| `currency` | string, default `CAD` | No |
| `status` | [`ClaimStatus`](#claimstatus), default `draft` | No |
| `workflow_instance_id` | string or null | No |
| `created_at` | date-time | No |
| `updated_at` | date-time | No |

### ReviewDecisionResponse

| Field | Type | Required |
| - | - | - |
| `status` | string, constant `accepted` | Yes |

### ReviewDetail

| Field | Type | Required |
| - | - | - |
| `claim` | [`RefundClaim`](#refundclaim) | Yes |
| `assessment` | [`AssessmentResult`](#assessmentresult) | Yes |
| `documents` | array of [`ReviewEvidenceDocument`](#reviewevidencedocument) | Yes |
| `approvals` | array of [`ApprovalRecord`](#approvalrecord) | Yes |

### ReviewEvidenceDocument

| Field | Type | Required |
| - | - | - |
| `document` | [`ClaimDocument`](#claimdocument) | Yes |
| `classification` | [`EvidenceClassification`](#evidenceclassification) or null | No |
| `download_path` | string | Yes |

### StripeWebhookResponse

| Field | Type | Required |
| - | - | - |
| `received` | boolean, constant `true` | Yes |

### UploadCompleteResponse

| Field | Type | Required |
| - | - | - |
| `status` | string, constant `verified` | Yes |
| `document_id` | string | Yes |

### UploadGrant

Grant for uploading one file directly to quarantine Blob Storage.

| Field | Type | Required |
| - | - | - |
| `document_id` | string | Yes |
| `blob_name` | string | Yes |
| `upload_url` | string | Yes |
| `required_headers` | object of strings | Yes |

### UploadRequest

| Field | Type | Required | Description |
| - | - | - | - |
| `file_name` | string, 1 to 255 characters | Yes | Original file name for display. |
| `content_type` | string | Yes | MIME content type of the evidence file. Example: `image/jpeg`. |
| `size_bytes` | integer, greater than 0, maximum 4194304 | Yes | File size in bytes; maximum is 4194304. |

### UploadVerificationStatus

String enum: `pending`, `verified`, `rejected`.

### ValidationError

| Field | Type | Required |
| - | - | - |
| `loc` | array of strings or integers | Yes |
| `msg` | string | Yes |
| `type` | string | Yes |
| `input` | any | No |
| `ctx` | object | No |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.