Filter entries by reason code
filter_entriesFilter entries in a camt.053 statement by return reason code to preview which entries a reversal would affect before executing it.
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 | An ISO external return reason code, e.g. 'AC04' Closed Account. Must be exactly one of: 'AC01', 'AC02', 'AC03', 'AC04', 'AC06', 'AC13', 'AC14', 'AG01', 'AG02', 'AM01', 'AM02', 'AM03', 'AM04', 'AM05', 'AM06', 'AM07', 'AM08', 'AM09', 'BE01', 'BE05', 'CNOR', 'DNOR', 'DT01', 'ED01', 'ED05', 'FF01', 'MD01', 'MD06', 'MD07', 'MS02', 'MS03', 'NARR', 'NOAS', 'NOOR', 'RC01', 'RR01', 'RR02', 'RR03', 'RR04', 'SL01', 'TM01' (see list_return_reasons). | AC04 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |