# ISO 20022 pain.002 Bank Payment Status & Rejection Decoder (`finops_studio/iso20022-pain002-status-parser`) Actor

Decode cryptic ISO 20022 pain.002 (pain.002.001.03 & pain.002.001.10) bank payment status XML reports and SEPA/SWIFT rejection codes (AC01, AC04, AM04, BE04, MD01, RR04) into plain-English JSON & CSV with actionable fix steps.

- **URL**: https://apify.com/finops_studio/iso20022-pain002-status-parser.md
- **Developed by:** [FinOps Studio](https://apify.com/finops_studio) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 pain.002 status item decodeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## ISO 20022 `pain.002` Bank Payment Status & Rejection Code Decoder (`pain.002.001.03` & `pain.002.001.10`)

Instantly translate cryptic **ISO 20022 `pain.002` (`CstmrPmtStsRpt`) bank payment status XML files** from **Deutsche Bank, BNP Paribas, ING, Commerzbank, HSBCnet, J.P. Morgan, CitiDirect, Revolut, or EBICS/SFTP gateways** into **plain-English JSON & Excel-ready CSV** with exact step-by-step fix instructions.

Try the free browser preview & download ready-made `n8n` workflows at the **[FinOps Studio Web Hub](https://geornaden.github.io/finops-studio/)**.

***

### Why Finance, Payroll & Automation Teams Use This Tool

1. **40+ Built-In ISO 20022 Reason Code Explanations & Fix Playbooks:**
   - Translates codes like `AC04` (*Closed Bank Account — stop automated retries*), `AM04` (*Insufficient Funds*), `BE01` (*Verification of Payee Name Mismatch*), `BE04` (*2026 EPC Missing Structured Postal Address*), `MD01` (*No Valid SEPA Mandate*), `MD06` (*8-Week Customer SEPA Refund*), `AM09` (*Control Sum Mismatch*), and `RR04` (*Regulatory Hold*) into clear business English + exact remediation actions.
2. **Handles Whole-File, Batch-Level & Per-Transaction Rejections:**
   - Supports `pain.002.001.03`, `pain.002.001.10`, namespace-prefixed XML (`ns2:`), SEPA Credit Transfer (`pain.001`), SEPA Direct Debit (`pain.008`), CGI-MP, and SWIFT CBPR+ status reports.
3. **Instant Exception Filtering for `n8n`, `Make.com`, Slack & Jira Alerts:**
   - Set `"onlyRejectedOrExceptions": true` to pipe rejected invoices/payouts straight from bank SFTP/EBICS folders into Slack, Microsoft Teams, HubSpot, Stripe, or NetSuite.

***

### Companion Financial Automation Tools by FinOps Studio

- **[Interactive Web Hub & Free 3-Row Preview](https://geornaden.github.io/finops-studio/)** — Browser-local demo & `n8n` workflow templates
- [SEPA XML Generator (`pain.001` & `pain.008`)](https://apify.com/finops_studio/sepa-xml-generator) — Generate 2026-Compliant European Bulk Payments & Direct Debits
- [EU E-Invoice XML Generator (`Peppol`, `XRechnung` & `Factur-X`)](https://apify.com/finops_studio/eu-einvoice-xml-generator) — Mandatory 2026 EN 16931 E-Invoices
- [US NACHA ACH File Generator & Parser](https://apify.com/finops_studio/nacha-ach-file-generator) — 94-Char US Direct Deposit & Vendor ACH Files
- [Corporate `BAI2` Bank Statement Parser](https://apify.com/finops_studio/bai2-bank-statement-parser) — US Treasury Cash-Management Statements to JSON/CSV
- [German `DATEV Buchungsstapel` CSV Generator](https://apify.com/finops_studio/datev-buchungsstapel-generator) — DATEV EXTF v700 Export for *Steuerberater*
- [Australian `ABA` Direct Entry File Generator](https://apify.com/finops_studio/aba-cemtex-file-generator) — 120-Char Australian BECS `.aba` Bank Files

> **Disclaimer:** Technical ISO 20022 `pain.002` XML decoder provided "as-is", without financial or legal advice. Always confirm final cash settlement against official `camt.053` bank statements.

# Actor input Schema

## `xmlContent` (type: `string`):

Paste a single ISO 20022 CstmrPmtStsRpt XML document (pain.002.001.03, pain.002.001.10, SEPA, CGI-MP, or SWIFT CBPR+). Leave blank to run a realistic multi-status demo batch.

## `xmlDocuments` (type: `array`):

Optional array of pain.002 XML strings when decoding multiple bank status files in one API or n8n call.

## `onlyRejectedOrExceptions` (type: `boolean`):

When enabled, filters the decoded transaction list to only RJCT (Rejected), PART (Partially Accepted), ACWC (Accepted With Change), or CANC items.

## `includeInlineCsv` (type: `boolean`):

Include the generated Excel-ready CSV string directly inside the JSON dataset record in addition to the downloadable PAIN002_STATUS_REPORT.csv file URL.

## Actor input object example

```json
{
  "onlyRejectedOrExceptions": false,
  "includeInlineCsv": true
}
```

# Actor output Schema

## `csvReport` (type: `string`):

Excel-ready CSV report listing every payment status, ISO reason code, plain-English explanation, and recommended fix.

## `decodedDataset` (type: `string`):

Structured JSON summary of group status, batch counts, and per-transaction plain-English rejection diagnostics.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("finops_studio/iso20022-pain002-status-parser").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("finops_studio/iso20022-pain002-status-parser").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call finops_studio/iso20022-pain002-status-parser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,finops_studio/iso20022-pain002-status-parser"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/IiKShTaPOgmJh9qeV/builds/uCgMP3Cz5hExOTstf/openapi.json
