Filter entries by reason code
filter_entriesPreview statement entries with a specific return reason code to verify which entries a reversal would affect, before executing the reversal.
Instructions
List only the statement entries carrying a given return reason code.
Use this to preview exactly which entries a reversal would touch before
calling ``generate_reversal`` with the same ``reason_code``. For every entry
regardless of reason code use ``list_entries`` instead.
When ``limit`` is ``None`` (the default) the full list of matching entries
is returned, preserving the behaviour expected by existing callers. When
``limit`` is given, a paginated envelope ``{"total", "offset", "limit",
"entries"}`` is returned instead, exposing the ``offset:offset + limit``
slice. A negative ``offset`` or ``limit`` yields an ``{"error": ...}``
payload.
Args:
xml: The raw statement XML as a string.
reason_code: The ISO external return reason to match (default
``"AC04"`` Closed Account).
offset: The zero-based index of the first entry to return (paginated
mode only; default ``0``).
limit: The maximum number of entries to return, or ``None`` for the
full list (default ``None``).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | Yes | The raw camt.05x statement XML document as a string; only its entries carrying the given return reason code are returned. | |
| limit | No | Maximum number of matching entries to return, starting at offset. None (the default) returns the full unpaginated list; a non-None value returns a {total, offset, limit, entries} envelope. Must be non-negative. | |
| offset | No | Zero-based index of the first matching entry to return. Applies only when limit is given; must be non-negative. Defaults to 0. | |
| reason_code | No | The ISO external return reason code to match, e.g. 'AC04' Closed Account (the default). Call list_return_reasons for the full set of accepted codes. | AC04 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |