Check an existing payment file
check_payment_fileValidate existing pain.001 or pain.008 payment XML against XSD, cross-element rules, scheme profiles, and Schematron presets, returning all errors and warnings together.
Instructions
Check an existing pain.001 or pain.008 file, as pain001 check does.
Use this on a payment file that already exists (one a bank returned,
another system wrote, or an earlier run produced) to learn whether it
is valid and why not. ``validate_records`` checks rows before
generation; this checks the XML itself: its message type's XSD, the
cross-element rules of the message definition, and the scheme
profiles and Schematron preset asked for. Every rung runs, so all
problems come back at once.
Delegates to :func:`pain001.check.check_document`.
Args:
xml_content: The document as XML text.
scheme: Scheme profiles, comma-separated, or ``None``.
schematron: A Schematron preset, or ``None``.
Returns:
``{"message_type", "passed", "errors", "warnings", "rungs",
"findings": [{"rung", "rule", "severity", "message",
"location"}, ...]}``, or ``{"error": ...}`` when the document
cannot be checked (not a bundled pain.001 or pain.008, a DTD,
too large, an unknown scheme or preset) or the installed
pain001 has no checker.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"xml_content": "<xml_content>"
},
"name": "check_payment_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scheme | No | Optional payment-scheme rulebook profile to enforce, or several joined by commas. One of 'ae-uaefts', 'anti-duplicate', 'cbpr-cross-border', 'ch-domestic', 'ch-sepa', 'de-axz', 'de-ccu', 'hk-fps', 'my-duitnow', 'purpose-mandate-ae', 'purpose-mandate-gb', 'purpose-mandate-hk', 'purpose-mandate-my', 'purpose-mandate-qa', 'qa-qatch', 'se-bankgiro', 'sepa-b2b', 'sepa-inst', 'sepa-sct', 'sepa-sdd', 'sg-fast', 'uk-bacs', 'uk-bacs-dd', 'uk-chaps', 'uk-fps', 'us-ach', 'us-rtp', 'us-wire', 'xborder-ct'. Omit to skip scheme-specific rulebook validation. | |
| schematron | No | Optional Schematron rulebook preset: one of cbpr, cbpr+, cbpr-plus, epc-sepa, fednow, sepa, sepa-sct, swift. A path is not accepted. | |
| xml_content | Yes | The full pain.001 or pain.008 document as XML text (not a file path), at most 10 MiB. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| rungs | No | ||
| errors | No | ||
| passed | No | ||
| findings | No | ||
| warnings | No | ||
| message_type | No |