Validate records against schema
validate_recordsValidate flat payment records against a message type's JSON Schema to catch structural errors before message generation. Returns a row-by-row error report with valid and total counts.
Instructions
Validate flat payment records against a message type's JSON Schema.
Use this before ``generate_message`` to catch structural/type errors per
record and get a row-by-row error report. This checks JSON-Schema shape
only; to check a batch against a rail's usage guidelines use
``validate_scheme``.
Returns a report ``{"is_valid": bool, "total": int, "valid": int,
"errors": [...]}``.
Args:
message_type: A supported ISO 20022 pacs message type.
records: One or more flat payment records to validate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | One or more flat payment records, each a dict of field name -> value; validated against the message type's input JSON Schema (see get_input_schema / get_required_fields). | |
| message_type | Yes | A supported ISO 20022 pacs message type, e.g. 'pacs.008.001.08' FI-to-FI Customer Credit Transfer. Must be exactly one of: 'pacs.002.001.12', 'pacs.003.001.09', 'pacs.004.001.11', 'pacs.007.001.11', 'pacs.008.001.01', 'pacs.008.001.02', 'pacs.008.001.03', 'pacs.008.001.04', 'pacs.008.001.05', 'pacs.008.001.06', 'pacs.008.001.07', 'pacs.008.001.08', 'pacs.008.001.09', 'pacs.008.001.10', 'pacs.008.001.11', 'pacs.008.001.12', 'pacs.008.001.13', 'pacs.009.001.10', 'pacs.010.001.05', 'pacs.028.001.05' (see list_message_types). |