generate_message
Generate XSD-validated ISO 20022 E&I XML messages (camt.056/camt.029) from structured records for interbank payment cancellations, recalls, or investigations.
Instructions
Generate a schema-validated ISO 20022 E&I XML message from a record.
Purpose: Renders a complete, XSD-compliant ISO 20022 XML document (e.g. camt.056 payment cancellation or camt.029 investigation resolution) from structured field dictionaries, validating the result against the bundled official schema before returning.
When to use:
When raising payment cancellation, recall, or investigation response messages for interbank transmission.
When requiring guaranteed XSD-valid XML output for downstream payment processing.
When NOT to use:
Do NOT use to validate pre-existing XML files without generating; use validate_xml instead.
Do NOT pass incomplete records; check get_required_fields first.
Behavioral transparency: Pure template rendering and in-memory schema validation; side-effect-free and idempotent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| record | Yes | Message fields; see get_required_fields. | |
| message_type | Yes | An E&I message type, e.g. 'camt.056.001.12' (see list_message_types). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||