{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Invoice schema",
    "description": "A schema to validate invoice data",
    "type": "array",
    "items": {
    "type": "object",
        "properties": {
            "explanation": {
                "description": "In the case of an error or no invoice, this field should always have a detailed explanation as to why.",
                "type": "string"
            },
            "customer_identifier": {
                "description": "The customer's name. e.g., ABC Corporation, Microsoft, etc.",
                "type": "string"
            },
            "vendor_identifier": {
                "description": "The vendor's name",
                "type": "string"
            },
            "date": {
                "description": "Invoice date in ISO 8601 format (YYYY-MM-DD).",
                "type": "string",
                "format": "date"
            },
            "invoice_number": {
                "description": "Unique invoice number for the transaction.",
                "type": "string"
            },
            "account_number": {
                "description": "Customer's account number associated with the invoice. Not always present on the invoice.",
                "type": "string"
            },
            "total": {
                "description": "Total amount of the invoice, including taxes and fees. It should be a decimal number as a string.",
                "type": "string",
                "pattern": "^\\d+(\\.\\d{1,2})?$" 
            }
        },
        "required": ["customer_identifier", "vendor_identifier", "date", "invoice_number", "total"],
        "additionalProperties": false
    }
}
