{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ai2fin-com/json-schema/ai2fin-com-receipt-analysis-schema.json",
  "title": "ReceiptAnalysis",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ai2fin-com-receipts-attachments-api-openapi.yml#/components/schemas/ReceiptAnalysis",
  "type": "object",
  "properties": {
    "extracted": {
      "$ref": "#/$defs/ReceiptExtractedData"
    },
    "candidates": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "amount": {
            "type": "number"
          }
        }
      }
    },
    "asset": {
      "type": "object",
      "properties": {
        "assetUrl": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "size": {
          "type": "integer"
        }
      }
    }
  },
  "$defs": {
    "ReceiptExtractedData": {
      "type": "object",
      "properties": {
        "merchant": {
          "type": "string"
        },
        "dateISO": {
          "type": "string",
          "format": "date"
        },
        "currency": {
          "type": "string"
        },
        "total": {
          "type": "number"
        },
        "tax": {
          "type": "number"
        },
        "tip": {
          "type": "number"
        },
        "lineItems": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string"
              },
              "quantity": {
                "type": "number"
              },
              "unitPrice": {
                "type": "number"
              },
              "amount": {
                "type": "number"
              }
            }
          }
        }
      }
    }
  }
}