changedOutput schema / oneOf
Previous value: -[
- {
- "additionalProperties": false,
- "properties": {
- "details": {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "additionalProperties": false,
- "properties": {
- "example_version": {
- "const": "ardaro.receipt-intelligence.example.v1"
- },
- "expected_response": {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "additionalProperties": false,
- "description": "Receipt Intelligence v1 response. result is authoritative; receipt is a derived compatibility projection that MUST match result.",
- "properties": {
- "arithmetic_consistency": {
- "enum": [
- "verified",
- "mismatch",
- "unavailable"
- ]
- },
- "arithmetic_verified": {
- "type": [
- "boolean",
- "null"
- ]
- },
- "confidence": {
- "type": "object"
- },
- "contract_version": {
- "const": "ardaro.agent-receipt-intelligence.response.v1"
- },
- "duplicate_check": {
- "type": "object"
- },
- "duplicate_fingerprint": {
- "pattern": "^[0-9a-f]{64}$",
- "type": [
- "string",
- "null"
- ]
- },
- "engine": {
- "type": "object"
- },
- "identities": {
- "additionalProperties": false,
- "properties": {
- "analysis_result_identity": {
- "pattern": "^res_[0-9a-f]{64}$",
- "type": "string"
- },
- "document_fingerprint": {
- "pattern": "^[0-9a-f]{64}$",
- "type": [
- "string",
- "null"
- ]
- },
- "request_identity": {
- "pattern": "^req_[0-9a-f]{64}$",
- "type": "string"
- }
- },
- "required": [
- "request_identity",
- "document_fingerprint",
- "analysis_result_identity"
- ],
- "type": "object"
- },
- "metering": {
- "type": "object"
- },
- "payment_identity": {
- "additionalProperties": false,
- "properties": {
- "protocol": {
- "const": "x402-v2"
- },
- "reference": {
- "pattern": "^pay_[0-9a-f]{64}$",
- "type": "string"
- },
- "replayed": {
- "type": "boolean"
- }
- },
- "required": [
- "protocol",
- "reference",
- "replayed"
- ],
- "type": "object"
- },
- "policy": {
- "type": "object"
- },
- "receipt": {
- "additionalProperties": false,
- "description": "Non-authoritative compatibility projection generated from result under ardaro.result-receipt-projection.v1. Consumers MUST use result for structured receipt values and reject a response when this projection diverges.",
- "properties": {
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "description": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "product_code": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "quantity": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "unit_price": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- }
- },
- "required": [
- "description",
- "product_code",
- "quantity",
- "unit_price",
- "amount"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "type": "array"
- },
- "purchase_date": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 10,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "purchase_order": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "receipt_reference": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "totals": {
- "additionalProperties": false,
- "properties": {
- "currency": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 3,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "subtotal": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "tax": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "total": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- }
- },
- "required": [
- "subtotal",
- "tax",
- "total",
- "currency"
- ],
- "type": "object"
- },
- "vendor": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- }
- },
- "required": [
- "vendor",
- "purchase_date",
- "totals",
- "line_items"
- ],
- "type": "object"
- },
- "result": {
- "additionalProperties": false,
- "description": "Sole authoritative structured analysis object. Its recursively key-sorted, compact UTF-8 JSON bytes are SHA-256 hashed under ardaro.recursive-key-sort-compact-json-utf8-sha256.v1 and published as analysis_result_identity.",
- "properties": {
- "extracted_facts": {
- "additionalProperties": false,
- "properties": {
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "description": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "product_code": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "quantity": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- },
- "unit_price": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- ]
- }
- },
- "required": [
- "description",
- "product_code",
- "quantity",
- "unit_price",
- "amount"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "type": "array"
- },
- "purchase_date": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 10,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "purchase_order": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "receipt_reference": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "totals.currency": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 3,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "totals.subtotal": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "totals.tax": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "totals.total": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- },
- "vendor": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- },
- "required": [
- "line_items"
- ],
- "type": "object"
- },
- "inferred_suggestions": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "field": {
- "enum": [
- "vendor",
- "purchase_date",
- "purchase_order",
- "receipt_reference",
- "totals.subtotal",
- "totals.tax",
- "totals.total",
- "totals.currency"
- ]
- },
- "value": {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "additionalProperties": false,
- "properties": {
- "level": {
- "enum": [
- "high",
- "medium",
- "low"
- ]
- },
- "score": {
- "maximum": 1,
- "minimum": 0,
- "type": "number"
- }
- },
- "required": [
- "score",
- "level"
- ],
- "type": "object"
- },
- "source": {
- "enum": [
- "structured_summary",
- "structured_line_item",
- "provider_neutral",
- "text_fallback",
- "inferred"
- ]
- },
- "value": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "value",
- "confidence",
- "source"
- ],
- "type": "object"
- }
- },
- "required": [
- "field",
- "value"
- ],
- "type": "object"
- },
- "maxItems": 8,
- "type": "array"
- },
- "provenance": {
- "type": "object"
- },
- "unavailable_fields": {
- "items": {
- "enum": [
- "purchase order reference",
- "purchase_date",
- "receipt or invoice number",
- "totals.currency",
- "totals.subtotal",
- "totals.tax",
- "totals.total",
- "vendor"
- ]
- },
- "type": "array",
- "uniqueItems": true
- },
- "validation": {
- "type": "object"
- }
- },
- "required": [
- "extracted_facts",
- "inferred_suggestions",
- "unavailable_fields",
- "validation",
- "provenance"
- ],
- "type": "object"
- },
- "service": {
- "const": "ardaro.receipt_intelligence"
- },
- "status": {
- "const": "review_required"
- },
- "version": {
- "const": "1.0.0"
- },
- "warning_groups": {
- "type": "object"
- },
- "warnings": {
- "items": {
- "type": "object"
- },
- "maxItems": 64,
- "type": "array"
- }
- },
- "required": [
- "contract_version",
- "service",
- "version",
- "status",
- "engine",
- "receipt",
- "confidence",
- "duplicate_check",
- "duplicate_fingerprint",
- "arithmetic_verified",
- "arithmetic_consistency",
- "warnings",
- "warning_groups",
- "identities",
- "result",
- "metering",
- "policy"
- ],
- "type": "object",
- "x-ardaro-analysis-result-identity-profile": "ardaro.recursive-key-sort-compact-json-utf8-sha256.v1",
- "x-ardaro-authoritative-analysis-path": "$.result",
- "x-ardaro-receipt-compatibility-path": "$.receipt",
- "x-ardaro-receipt-projection-profile": "ardaro.result-receipt-projection.v1"
- },
- "input_description": {
- "type": "string"
- },
- "limits": {
- "additionalProperties": false,
- "properties": {
- "max_existing_fingerprints": {
- "minimum": 1,
- "type": "integer"
- },
- "max_line_items": {
- "minimum": 1,
- "type": "integer"
- },
- "max_pages": {
- "minimum": 1,
- "type": "integer"
- },
- "max_request_bytes": {
- "minimum": 1,
- "type": "integer"
- },
- "max_text_characters": {
- "minimum": 1,
- "type": "integer"
- },
- "normal_latency_target_ms": {
- "minimum": 1,
- "type": "integer"
- },
- "request_timeout_ms": {
- "minimum": 1,
- "type": "integer"
- }
- },
- "required": [
- "max_existing_fingerprints",
- "max_line_items",
- "max_pages",
- "max_request_bytes",
- "max_text_characters",
- "normal_latency_target_ms",
- "request_timeout_ms"
- ],
- "type": "object"
- },
- "paid_processing_performed": {
- "const": false
- },
- "request": {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "additionalProperties": false,
- "properties": {
- "contract_version": {
- "const": "ardaro.agent-receipt-intelligence.request.v1",
- "description": "Required request contract identifier; send this exact version string."
- },
- "existing_fingerprints": {
- "description": "Receipt fingerprints already known to the caller for duplicate comparison. Supply lowercase 64-character SHA-256 hex strings, or an empty array when none are available; at most 10,000 entries.",
- "items": {
- "pattern": "^[0-9a-f]{64}$",
- "type": "string"
- },
- "maxItems": 10000,
- "type": "array"
- },
- "input": {
- "description": "One receipt supplied as bounded OCR text or a provider-neutral structured extraction. Choose exactly one input kind.",
- "oneOf": [
- {
- "additionalProperties": false,
- "properties": {
- "kind": {
- "const": "text",
- "description": "Selects receipt text input; supply the text property."
- },
- "text": {
- "description": "OCR or receipt text for one document, up to 20,000 characters. Exclude payment-card data, credentials, customer-record payloads, and financial posting instructions.",
- "maxLength": 20000,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "kind",
- "text"
- ],
- "type": "object"
- },
- {
- "additionalProperties": false,
- "properties": {
- "analysis": {
- "additionalProperties": false,
- "description": "Provider-neutral receipt extraction using only the listed fields. Omit fields that were not extracted.",
- "minProperties": 1,
- "properties": {
- "currency": {
- "description": "Three-letter currency code shown on the receipt, for example USD. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 3,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 3,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "line_items": {
- "description": "Extracted receipt line items, limited to 100 entries; omit unavailable item fields.",
- "items": {
- "additionalProperties": false,
- "minProperties": 1,
- "properties": {
- "amount": {
- "description": "Extended amount printed for this line item, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "description": {
- "description": "Item description printed on the receipt. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "product_code": {
- "description": "Product identifier or SKU printed for this line item. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "quantity": {
- "description": "Quantity purchased for this line item. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "unit_price": {
- "description": "Price per unit for this line item, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- }
- },
- "type": "object"
- },
- "maxItems": 100,
- "type": "array"
- },
- "purchase_date": {
- "description": "Purchase date as extracted; YYYY-MM-DD is recommended. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 10,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 10,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "purchase_order": {
- "description": "Purchase-order reference printed on the receipt; this does not select or link an Ardaro job. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "receipt_reference": {
- "description": "Receipt, invoice, or transaction reference printed on the document. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "subtotal": {
- "description": "Receipt subtotal before tax, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "tax": {
- "description": "Total tax amount printed on the receipt, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "total": {
- "description": "Final receipt total, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 32,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- },
- "vendor": {
- "description": "Merchant or supplier name printed on the receipt. Supply the extracted value directly or wrap it with optional extraction confidence.",
- "oneOf": [
- {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "additionalProperties": false,
- "properties": {
- "confidence": {
- "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
- "maximum": 100,
- "minimum": 0,
- "type": "number"
- },
- "value": {
- "description": "The extracted field value, supplied as text or a number before receipt normalization.",
- "oneOf": [
- {
- "maxLength": 160,
- "minLength": 1,
- "type": "string"
- },
- {
- "type": "number"
- }
- ]
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- }
- ]
- }
- },
- "type": "object"
- },
- "kind": {
- "const": "structured",
- "description": "Selects structured receipt input; supply the analysis property."
- }
- },
- "required": [
- "kind",
- "analysis"
- ],
- "type": "object"
- }
- ]
- }
- },
- "required": [
- "contract_version",
- "input",
- "existing_fingerprints"
- ],
- "type": "object"
- },
- "synthetic_only": {
- "const": true
- }
- },
- "required": [
- "example_version",
- "synthetic_only",
- "paid_processing_performed",
- "input_description",
- "request",
- "expected_response",
- "limits"
- ],
- "type": "object"
- },
- "service": {
- "const": "receipt"
- }
- },
- "required": [
- "service",
- "details"
- ],
- "type": "object"
- },
- {
- "additionalProperties": false,
- "properties": {
- "details": {
- "additionalProperties": false,
- "properties": {
- "example_version": {
- "const": "ardaro.invoice-matching.example.v1"
- },
- "policy": {
- "additionalProperties": false,
- "properties": {
- "financial_posting_supported": {
- "const": false
- },
- "human_review_required": {
- "const": true
- },
- "payment_required": {
- "const": false
- }
- },
- "required": [
- "human_review_required",
- "financial_posting_supported",
- "payment_required"
- ],
- "type": "object"
- },
- "request": {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "additionalProperties": false,
- "description": "One invoice and one purchase order with caller-supplied opaque supplier identifiers. Runtime validation additionally rejects duplicate line IDs, padded/control-bearing strings, sensitive card or credential data, and requests over 262144 UTF-8 JSON bytes. All numeric inputs are decimal strings; missing optional arithmetic evidence requires review.",
- "properties": {
- "contract_version": {
- "const": "ardaro.agent-invoice-matching.request.v1"
- },
- "invoice": {
- "oneOf": [
- {
- "additionalProperties": false,
- "properties": {
- "currency": {
- "enum": [
- "JPY"
- ],
- "type": "string"
- },
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "maxLength": 26,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?![\\s\\S])",
- "type": "string"
- },
- "description": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "po_line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "product_code": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "quantity": {
- "maxLength": 19,
- "not": {
- "pattern": "^0(?:\\.0+)?(?![\\s\\S])"
- },
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "unit_price": {
- "maxLength": 19,
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "description",
- "line_id",
- "quantity",
- "unit",
- "unit_price"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "minItems": 1,
- "type": "array"
- },
- "purchase_order_reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "subtotal": {
- "maxLength": 26,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?![\\s\\S])",
- "type": "string"
- },
- "supplier_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "tax": {
- "maxLength": 26,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?![\\s\\S])",
- "type": "string"
- },
- "total": {
- "maxLength": 26,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "currency",
- "line_items",
- "purchase_order_reference",
- "reference",
- "supplier_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": false,
- "properties": {
- "currency": {
- "enum": [
- "USD",
- "EUR",
- "GBP",
- "CAD",
- "AUD",
- "MXN"
- ],
- "type": "string"
- },
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "maxLength": 29,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?(?![\\s\\S])",
- "type": "string"
- },
- "description": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "po_line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "product_code": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "quantity": {
- "maxLength": 19,
- "not": {
- "pattern": "^0(?:\\.0+)?(?![\\s\\S])"
- },
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "unit_price": {
- "maxLength": 19,
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "description",
- "line_id",
- "quantity",
- "unit",
- "unit_price"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "minItems": 1,
- "type": "array"
- },
- "purchase_order_reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "subtotal": {
- "maxLength": 29,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?(?![\\s\\S])",
- "type": "string"
- },
- "supplier_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "tax": {
- "maxLength": 29,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?(?![\\s\\S])",
- "type": "string"
- },
- "total": {
- "maxLength": 29,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "currency",
- "line_items",
- "purchase_order_reference",
- "reference",
- "supplier_id"
- ],
- "type": "object"
- }
- ]
- },
- "purchase_order": {
- "oneOf": [
- {
- "additionalProperties": false,
- "properties": {
- "currency": {
- "enum": [
- "JPY"
- ],
- "type": "string"
- },
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "maxLength": 26,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?![\\s\\S])",
- "type": "string"
- },
- "description": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "product_code": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "quantity": {
- "maxLength": 19,
- "not": {
- "pattern": "^0(?:\\.0+)?(?![\\s\\S])"
- },
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "unit_price": {
- "maxLength": 19,
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "description",
- "line_id",
- "quantity",
- "unit",
- "unit_price"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "minItems": 1,
- "type": "array"
- },
- "reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "supplier_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "currency",
- "line_items",
- "reference",
- "supplier_id"
- ],
- "type": "object"
- },
- {
- "additionalProperties": false,
- "properties": {
- "currency": {
- "enum": [
- "USD",
- "EUR",
- "GBP",
- "CAD",
- "AUD",
- "MXN"
- ],
- "type": "string"
- },
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "maxLength": 29,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?(?![\\s\\S])",
- "type": "string"
- },
- "description": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "product_code": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "quantity": {
- "maxLength": 19,
- "not": {
- "pattern": "^0(?:\\.0+)?(?![\\s\\S])"
- },
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "unit_price": {
- "maxLength": 19,
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "description",
- "line_id",
- "quantity",
- "unit",
- "unit_price"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "minItems": 1,
- "type": "array"
- },
- "reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "supplier_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "currency",
- "line_items",
- "reference",
- "supplier_id"
- ],
- "type": "object"
- }
- ]
- }
- },
- "required": [
- "contract_version",
- "invoice",
- "purchase_order"
- ],
- "type": "object"
- },
- "response": {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "additionalProperties": false,
- "properties": {
- "contract_version": {
- "const": "ardaro.agent-invoice-matching.response.v1"
- },
- "identities": {
- "additionalProperties": false,
- "properties": {
- "analysis_result_identity": {
- "pattern": "^res_[0-9a-f]{64}(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "analysis_result_identity"
- ],
- "type": "object"
- },
- "result": {
- "additionalProperties": false,
- "properties": {
- "arithmetic": {
- "additionalProperties": false,
- "properties": {
- "computed_invoice_total": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "invoice_currency_scale": {
- "enum": [
- 0,
- 2
- ]
- },
- "invoice_line_amount_sum": {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- "invoice_subtotal": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "invoice_subtotal_status": {
- "enum": [
- "consistent",
- "mismatch",
- "unavailable"
- ]
- },
- "invoice_supplied_line_amount_sum": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "invoice_tax": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "invoice_total": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "invoice_total_status": {
- "enum": [
- "consistent",
- "mismatch",
- "unavailable"
- ]
- },
- "purchase_order_currency_scale": {
- "enum": [
- 0,
- 2
- ]
- },
- "rounding_mode": {
- "const": "ROUND_HALF_UP"
- },
- "rounding_scope": {
- "const": "each_line_then_sum"
- }
- },
- "required": [
- "rounding_mode",
- "rounding_scope",
- "invoice_currency_scale",
- "purchase_order_currency_scale",
- "invoice_line_amount_sum",
- "invoice_supplied_line_amount_sum",
- "invoice_subtotal",
- "invoice_tax",
- "invoice_total",
- "computed_invoice_total",
- "invoice_subtotal_status",
- "invoice_total_status"
- ],
- "type": "object"
- },
- "comparison_rows": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "allocation_status": {
- "enum": [
- "allocated",
- "not_comparable",
- "unmatched"
- ]
- },
- "computed_invoice_amount": {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- "discrepancy_codes": {
- "items": {
- "enum": [
- "currency_mismatch",
- "supplier_mismatch",
- "purchase_order_reference_mismatch",
- "invoice_line_amount_unavailable",
- "purchase_order_line_amount_unavailable",
- "invoice_line_arithmetic_mismatch",
- "purchase_order_line_arithmetic_mismatch",
- "referenced_purchase_order_line_missing",
- "ambiguous_product_code",
- "unmatchable_invoice_line",
- "unit_mismatch",
- "product_code_mismatch",
- "unit_price_mismatch",
- "quantity_exceeds_purchase_order",
- "invoice_subtotal_unavailable",
- "invoice_tax_unavailable",
- "invoice_total_unavailable",
- "invoice_subtotal_mismatch",
- "invoice_supplied_line_sum_mismatch",
- "invoice_total_mismatch"
- ],
- "type": "string"
- },
- "maxItems": 20,
- "minItems": 0,
- "type": "array",
- "uniqueItems": true
- },
- "invoice_amount": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "invoice_currency": {
- "enum": [
- "USD",
- "EUR",
- "GBP",
- "CAD",
- "AUD",
- "MXN",
- "JPY"
- ]
- },
- "invoice_line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "invoice_quantity": {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- "invoice_source": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- "invoice_unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "invoice_unit_price": {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- "line_arithmetic_status": {
- "enum": [
- "consistent",
- "mismatch",
- "unavailable"
- ]
- },
- "match_method": {
- "enum": [
- "unmatched",
- "explicit_po_line_id",
- "exact_product_code"
- ]
- },
- "outcome": {
- "enum": [
- "no_discrepancies",
- "review_required"
- ]
- },
- "purchase_order_currency": {
- "enum": [
- "USD",
- "EUR",
- "GBP",
- "CAD",
- "AUD",
- "MXN",
- "JPY"
- ]
- },
- "purchase_order_line_id": {
- "anyOf": [
- {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "purchase_order_quantity": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "purchase_order_source": {
- "anyOf": [
- {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "purchase_order_unit": {
- "anyOf": [
- {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "purchase_order_unit_price": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "unit_price_difference": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^-?(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "required": [
- "invoice_line_id",
- "invoice_source",
- "purchase_order_line_id",
- "purchase_order_source",
- "match_method",
- "allocation_status",
- "invoice_quantity",
- "purchase_order_quantity",
- "invoice_unit",
- "purchase_order_unit",
- "invoice_unit_price",
- "purchase_order_unit_price",
- "invoice_currency",
- "purchase_order_currency",
- "unit_price_difference",
- "invoice_amount",
- "computed_invoice_amount",
- "line_arithmetic_status",
- "discrepancy_codes",
- "outcome"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "minItems": 1,
- "type": "array"
- },
- "discrepancies": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "code": {
- "enum": [
- "currency_mismatch",
- "supplier_mismatch",
- "purchase_order_reference_mismatch",
- "invoice_line_amount_unavailable",
- "purchase_order_line_amount_unavailable",
- "invoice_line_arithmetic_mismatch",
- "purchase_order_line_arithmetic_mismatch",
- "referenced_purchase_order_line_missing",
- "ambiguous_product_code",
- "unmatchable_invoice_line",
- "unit_mismatch",
- "product_code_mismatch",
- "unit_price_mismatch",
- "quantity_exceeds_purchase_order",
- "invoice_subtotal_unavailable",
- "invoice_tax_unavailable",
- "invoice_total_unavailable",
- "invoice_subtotal_mismatch",
- "invoice_supplied_line_sum_mismatch",
- "invoice_total_mismatch"
- ],
- "type": "string"
- },
- "message": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "severity": {
- "enum": [
- "error",
- "warning"
- ]
- },
- "sources": {
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- "maxItems": 101,
- "minItems": 1,
- "type": "array"
- }
- },
- "required": [
- "code",
- "severity",
- "message",
- "sources"
- ],
- "type": "object"
- },
- "maxItems": 1000,
- "minItems": 0,
- "type": "array"
- },
- "document_checks": {
- "additionalProperties": false,
- "properties": {
- "currency_matches": {
- "type": "boolean"
- },
- "purchase_order_reference_matches": {
- "type": "boolean"
- },
- "supplier_matches": {
- "type": "boolean"
- }
- },
- "required": [
- "currency_matches",
- "supplier_matches",
- "purchase_order_reference_matches"
- ],
- "type": "object"
- },
- "policy": {
- "additionalProperties": false,
- "properties": {
- "arithmetic_scope": {
- "maxLength": 300,
- "minLength": 1,
- "type": "string"
- },
- "decision_scope": {
- "maxLength": 300,
- "minLength": 1,
- "type": "string"
- },
- "delivery_verification_supported": {
- "const": false
- },
- "financial_posting_performed": {
- "const": false
- },
- "financial_posting_supported": {
- "const": false
- },
- "human_review_required": {
- "const": true
- },
- "identity_purpose": {
- "const": "deterministic_result_comparison_only"
- },
- "matching_rule": {
- "const": "explicit_po_line_id_else_unique_case_sensitive_product_code"
- },
- "model_calls": {
- "const": 0
- },
- "payment_approval_supported": {
- "const": false
- },
- "quantity_scope": {
- "maxLength": 300,
- "minLength": 1,
- "type": "string"
- },
- "raw_documents_retained": {
- "const": false
- },
- "stateless": {
- "const": true
- },
- "supplier_scope": {
- "maxLength": 300,
- "minLength": 1,
- "type": "string"
- }
- },
- "required": [
- "human_review_required",
- "stateless",
- "raw_documents_retained",
- "financial_posting_supported",
- "financial_posting_performed",
- "payment_approval_supported",
- "delivery_verification_supported",
- "model_calls",
- "identity_purpose",
- "matching_rule",
- "quantity_scope",
- "arithmetic_scope",
- "supplier_scope",
- "decision_scope"
- ],
- "type": "object"
- },
- "purchase_order_line_summary": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "allocated_invoice_sources": {
- "items": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- "maxItems": 100,
- "minItems": 0,
- "type": "array"
- },
- "allocated_quantity": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "computed_amount": {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- "line_arithmetic_status": {
- "enum": [
- "consistent",
- "mismatch",
- "unavailable"
- ]
- },
- "ordered_quantity": {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- "overbilled_quantity": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "purchase_order_line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "purchase_order_source": {
- "maxLength": 100,
- "minLength": 1,
- "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- "status": {
- "enum": [
- "not_comparable",
- "not_invoiced",
- "overbilled",
- "fully_invoiced",
- "partially_invoiced"
- ]
- },
- "supplied_amount": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "uninvoiced_quantity": {
- "anyOf": [
- {
- "maxLength": 42,
- "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [
- "purchase_order_line_id",
- "purchase_order_source",
- "allocated_invoice_sources",
- "ordered_quantity",
- "allocated_quantity",
- "uninvoiced_quantity",
- "overbilled_quantity",
- "unit",
- "status",
- "supplied_amount",
- "computed_amount",
- "line_arithmetic_status"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "minItems": 1,
- "type": "array"
- },
- "summary": {
- "additionalProperties": false,
- "properties": {
- "delivery_verified": {
- "const": false
- },
- "discrepancy_count": {
- "maximum": 1000,
- "minimum": 0,
- "type": "integer"
- },
- "human_review_required": {
- "const": true
- },
- "invoice_line_count": {
- "maximum": 100,
- "minimum": 0,
- "type": "integer"
- },
- "matched_invoice_line_count": {
- "maximum": 100,
- "minimum": 0,
- "type": "integer"
- },
- "outcome": {
- "enum": [
- "no_discrepancies",
- "review_required"
- ]
- },
- "payment_approved": {
- "const": false
- },
- "purchase_order_line_count": {
- "maximum": 100,
- "minimum": 0,
- "type": "integer"
- },
- "unknown_check_count": {
- "maximum": 1000,
- "minimum": 0,
- "type": "integer"
- },
- "unmatched_invoice_line_count": {
- "maximum": 100,
- "minimum": 0,
- "type": "integer"
- }
- },
- "required": [
- "outcome",
- "invoice_line_count",
- "purchase_order_line_count",
- "matched_invoice_line_count",
- "unmatched_invoice_line_count",
- "discrepancy_count",
- "unknown_check_count",
- "human_review_required",
- "delivery_verified",
- "payment_approved"
- ],
- "type": "object"
- }
- },
- "required": [
- "summary",
- "document_checks",
- "comparison_rows",
- "purchase_order_line_summary",
- "discrepancies",
- "arithmetic",
- "policy"
- ],
- "type": "object"
- },
- "status": {
- "const": "review_required"
- }
- },
- "required": [
- "contract_version",
- "status",
- "result",
- "identities"
- ],
- "type": "object"
- },
- "synthetic_only": {
- "const": true
- }
- },
- "required": [
- "example_version",
- "synthetic_only",
- "request",
- "response",
- "policy"
- ],
- "type": "object"
- },
- "service": {
- "const": "invoice"
- }
- },
- "required": [
- "service",
- "details"
- ],
- "type": "object"
- },
- {
- "additionalProperties": false,
- "properties": {
- "details": {
- "properties": {
- "request": {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "additionalProperties": false,
- "description": "Free comparison of one receipt, invoice and purchase order supplied in this request. Missing documents or fields produce needs_review. Maximum 100 lines per document and 196608 UTF-8 JSON bytes. No images, URLs, credentials, account access, or paid tool calls. Money amounts must use the supported currency's minor-unit precision; runtime also rejects sensitive data, padded strings and control characters.",
- "properties": {
- "invoice": {
- "additionalProperties": false,
- "description": "Caller-supplied structured data. Use opaque supplier IDs and decimal strings; omit unknown fields. Receipt kind describes the source document, not verified delivery. Field names align with invoice matching; receipt extraction output must be mapped explicitly.",
- "properties": {
- "currency": {
- "pattern": "^[A-Z]{3}(?![\\s\\S])",
- "type": "string"
- },
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "description": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "po_line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "product_code": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "quantity": {
- "maxLength": 19,
- "not": {
- "pattern": "^0(?:\\.0+)?(?![\\s\\S])"
- },
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "unit_price": {
- "maxLength": 19,
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [],
- "type": "object"
- },
- "maxItems": 100,
- "type": "array"
- },
- "purchase_order_reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "subtotal": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "supplier_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "tax": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "total": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [],
- "type": "object"
- },
- "purchase_order": {
- "additionalProperties": false,
- "description": "Caller-supplied structured data. Use opaque supplier IDs and decimal strings; omit unknown fields. Receipt kind describes the source document, not verified delivery. Field names align with invoice matching; receipt extraction output must be mapped explicitly.",
- "properties": {
- "currency": {
- "pattern": "^[A-Z]{3}(?![\\s\\S])",
- "type": "string"
- },
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "description": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "product_code": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "quantity": {
- "maxLength": 19,
- "not": {
- "pattern": "^0(?:\\.0+)?(?![\\s\\S])"
- },
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "unit_price": {
- "maxLength": 19,
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [],
- "type": "object"
- },
- "maxItems": 100,
- "type": "array"
- },
- "reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "subtotal": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "supplier_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "tax": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "total": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [],
- "type": "object"
- },
- "receipt": {
- "additionalProperties": false,
- "description": "Caller-supplied structured data. Use opaque supplier IDs and decimal strings; omit unknown fields. Receipt kind describes the source document, not verified delivery. Field names align with invoice matching; receipt extraction output must be mapped explicitly.",
- "properties": {
- "currency": {
- "pattern": "^[A-Z]{3}(?![\\s\\S])",
- "type": "string"
- },
- "invoice_reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "kind": {
- "enum": [
- "expense_receipt",
- "delivery_receipt"
- ]
- },
- "line_items": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "description": {
- "maxLength": 240,
- "minLength": 1,
- "type": "string"
- },
- "invoice_line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "line_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "product_code": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "quantity": {
- "maxLength": 19,
- "not": {
- "pattern": "^0(?:\\.0+)?(?![\\s\\S])"
- },
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "unit": {
- "maxLength": 32,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "unit_price": {
- "maxLength": 19,
- "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [],
- "type": "object"
- },
- "maxItems": 100,
- "type": "array"
- },
- "purchase_order_reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "reference": {
- "maxLength": 80,
- "minLength": 1,
- "type": "string"
- },
- "subtotal": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "supplier_id": {
- "maxLength": 80,
- "minLength": 1,
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*(?![\\s\\S])",
- "type": "string"
- },
- "tax": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- },
- "total": {
- "maxLength": 33,
- "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?(?![\\s\\S])",
- "type": "string"
- }
- },
- "required": [],
- "type": "object"
- }
- },
- "required": [],
- "type": "object"
- },
- "response": {
- "$schema": "https://json-schema.org/draft/2020-12/schema",
- "oneOf": [
- {
- "additionalProperties": false,
- "properties": {
- "comparisons": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "document_identity_comparable": {
- "type": "boolean"
- },
- "pair": {
- "enum": [
- "receipt_to_invoice",
- "invoice_to_purchase_order"
- ]
- },
- "rows": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "amount_difference": {
- "maxLength": 50,
- "pattern": "^-?(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": [
- "string",
- "null"
- ]
- },
- "candidate_targets": {
- "items": {
- "maxLength": 100,
- "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- "maxItems": 100,
- "type": "array"
- },
- "comparison_performed": {
- "type": "boolean"
- },
- "match_method": {
- "enum": [
- "unmatched",
- "explicit_line_reference",
- "exact_product_code",
- "normalized_description"
- ]
- },
- "quantity_difference": {
- "maxLength": 50,
- "pattern": "^-?(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": [
- "string",
- "null"
- ]
- },
- "source": {
- "maxLength": 100,
- "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- "status": {
- "enum": [
- "no_discrepancies",
- "needs_review"
- ]
- },
- "target": {
- "anyOf": [
- {
- "maxLength": 100,
- "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "unit_price_difference": {
- "maxLength": 50,
- "pattern": "^-?(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?(?![\\s\\S])",
- "type": [
- "string",
- "null"
- ]
- }
- },
- "required": [
- "source",
- "target",
- "candidate_targets",
- "match_method",
- "comparison_performed",
- "status",
- "quantity_difference",
- "unit_price_difference",
- "amount_difference"
- ],
- "type": "object"
- },
- "maxItems": 100,
- "type": "array"
- },
- "status": {
- "enum": [
- "no_discrepancies",
- "needs_review"
- ]
- }
- },
- "required": [
- "pair",
- "status",
- "document_identity_comparable",
- "rows"
- ],
- "type": "object"
- },
- "maxItems": 2,
- "minItems": 2,
- "type": "array"
- },
- "contract_version": {
- "const": "ardaro.purchase-document-reconciliation.response.v1"
- },
- "delivery_verified": {
- "const": false
- },
- "discrepancies": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "code": {
- "maxLength": 80,
- "pattern": "^[a-z_]+(?![\\s\\S])",
- "type": "string"
- },
- "scope": {
- "enum": [
- "receipt",
- "invoice",
- "purchase_order",
- "receipt_to_invoice",
- "invoice_to_purchase_order"
- ]
- },
- "severity": {
- "enum": [
- "unknown",
- "discrepancy"
- ]
- },
- "sources": {
- "items": {
- "maxLength": 100,
- "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*(?![\\s\\S])",
- "type": "string"
- },
- "maxItems": 101,
- "type": "array"
- }
- },
- "required": [
- "code",
- "scope",
- "severity",
- "sources"
- ],
- "type": "object"
- },
- "maxItems": 6000,
- "type": "array"
- },
- "document_summary": {
- "items": {
- "additionalProperties": false,
- "properties": {
- "currency_minor_units": {
- "enum": [
- 0,
- 2,
- null
- ]
- },
- "currency_supported": {
- "type": "boolean"
- },
- "document": {
- "enum": [
- "receipt",
- "invoice",
- "purchase_order"
- ]
- },
- "line_count": {
- "maximum": 100,
- "minimum": 0,
- "type": "integer"
- },
- "present": {
- "type": "boolean"
- }
- },
- "required": [
- "document",
- "present",
- "line_count",
- "currency_supported",
- "currency_minor_units"
- ],
- "type": "object"
- },
- "maxItems": 3,
- "minItems": 3,
- "type": "array"
- },
- "financial_posting_performed": {
- "const": false
- },
- "human_review_required": {
- "const": true
- },
- "payment_approved": {
- "const": false
- },
- "policy": {
- "const": {
- "arithmetic_scope": "Exact decimal comparisons with per-line ROUND_HALF_UP at supported currency precision. No tax applicability, discounts, freight or currency conversion is inferred.",
- "decision_scope": "No discrepancies means the supported checks found none in supplied data. It is not payment authorization, accounting approval or supplier verification.",
- "document_storage_performed": false,
- "matching_rule": "explicit line reference, else unique exact case-sensitive product code, else unique NFKC/casefold/whitespace-normalized description when both product codes are absent; never fuzzy or semantic",
- "model_calls": 0,
- "paid_tool_calls": 0,
- "payment_required": false,
- "quantity_scope": "Differences concern only these three supplied documents. Partial receipts, partial invoicing, prior invoices, returns and delivery events are not inferred.",
- "receipt_scope": "An expense receipt is not evidence of delivery. A delivery_receipt label is caller-supplied and does not authenticate delivery.",
- "retention_scope": "This function retains no documents or results; caller and transport retention are outside this function's guarantees."
- }
- },
- "provenance": {
- "const": {
- "document_authenticity_verified": false,
- "external_data_fetched": false,
- "source": "caller_supplied_documents_only",
- "source_pointer_root": "original_arguments"
- }
- },
- "result_identity": {
- "pattern": "^res_[0-9a-f]{64}(?![\\s\\S])",
- "type": "string"
- },
- "status": {
- "enum": [
- "no_discrepancies",
- "needs_review"
- ]
- }
- },
- "required": [
- "contract_version",
- "human_review_required",
- "payment_approved",
- "delivery_verified",
- "financial_posting_performed",
- "provenance",
- "policy",
- "status",
- "result_identity",
- "document_summary",
- "comparisons",
- "discrepancies"
- ],
- "type": "object"
- },
- {
- "additionalProperties": false,
- "properties": {
- "contract_version": {
- "const": "ardaro.purchase-document-reconciliation.response.v1"
- },
- "error": {
- "additionalProperties": false,
- "properties": {
- "code": {
- "maxLength": 80,
- "type": "string"
- },
- "message": {
- "maxLength": 300,
- "type": "string"
- }
- },
- "required": [
- "code",
- "message"
- ],
- "type": "object"
- },
- "status": {
- "const": "error"
- }
- },
- "required": [
- "contract_version",
- "status",
- "error"
- ],
- "type": "object"
- }
- ],
- "type": "object"
- }
- },
- "required": [
- "request",
- "response"
- ],
- "type": "object"
- },
- "service": {
- "const": "reconciliation"
- }
- },
- "required": [
- "service",
- "details"
- ],
- "type": "object"
- }
-]New value: +[
+ {
+ "additionalProperties": false,
+ "properties": {
+ "details": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "additionalProperties": false,
+ "properties": {
+ "example_version": {
+ "const": "ardaro.receipt-intelligence.example.v1"
+ },
+ "expected_response": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "additionalProperties": false,
+ "description": "Receipt Intelligence v1 response. result is authoritative; receipt is a derived compatibility projection that MUST match result.",
+ "properties": {
+ "arithmetic_consistency": {
+ "enum": [
+ "verified",
+ "mismatch",
+ "unavailable"
+ ]
+ },
+ "arithmetic_verified": {
+ "type": [
+ "boolean",
+ "null"
+ ]
+ },
+ "confidence": {
+ "type": "object"
+ },
+ "contract_version": {
+ "const": "ardaro.agent-receipt-intelligence.response.v1"
+ },
+ "duplicate_check": {
+ "type": "object"
+ },
+ "duplicate_fingerprint": {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "engine": {
+ "type": "object"
+ },
+ "identities": {
+ "additionalProperties": false,
+ "properties": {
+ "analysis_result_identity": {
+ "pattern": "^res_[0-9a-f]{64}$",
+ "type": "string"
+ },
+ "document_fingerprint": {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "request_identity": {
+ "pattern": "^req_[0-9a-f]{64}$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "request_identity",
+ "document_fingerprint",
+ "analysis_result_identity"
+ ],
+ "type": "object"
+ },
+ "metering": {
+ "type": "object"
+ },
+ "payment_identity": {
+ "additionalProperties": false,
+ "properties": {
+ "protocol": {
+ "const": "x402-v2"
+ },
+ "reference": {
+ "pattern": "^pay_[0-9a-f]{64}$",
+ "type": "string"
+ },
+ "replayed": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "protocol",
+ "reference",
+ "replayed"
+ ],
+ "type": "object"
+ },
+ "policy": {
+ "type": "object"
+ },
+ "receipt": {
+ "additionalProperties": false,
+ "description": "Non-authoritative compatibility projection generated from result under ardaro.result-receipt-projection.v1. Consumers MUST use result for structured receipt values and reject a response when this projection diverges.",
+ "properties": {
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "description": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "product_code": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "quantity": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "unit_price": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "required": [
+ "description",
+ "product_code",
+ "quantity",
+ "unit_price",
+ "amount"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "purchase_date": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 10,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "purchase_order": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "receipt_reference": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "totals": {
+ "additionalProperties": false,
+ "properties": {
+ "currency": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 3,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "subtotal": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "tax": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "total": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "required": [
+ "subtotal",
+ "tax",
+ "total",
+ "currency"
+ ],
+ "type": "object"
+ },
+ "vendor": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "required": [
+ "vendor",
+ "purchase_date",
+ "totals",
+ "line_items"
+ ],
+ "type": "object"
+ },
+ "result": {
+ "additionalProperties": false,
+ "description": "Sole authoritative structured analysis object. Its recursively key-sorted, compact UTF-8 JSON bytes are SHA-256 hashed under ardaro.recursive-key-sort-compact-json-utf8-sha256.v1 and published as analysis_result_identity.",
+ "properties": {
+ "extracted_facts": {
+ "additionalProperties": false,
+ "properties": {
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "description": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "product_code": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "quantity": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "unit_price": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "required": [
+ "description",
+ "product_code",
+ "quantity",
+ "unit_price",
+ "amount"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "purchase_date": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 10,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "purchase_order": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "receipt_reference": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "totals.currency": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 3,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "totals.subtotal": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "totals.tax": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "totals.total": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ },
+ "vendor": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ },
+ "required": [
+ "line_items"
+ ],
+ "type": "object"
+ },
+ "inferred_suggestions": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "field": {
+ "enum": [
+ "vendor",
+ "purchase_date",
+ "purchase_order",
+ "receipt_reference",
+ "totals.subtotal",
+ "totals.tax",
+ "totals.total",
+ "totals.currency"
+ ]
+ },
+ "value": {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "additionalProperties": false,
+ "properties": {
+ "level": {
+ "enum": [
+ "high",
+ "medium",
+ "low"
+ ]
+ },
+ "score": {
+ "maximum": 1,
+ "minimum": 0,
+ "type": "number"
+ }
+ },
+ "required": [
+ "score",
+ "level"
+ ],
+ "type": "object"
+ },
+ "source": {
+ "enum": [
+ "structured_summary",
+ "structured_line_item",
+ "provider_neutral",
+ "text_fallback",
+ "inferred"
+ ]
+ },
+ "value": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "value",
+ "confidence",
+ "source"
+ ],
+ "type": "object"
+ }
+ },
+ "required": [
+ "field",
+ "value"
+ ],
+ "type": "object"
+ },
+ "maxItems": 8,
+ "type": "array"
+ },
+ "provenance": {
+ "type": "object"
+ },
+ "unavailable_fields": {
+ "items": {
+ "enum": [
+ "purchase order reference",
+ "purchase_date",
+ "receipt or invoice number",
+ "totals.currency",
+ "totals.subtotal",
+ "totals.tax",
+ "totals.total",
+ "vendor"
+ ]
+ },
+ "type": "array",
+ "uniqueItems": true
+ },
+ "validation": {
+ "type": "object"
+ }
+ },
+ "required": [
+ "extracted_facts",
+ "inferred_suggestions",
+ "unavailable_fields",
+ "validation",
+ "provenance"
+ ],
+ "type": "object"
+ },
+ "service": {
+ "const": "ardaro.receipt_intelligence"
+ },
+ "status": {
+ "const": "review_required"
+ },
+ "version": {
+ "const": "1.0.0"
+ },
+ "warning_groups": {
+ "type": "object"
+ },
+ "warnings": {
+ "items": {
+ "type": "object"
+ },
+ "maxItems": 64,
+ "type": "array"
+ }
+ },
+ "required": [
+ "contract_version",
+ "service",
+ "version",
+ "status",
+ "engine",
+ "receipt",
+ "confidence",
+ "duplicate_check",
+ "duplicate_fingerprint",
+ "arithmetic_verified",
+ "arithmetic_consistency",
+ "warnings",
+ "warning_groups",
+ "identities",
+ "result",
+ "metering",
+ "policy"
+ ],
+ "type": "object",
+ "x-ardaro-analysis-result-identity-profile": "ardaro.recursive-key-sort-compact-json-utf8-sha256.v1",
+ "x-ardaro-authoritative-analysis-path": "$.result",
+ "x-ardaro-receipt-compatibility-path": "$.receipt",
+ "x-ardaro-receipt-projection-profile": "ardaro.result-receipt-projection.v1"
+ },
+ "input_description": {
+ "type": "string"
+ },
+ "limits": {
+ "additionalProperties": false,
+ "properties": {
+ "max_existing_fingerprints": {
+ "minimum": 1,
+ "type": "integer"
+ },
+ "max_line_items": {
+ "minimum": 1,
+ "type": "integer"
+ },
+ "max_pages": {
+ "minimum": 1,
+ "type": "integer"
+ },
+ "max_request_bytes": {
+ "minimum": 1,
+ "type": "integer"
+ },
+ "max_text_characters": {
+ "minimum": 1,
+ "type": "integer"
+ },
+ "normal_latency_target_ms": {
+ "minimum": 1,
+ "type": "integer"
+ },
+ "request_timeout_ms": {
+ "minimum": 1,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "max_existing_fingerprints",
+ "max_line_items",
+ "max_pages",
+ "max_request_bytes",
+ "max_text_characters",
+ "normal_latency_target_ms",
+ "request_timeout_ms"
+ ],
+ "type": "object"
+ },
+ "paid_processing_performed": {
+ "const": false
+ },
+ "request": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "additionalProperties": false,
+ "properties": {
+ "contract_version": {
+ "const": "ardaro.agent-receipt-intelligence.request.v1",
+ "description": "Required request contract identifier; send this exact version string."
+ },
+ "existing_fingerprints": {
+ "description": "Receipt fingerprints already known to the caller for duplicate comparison. Supply lowercase 64-character SHA-256 hex strings, or an empty array when none are available; at most 10,000 entries.",
+ "items": {
+ "pattern": "^[0-9a-f]{64}$",
+ "type": "string"
+ },
+ "maxItems": 10000,
+ "type": "array"
+ },
+ "input": {
+ "description": "One receipt supplied as bounded OCR text or a provider-neutral structured extraction. Choose exactly one input kind.",
+ "oneOf": [
+ {
+ "additionalProperties": false,
+ "properties": {
+ "kind": {
+ "const": "text",
+ "description": "Selects receipt text input; supply the text property."
+ },
+ "text": {
+ "description": "OCR or receipt text for one document, up to 20,000 characters. Exclude payment-card data, credentials, customer-record payloads, and financial posting instructions.",
+ "maxLength": 20000,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "kind",
+ "text"
+ ],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "analysis": {
+ "additionalProperties": false,
+ "description": "Provider-neutral receipt extraction using only the listed fields. Omit fields that were not extracted.",
+ "minProperties": 1,
+ "properties": {
+ "currency": {
+ "description": "Three-letter currency code shown on the receipt, for example USD. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 3,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 3,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "line_items": {
+ "description": "Extracted receipt line items, limited to 100 entries; omit unavailable item fields.",
+ "items": {
+ "additionalProperties": false,
+ "minProperties": 1,
+ "properties": {
+ "amount": {
+ "description": "Extended amount printed for this line item, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "description": {
+ "description": "Item description printed on the receipt. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "product_code": {
+ "description": "Product identifier or SKU printed for this line item. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "quantity": {
+ "description": "Quantity purchased for this line item. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "unit_price": {
+ "description": "Price per unit for this line item, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "type": "object"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "purchase_date": {
+ "description": "Purchase date as extracted; YYYY-MM-DD is recommended. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 10,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 10,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "purchase_order": {
+ "description": "Purchase-order reference printed on the receipt; this does not select or link an Ardaro job. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "receipt_reference": {
+ "description": "Receipt, invoice, or transaction reference printed on the document. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "subtotal": {
+ "description": "Receipt subtotal before tax, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "tax": {
+ "description": "Total tax amount printed on the receipt, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "total": {
+ "description": "Final receipt total, in the receipt currency. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 32,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "vendor": {
+ "description": "Merchant or supplier name printed on the receipt. Supply the extracted value directly or wrap it with optional extraction confidence.",
+ "oneOf": [
+ {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "confidence": {
+ "description": "Optional caller-supplied extraction confidence: 0 to 1 is a fraction; values greater than 1 are percentages up to 100. A value of 1 means full confidence.",
+ "maximum": 100,
+ "minimum": 0,
+ "type": "number"
+ },
+ "value": {
+ "description": "The extracted field value, supplied as text or a number before receipt normalization.",
+ "oneOf": [
+ {
+ "maxLength": 160,
+ "minLength": 1,
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ }
+ },
+ "required": [
+ "value"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "type": "object"
+ },
+ "kind": {
+ "const": "structured",
+ "description": "Selects structured receipt input; supply the analysis property."
+ }
+ },
+ "required": [
+ "kind",
+ "analysis"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "required": [
+ "contract_version",
+ "input",
+ "existing_fingerprints"
+ ],
+ "type": "object"
+ },
+ "synthetic_only": {
+ "const": true
+ }
+ },
+ "required": [
+ "example_version",
+ "synthetic_only",
+ "paid_processing_performed",
+ "input_description",
+ "request",
+ "expected_response",
+ "limits"
+ ],
+ "type": "object"
+ },
+ "service": {
+ "const": "receipt"
+ }
+ },
+ "required": [
+ "service",
+ "details"
+ ],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "details": {
+ "additionalProperties": false,
+ "properties": {
+ "example_version": {
+ "const": "ardaro.invoice-matching.example.v1"
+ },
+ "policy": {
+ "additionalProperties": false,
+ "properties": {
+ "financial_posting_supported": {
+ "const": false
+ },
+ "human_review_required": {
+ "const": true
+ },
+ "payment_required": {
+ "const": false
+ }
+ },
+ "required": [
+ "human_review_required",
+ "financial_posting_supported",
+ "payment_required"
+ ],
+ "type": "object"
+ },
+ "request": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "additionalProperties": false,
+ "description": "One invoice and one purchase order with caller-supplied opaque supplier identifiers. Runtime validation additionally rejects duplicate line IDs, padded/control-bearing strings, sensitive card or credential data, and requests over 262144 UTF-8 JSON bytes. All numeric inputs are decimal strings; missing optional arithmetic evidence requires review.",
+ "properties": {
+ "contract_version": {
+ "const": "ardaro.agent-invoice-matching.request.v1"
+ },
+ "invoice": {
+ "oneOf": [
+ {
+ "additionalProperties": false,
+ "properties": {
+ "currency": {
+ "enum": [
+ "JPY"
+ ],
+ "type": "string"
+ },
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "maxLength": 26,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})$",
+ "type": "string"
+ },
+ "description": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "po_line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "product_code": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "quantity": {
+ "allOf": [
+ {
+ "not": {
+ "pattern": "^0(?:\\.0+)?$"
+ }
+ }
+ ],
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "unit_price": {
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "description",
+ "line_id",
+ "quantity",
+ "unit",
+ "unit_price"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "minItems": 1,
+ "type": "array"
+ },
+ "purchase_order_reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "subtotal": {
+ "maxLength": 26,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})$",
+ "type": "string"
+ },
+ "supplier_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "tax": {
+ "maxLength": 26,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})$",
+ "type": "string"
+ },
+ "total": {
+ "maxLength": 26,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "currency",
+ "line_items",
+ "purchase_order_reference",
+ "reference",
+ "supplier_id"
+ ],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "currency": {
+ "enum": [
+ "USD",
+ "EUR",
+ "GBP",
+ "CAD",
+ "AUD",
+ "MXN"
+ ],
+ "type": "string"
+ },
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "maxLength": 29,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?$",
+ "type": "string"
+ },
+ "description": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "po_line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "product_code": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "quantity": {
+ "allOf": [
+ {
+ "not": {
+ "pattern": "^0(?:\\.0+)?$"
+ }
+ }
+ ],
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "unit_price": {
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "description",
+ "line_id",
+ "quantity",
+ "unit",
+ "unit_price"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "minItems": 1,
+ "type": "array"
+ },
+ "purchase_order_reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "subtotal": {
+ "maxLength": 29,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?$",
+ "type": "string"
+ },
+ "supplier_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "tax": {
+ "maxLength": 29,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?$",
+ "type": "string"
+ },
+ "total": {
+ "maxLength": 29,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "currency",
+ "line_items",
+ "purchase_order_reference",
+ "reference",
+ "supplier_id"
+ ],
+ "type": "object"
+ }
+ ]
+ },
+ "purchase_order": {
+ "oneOf": [
+ {
+ "additionalProperties": false,
+ "properties": {
+ "currency": {
+ "enum": [
+ "JPY"
+ ],
+ "type": "string"
+ },
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "maxLength": 26,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})$",
+ "type": "string"
+ },
+ "description": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "product_code": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "quantity": {
+ "allOf": [
+ {
+ "not": {
+ "pattern": "^0(?:\\.0+)?$"
+ }
+ }
+ ],
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "unit_price": {
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "description",
+ "line_id",
+ "quantity",
+ "unit",
+ "unit_price"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "minItems": 1,
+ "type": "array"
+ },
+ "reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "supplier_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "currency",
+ "line_items",
+ "reference",
+ "supplier_id"
+ ],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "currency": {
+ "enum": [
+ "USD",
+ "EUR",
+ "GBP",
+ "CAD",
+ "AUD",
+ "MXN"
+ ],
+ "type": "string"
+ },
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "maxLength": 29,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,2})?$",
+ "type": "string"
+ },
+ "description": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "product_code": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "quantity": {
+ "allOf": [
+ {
+ "not": {
+ "pattern": "^0(?:\\.0+)?$"
+ }
+ }
+ ],
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "unit_price": {
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "description",
+ "line_id",
+ "quantity",
+ "unit",
+ "unit_price"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "minItems": 1,
+ "type": "array"
+ },
+ "reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "supplier_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "currency",
+ "line_items",
+ "reference",
+ "supplier_id"
+ ],
+ "type": "object"
+ }
+ ]
+ }
+ },
+ "required": [
+ "contract_version",
+ "invoice",
+ "purchase_order"
+ ],
+ "type": "object"
+ },
+ "response": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "additionalProperties": false,
+ "properties": {
+ "contract_version": {
+ "const": "ardaro.agent-invoice-matching.response.v1"
+ },
+ "identities": {
+ "additionalProperties": false,
+ "properties": {
+ "analysis_result_identity": {
+ "pattern": "^res_[0-9a-f]{64}$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "analysis_result_identity"
+ ],
+ "type": "object"
+ },
+ "result": {
+ "additionalProperties": false,
+ "properties": {
+ "arithmetic": {
+ "additionalProperties": false,
+ "properties": {
+ "computed_invoice_total": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "invoice_currency_scale": {
+ "enum": [
+ 0,
+ 2
+ ]
+ },
+ "invoice_line_amount_sum": {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ "invoice_subtotal": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "invoice_subtotal_status": {
+ "enum": [
+ "consistent",
+ "mismatch",
+ "unavailable"
+ ]
+ },
+ "invoice_supplied_line_amount_sum": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "invoice_tax": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "invoice_total": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "invoice_total_status": {
+ "enum": [
+ "consistent",
+ "mismatch",
+ "unavailable"
+ ]
+ },
+ "purchase_order_currency_scale": {
+ "enum": [
+ 0,
+ 2
+ ]
+ },
+ "rounding_mode": {
+ "const": "ROUND_HALF_UP"
+ },
+ "rounding_scope": {
+ "const": "each_line_then_sum"
+ }
+ },
+ "required": [
+ "rounding_mode",
+ "rounding_scope",
+ "invoice_currency_scale",
+ "purchase_order_currency_scale",
+ "invoice_line_amount_sum",
+ "invoice_supplied_line_amount_sum",
+ "invoice_subtotal",
+ "invoice_tax",
+ "invoice_total",
+ "computed_invoice_total",
+ "invoice_subtotal_status",
+ "invoice_total_status"
+ ],
+ "type": "object"
+ },
+ "comparison_rows": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "allocation_status": {
+ "enum": [
+ "allocated",
+ "not_comparable",
+ "unmatched"
+ ]
+ },
+ "computed_invoice_amount": {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ "discrepancy_codes": {
+ "items": {
+ "enum": [
+ "currency_mismatch",
+ "supplier_mismatch",
+ "purchase_order_reference_mismatch",
+ "invoice_line_amount_unavailable",
+ "purchase_order_line_amount_unavailable",
+ "invoice_line_arithmetic_mismatch",
+ "purchase_order_line_arithmetic_mismatch",
+ "referenced_purchase_order_line_missing",
+ "ambiguous_product_code",
+ "unmatchable_invoice_line",
+ "unit_mismatch",
+ "product_code_mismatch",
+ "unit_price_mismatch",
+ "quantity_exceeds_purchase_order",
+ "invoice_subtotal_unavailable",
+ "invoice_tax_unavailable",
+ "invoice_total_unavailable",
+ "invoice_subtotal_mismatch",
+ "invoice_supplied_line_sum_mismatch",
+ "invoice_total_mismatch"
+ ],
+ "type": "string"
+ },
+ "maxItems": 20,
+ "minItems": 0,
+ "type": "array",
+ "uniqueItems": true
+ },
+ "invoice_amount": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "invoice_currency": {
+ "enum": [
+ "USD",
+ "EUR",
+ "GBP",
+ "CAD",
+ "AUD",
+ "MXN",
+ "JPY"
+ ]
+ },
+ "invoice_line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "invoice_quantity": {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ "invoice_source": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ "invoice_unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "invoice_unit_price": {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ "line_arithmetic_status": {
+ "enum": [
+ "consistent",
+ "mismatch",
+ "unavailable"
+ ]
+ },
+ "match_method": {
+ "enum": [
+ "unmatched",
+ "explicit_po_line_id",
+ "exact_product_code"
+ ]
+ },
+ "outcome": {
+ "enum": [
+ "no_discrepancies",
+ "review_required"
+ ]
+ },
+ "purchase_order_currency": {
+ "enum": [
+ "USD",
+ "EUR",
+ "GBP",
+ "CAD",
+ "AUD",
+ "MXN",
+ "JPY"
+ ]
+ },
+ "purchase_order_line_id": {
+ "anyOf": [
+ {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "purchase_order_quantity": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "purchase_order_source": {
+ "anyOf": [
+ {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "purchase_order_unit": {
+ "anyOf": [
+ {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "purchase_order_unit_price": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "unit_price_difference": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^-?(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "invoice_line_id",
+ "invoice_source",
+ "purchase_order_line_id",
+ "purchase_order_source",
+ "match_method",
+ "allocation_status",
+ "invoice_quantity",
+ "purchase_order_quantity",
+ "invoice_unit",
+ "purchase_order_unit",
+ "invoice_unit_price",
+ "purchase_order_unit_price",
+ "invoice_currency",
+ "purchase_order_currency",
+ "unit_price_difference",
+ "invoice_amount",
+ "computed_invoice_amount",
+ "line_arithmetic_status",
+ "discrepancy_codes",
+ "outcome"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "minItems": 1,
+ "type": "array"
+ },
+ "discrepancies": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "code": {
+ "enum": [
+ "currency_mismatch",
+ "supplier_mismatch",
+ "purchase_order_reference_mismatch",
+ "invoice_line_amount_unavailable",
+ "purchase_order_line_amount_unavailable",
+ "invoice_line_arithmetic_mismatch",
+ "purchase_order_line_arithmetic_mismatch",
+ "referenced_purchase_order_line_missing",
+ "ambiguous_product_code",
+ "unmatchable_invoice_line",
+ "unit_mismatch",
+ "product_code_mismatch",
+ "unit_price_mismatch",
+ "quantity_exceeds_purchase_order",
+ "invoice_subtotal_unavailable",
+ "invoice_tax_unavailable",
+ "invoice_total_unavailable",
+ "invoice_subtotal_mismatch",
+ "invoice_supplied_line_sum_mismatch",
+ "invoice_total_mismatch"
+ ],
+ "type": "string"
+ },
+ "message": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "severity": {
+ "enum": [
+ "error",
+ "warning"
+ ]
+ },
+ "sources": {
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ "maxItems": 101,
+ "minItems": 1,
+ "type": "array"
+ }
+ },
+ "required": [
+ "code",
+ "severity",
+ "message",
+ "sources"
+ ],
+ "type": "object"
+ },
+ "maxItems": 1000,
+ "minItems": 0,
+ "type": "array"
+ },
+ "document_checks": {
+ "additionalProperties": false,
+ "properties": {
+ "currency_matches": {
+ "type": "boolean"
+ },
+ "purchase_order_reference_matches": {
+ "type": "boolean"
+ },
+ "supplier_matches": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "currency_matches",
+ "supplier_matches",
+ "purchase_order_reference_matches"
+ ],
+ "type": "object"
+ },
+ "policy": {
+ "additionalProperties": false,
+ "properties": {
+ "arithmetic_scope": {
+ "maxLength": 300,
+ "minLength": 1,
+ "type": "string"
+ },
+ "decision_scope": {
+ "maxLength": 300,
+ "minLength": 1,
+ "type": "string"
+ },
+ "delivery_verification_supported": {
+ "const": false
+ },
+ "financial_posting_performed": {
+ "const": false
+ },
+ "financial_posting_supported": {
+ "const": false
+ },
+ "human_review_required": {
+ "const": true
+ },
+ "identity_purpose": {
+ "const": "deterministic_result_comparison_only"
+ },
+ "matching_rule": {
+ "const": "explicit_po_line_id_else_unique_case_sensitive_product_code"
+ },
+ "model_calls": {
+ "const": 0
+ },
+ "payment_approval_supported": {
+ "const": false
+ },
+ "quantity_scope": {
+ "maxLength": 300,
+ "minLength": 1,
+ "type": "string"
+ },
+ "raw_documents_retained": {
+ "const": false
+ },
+ "stateless": {
+ "const": true
+ },
+ "supplier_scope": {
+ "maxLength": 300,
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "required": [
+ "human_review_required",
+ "stateless",
+ "raw_documents_retained",
+ "financial_posting_supported",
+ "financial_posting_performed",
+ "payment_approval_supported",
+ "delivery_verification_supported",
+ "model_calls",
+ "identity_purpose",
+ "matching_rule",
+ "quantity_scope",
+ "arithmetic_scope",
+ "supplier_scope",
+ "decision_scope"
+ ],
+ "type": "object"
+ },
+ "purchase_order_line_summary": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "allocated_invoice_sources": {
+ "items": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ "maxItems": 100,
+ "minItems": 0,
+ "type": "array"
+ },
+ "allocated_quantity": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "computed_amount": {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ "line_arithmetic_status": {
+ "enum": [
+ "consistent",
+ "mismatch",
+ "unavailable"
+ ]
+ },
+ "ordered_quantity": {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ "overbilled_quantity": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "purchase_order_line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "purchase_order_source": {
+ "maxLength": 100,
+ "minLength": 1,
+ "pattern": "^/(?:invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ "status": {
+ "enum": [
+ "not_comparable",
+ "not_invoiced",
+ "overbilled",
+ "fully_invoiced",
+ "partially_invoiced"
+ ]
+ },
+ "supplied_amount": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "uninvoiced_quantity": {
+ "anyOf": [
+ {
+ "maxLength": 42,
+ "pattern": "^(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ }
+ },
+ "required": [
+ "purchase_order_line_id",
+ "purchase_order_source",
+ "allocated_invoice_sources",
+ "ordered_quantity",
+ "allocated_quantity",
+ "uninvoiced_quantity",
+ "overbilled_quantity",
+ "unit",
+ "status",
+ "supplied_amount",
+ "computed_amount",
+ "line_arithmetic_status"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "minItems": 1,
+ "type": "array"
+ },
+ "summary": {
+ "additionalProperties": false,
+ "properties": {
+ "delivery_verified": {
+ "const": false
+ },
+ "discrepancy_count": {
+ "maximum": 1000,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "human_review_required": {
+ "const": true
+ },
+ "invoice_line_count": {
+ "maximum": 100,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "matched_invoice_line_count": {
+ "maximum": 100,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "outcome": {
+ "enum": [
+ "no_discrepancies",
+ "review_required"
+ ]
+ },
+ "payment_approved": {
+ "const": false
+ },
+ "purchase_order_line_count": {
+ "maximum": 100,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "unknown_check_count": {
+ "maximum": 1000,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "unmatched_invoice_line_count": {
+ "maximum": 100,
+ "minimum": 0,
+ "type": "integer"
+ }
+ },
+ "required": [
+ "outcome",
+ "invoice_line_count",
+ "purchase_order_line_count",
+ "matched_invoice_line_count",
+ "unmatched_invoice_line_count",
+ "discrepancy_count",
+ "unknown_check_count",
+ "human_review_required",
+ "delivery_verified",
+ "payment_approved"
+ ],
+ "type": "object"
+ }
+ },
+ "required": [
+ "summary",
+ "document_checks",
+ "comparison_rows",
+ "purchase_order_line_summary",
+ "discrepancies",
+ "arithmetic",
+ "policy"
+ ],
+ "type": "object"
+ },
+ "status": {
+ "const": "review_required"
+ }
+ },
+ "required": [
+ "contract_version",
+ "status",
+ "result",
+ "identities"
+ ],
+ "type": "object"
+ },
+ "synthetic_only": {
+ "const": true
+ }
+ },
+ "required": [
+ "example_version",
+ "synthetic_only",
+ "request",
+ "response",
+ "policy"
+ ],
+ "type": "object"
+ },
+ "service": {
+ "const": "invoice"
+ }
+ },
+ "required": [
+ "service",
+ "details"
+ ],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "details": {
+ "properties": {
+ "request": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "additionalProperties": false,
+ "description": "Free comparison of one receipt, invoice and purchase order supplied in this request. Missing documents or fields produce needs_review. Maximum 100 lines per document and 196608 UTF-8 JSON bytes. No images, URLs, credentials, account access, or paid tool calls. Money amounts must use the supported currency's minor-unit precision; runtime also rejects sensitive data, padded strings and control characters.",
+ "properties": {
+ "invoice": {
+ "additionalProperties": false,
+ "description": "Caller-supplied structured data. Use opaque supplier IDs and decimal strings; omit unknown fields. Receipt kind describes the source document, not verified delivery. Field names align with invoice matching; receipt extraction output must be mapped explicitly.",
+ "properties": {
+ "currency": {
+ "pattern": "^[A-Z]{3}$",
+ "type": "string"
+ },
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "description": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "po_line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "product_code": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "quantity": {
+ "allOf": [
+ {
+ "not": {
+ "pattern": "^0(?:\\.0+)?$"
+ }
+ }
+ ],
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "unit_price": {
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "purchase_order_reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "subtotal": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "supplier_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "tax": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "total": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [],
+ "type": "object"
+ },
+ "purchase_order": {
+ "additionalProperties": false,
+ "description": "Caller-supplied structured data. Use opaque supplier IDs and decimal strings; omit unknown fields. Receipt kind describes the source document, not verified delivery. Field names align with invoice matching; receipt extraction output must be mapped explicitly.",
+ "properties": {
+ "currency": {
+ "pattern": "^[A-Z]{3}$",
+ "type": "string"
+ },
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "description": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "product_code": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "quantity": {
+ "allOf": [
+ {
+ "not": {
+ "pattern": "^0(?:\\.0+)?$"
+ }
+ }
+ ],
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "unit_price": {
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "subtotal": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "supplier_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "tax": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "total": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [],
+ "type": "object"
+ },
+ "receipt": {
+ "additionalProperties": false,
+ "description": "Caller-supplied structured data. Use opaque supplier IDs and decimal strings; omit unknown fields. Receipt kind describes the source document, not verified delivery. Field names align with invoice matching; receipt extraction output must be mapped explicitly.",
+ "properties": {
+ "currency": {
+ "pattern": "^[A-Z]{3}$",
+ "type": "string"
+ },
+ "invoice_reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "kind": {
+ "enum": [
+ "expense_receipt",
+ "delivery_receipt"
+ ]
+ },
+ "line_items": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "description": {
+ "maxLength": 240,
+ "minLength": 1,
+ "type": "string"
+ },
+ "invoice_line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "line_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "product_code": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "quantity": {
+ "allOf": [
+ {
+ "not": {
+ "pattern": "^0(?:\\.0+)?$"
+ }
+ }
+ ],
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "unit": {
+ "maxLength": 32,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "unit_price": {
+ "maxLength": 19,
+ "not": {
+ "pattern": "\\n"
+ },
+ "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "purchase_order_reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "reference": {
+ "maxLength": 80,
+ "minLength": 1,
+ "type": "string"
+ },
+ "subtotal": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "supplier_id": {
+ "maxLength": 80,
+ "minLength": 1,
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
+ "type": "string"
+ },
+ "tax": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ },
+ "total": {
+ "maxLength": 33,
+ "pattern": "^(?:0|[1-9][0-9]{0,25})(?:\\.[0-9]{1,6})?$",
+ "type": "string"
+ }
+ },
+ "required": [],
+ "type": "object"
+ }
+ },
+ "required": [],
+ "type": "object"
+ },
+ "response": {
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "oneOf": [
+ {
+ "additionalProperties": false,
+ "properties": {
+ "comparisons": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "document_identity_comparable": {
+ "type": "boolean"
+ },
+ "pair": {
+ "enum": [
+ "receipt_to_invoice",
+ "invoice_to_purchase_order"
+ ]
+ },
+ "rows": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "amount_difference": {
+ "maxLength": 50,
+ "pattern": "^-?(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "candidate_targets": {
+ "items": {
+ "maxLength": 100,
+ "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "comparison_performed": {
+ "type": "boolean"
+ },
+ "match_method": {
+ "enum": [
+ "unmatched",
+ "explicit_line_reference",
+ "exact_product_code",
+ "normalized_description"
+ ]
+ },
+ "quantity_difference": {
+ "maxLength": 50,
+ "pattern": "^-?(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "source": {
+ "maxLength": 100,
+ "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ "status": {
+ "enum": [
+ "no_discrepancies",
+ "needs_review"
+ ]
+ },
+ "target": {
+ "anyOf": [
+ {
+ "maxLength": 100,
+ "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "unit_price_difference": {
+ "maxLength": 50,
+ "pattern": "^-?(?:0|[1-9][0-9]{0,27})(?:\\.[0-9]{1,12})?$",
+ "type": [
+ "string",
+ "null"
+ ]
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "candidate_targets",
+ "match_method",
+ "comparison_performed",
+ "status",
+ "quantity_difference",
+ "unit_price_difference",
+ "amount_difference"
+ ],
+ "type": "object"
+ },
+ "maxItems": 100,
+ "type": "array"
+ },
+ "status": {
+ "enum": [
+ "no_discrepancies",
+ "needs_review"
+ ]
+ }
+ },
+ "required": [
+ "pair",
+ "status",
+ "document_identity_comparable",
+ "rows"
+ ],
+ "type": "object"
+ },
+ "maxItems": 2,
+ "minItems": 2,
+ "type": "array"
+ },
+ "contract_version": {
+ "const": "ardaro.purchase-document-reconciliation.response.v1"
+ },
+ "delivery_verified": {
+ "const": false
+ },
+ "discrepancies": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "code": {
+ "maxLength": 80,
+ "pattern": "^[a-z_]+$",
+ "type": "string"
+ },
+ "scope": {
+ "enum": [
+ "receipt",
+ "invoice",
+ "purchase_order",
+ "receipt_to_invoice",
+ "invoice_to_purchase_order"
+ ]
+ },
+ "severity": {
+ "enum": [
+ "unknown",
+ "discrepancy"
+ ]
+ },
+ "sources": {
+ "items": {
+ "maxLength": 100,
+ "pattern": "^/(?:receipt|invoice|purchase_order)(?:/[A-Za-z0-9_]+)*$",
+ "type": "string"
+ },
+ "maxItems": 101,
+ "type": "array"
+ }
+ },
+ "required": [
+ "code",
+ "scope",
+ "severity",
+ "sources"
+ ],
+ "type": "object"
+ },
+ "maxItems": 6000,
+ "type": "array"
+ },
+ "document_summary": {
+ "items": {
+ "additionalProperties": false,
+ "properties": {
+ "currency_minor_units": {
+ "enum": [
+ 0,
+ 2,
+ null
+ ]
+ },
+ "currency_supported": {
+ "type": "boolean"
+ },
+ "document": {
+ "enum": [
+ "receipt",
+ "invoice",
+ "purchase_order"
+ ]
+ },
+ "line_count": {
+ "maximum": 100,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "present": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "document",
+ "present",
+ "line_count",
+ "currency_supported",
+ "currency_minor_units"
+ ],
+ "type": "object"
+ },
+ "maxItems": 3,
+ "minItems": 3,
+ "type": "array"
+ },
+ "financial_posting_performed": {
+ "const": false
+ },
+ "human_review_required": {
+ "const": true
+ },
+ "payment_approved": {
+ "const": false
+ },
+ "policy": {
+ "const": {
+ "arithmetic_scope": "Exact decimal comparisons with per-line ROUND_HALF_UP at supported currency precision. No tax applicability, discounts, freight or currency conversion is inferred.",
+ "decision_scope": "No discrepancies means the supported checks found none in supplied data. It is not payment authorization, accounting approval or supplier verification.",
+ "document_storage_performed": false,
+ "matching_rule": "explicit line reference, else unique exact case-sensitive product code, else unique NFKC/casefold/whitespace-normalized description when both product codes are absent; never fuzzy or semantic",
+ "model_calls": 0,
+ "paid_tool_calls": 0,
+ "payment_required": false,
+ "quantity_scope": "Differences concern only these three supplied documents. Partial receipts, partial invoicing, prior invoices, returns and delivery events are not inferred.",
+ "receipt_scope": "An expense receipt is not evidence of delivery. A delivery_receipt label is caller-supplied and does not authenticate delivery.",
+ "retention_scope": "This function retains no documents or results; caller and transport retention are outside this function's guarantees."
+ }
+ },
+ "provenance": {
+ "const": {
+ "document_authenticity_verified": false,
+ "external_data_fetched": false,
+ "source": "caller_supplied_documents_only",
+ "source_pointer_root": "original_arguments"
+ }
+ },
+ "result_identity": {
+ "pattern": "^res_[0-9a-f]{64}$",
+ "type": "string"
+ },
+ "status": {
+ "enum": [
+ "no_discrepancies",
+ "needs_review"
+ ]
+ }
+ },
+ "required": [
+ "contract_version",
+ "human_review_required",
+ "payment_approved",
+ "delivery_verified",
+ "financial_posting_performed",
+ "provenance",
+ "policy",
+ "status",
+ "result_identity",
+ "document_summary",
+ "comparisons",
+ "discrepancies"
+ ],
+ "type": "object"
+ },
+ {
+ "additionalProperties": false,
+ "properties": {
+ "contract_version": {
+ "const": "ardaro.purchase-document-reconciliation.response.v1"
+ },
+ "error": {
+ "additionalProperties": false,
+ "properties": {
+ "code": {
+ "maxLength": 80,
+ "type": "string"
+ },
+ "message": {
+ "maxLength": 300,
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "message"
+ ],
+ "type": "object"
+ },
+ "status": {
+ "const": "error"
+ }
+ },
+ "required": [
+ "contract_version",
+ "status",
+ "error"
+ ],
+ "type": "object"
+ }
+ ],
+ "type": "object"
+ }
+ },
+ "required": [
+ "request",
+ "response"
+ ],
+ "type": "object"
+ },
+ "service": {
+ "const": "reconciliation"
+ }
+ },
+ "required": [
+ "service",
+ "details"
+ ],
+ "type": "object"
+ }
+]