{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nashboard-ai/json-schema/nashboard-ai-receipt-detail-schema.json",
  "title": "ReceiptDetail",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nashboard-ai-openapi.json#/components/schemas/ReceiptDetail",
  "type": "object",
  "required": [
    "id",
    "status",
    "currency",
    "total_minor",
    "captured_at",
    "ai_generated"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "parsed",
        "failed"
      ]
    },
    "currency": {
      "type": "string"
    },
    "total_minor": {
      "type": "integer"
    },
    "subtotal_minor": {
      "type": [
        "integer",
        "null"
      ]
    },
    "tax_minor": {
      "type": [
        "integer",
        "null"
      ]
    },
    "tax_lines": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    },
    "service_charge_minor": {
      "type": [
        "integer",
        "null"
      ]
    },
    "tip_minor": {
      "type": [
        "integer",
        "null"
      ]
    },
    "payment_method": {
      "type": [
        "string",
        "null"
      ]
    },
    "merchant_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "merchant_confidence": {
      "type": [
        "number",
        "null"
      ]
    },
    "captured_at": {
      "type": "string",
      "format": "date-time"
    },
    "detected_langs": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "extraction_confidence": {
      "type": [
        "number",
        "null"
      ]
    },
    "product_links_status": {
      "type": "string",
      "enum": [
        "pending",
        "ready"
      ]
    },
    "needs_review": {
      "type": "boolean"
    },
    "failure_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "ai_generated": {
      "type": "boolean",
      "description": "Always true (EU AI Act Art. 50 disclosure)."
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "line_no": {
            "type": "integer"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": [
              "number",
              "null"
            ]
          },
          "unit_price_minor": {
            "type": [
              "integer",
              "null"
            ]
          },
          "total_minor": {
            "type": [
              "integer",
              "null"
            ]
          },
          "gtin": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_global_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "product_link_confidence": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}