Generate pain XML from records
generate_messageGenerate validated ISO 20022 pain XML messages from in-memory payment records. Returns XSD-validated XML string or error.
Instructions
Generate a validated ISO 20022 pain XML message from in-memory records.
This is the primary generation tool: pass records you already hold in
memory. Use ``generate_message_from_file`` when the data lives in a CSV
on disk, and ``generate_message_async`` for very large batches you want
to run off the event loop. The result is XSD-validated before return; no
file is written.
Returns the validated XML document as a string, or a JSON-encoded
``{"error": ...}`` payload if generation fails.
Args:
message_type: A supported ISO 20022 pain message type.
records: One or more flat payment records.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | One or more flat payment records (each a dict of field name → value) to render into the XML; validate them first with validate_records. See get_input_schema for the fields. | |
| message_type | Yes | A supported ISO 20022 pain message type. Must be exactly one of: 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05', 'pain.001.001.06', 'pain.001.001.07', 'pain.001.001.08', 'pain.001.001.09', 'pain.001.001.10', 'pain.001.001.11', 'pain.001.001.12', 'pain.008.001.02' (see list_message_types). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |