# SEPA Rejects & Returns to Excel: pain.002 Status Reports (`hardreset83/sepa-rejects-returns-to-excel`) Actor

Turn your bank's answers to SEPA payment files into Excel: pain.002 status reports and camt.054 returns. Every rejected or returned payment with name, IBAN, amount and the reason code explained in plain words, with what to do next, in 5 languages. Accepted payments are free.

- **URL**: https://apify.com/hardreset83/sepa-rejects-returns-to-excel.md
- **Developed by:** [Flavio D'Orio](https://apify.com/hardreset83) (community)
- **Categories:** Business, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 rejected or returned payments

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

## SEPA Rejects & Returns to Excel: pain.002 Status Reports

Your bank answers every SEPA payment file you upload with a **payment status report** (ISO 20022 **pain.002**), and
the payments that come back later (returned direct debits, refunds, returned credit transfers) arrive in your
**camt.054** notifications or **camt.053** statements. Both are XML files that nobody can read. This Actor turns them
into **Excel**: every rejected or returned payment with **name, IBAN, amount, date**, the **reason code** (AC04, AM04,
MD01, MS02...) **explained in plain words** and **what to do next**, in English, Italian, German, Spanish or French.

Upload one report, a ZIP with many, or the link from your automation. Put the original pain.001 or pain.008 file next
to them and the rows that the bank sends with only a reference are completed with name, IBAN and amount.

### What it does

- **Reads payment status reports** pain.002 in every version (pain.002.001.03 up to the latest) and pacs.002, as banks
  send them after a credit transfer file (pain.001) or a direct debit file (pain.008), SEPA Instant included.
- **Reads returned payments** in bank statements and notifications: **camt.054**, **camt.053** and **camt.052**, with
  the return reason, the original end-to-end ID and mandate, and the fees the bank charged. Normal bookings are
  skipped: only the payments that came back are listed.
- **Every level of an answer**: a whole file rejected (for example FF01, with the number of payments and the total it
  contained), a batch rejected, single payments rejected, a file accepted only in part (only the rejected payments are
  problems, the others are accepted). Payments without their own status take the status of their batch.
- **Explains 79 ISO reason codes** with what to do next, for example AC04 (account closed: ask for the new account),
  AM04 (not enough money: try again later), MD01 (no valid mandate: get a new signed mandate first), MD06 (refund asked
  by the payer), MS02 (refused by the customer), AC01 (wrong IBAN), RR04 (regulatory reason), AM23 (above the instant
  payment limit). Codes of your own bank are kept with the bank's text, so nothing is lost.
- **Completes the rows from your original files**: a pain.002 often contains only the end-to-end ID. If the original
  pain.001 or pain.008 is in the same upload (in a ZIP or as a link), name, IBAN, amount, date, mandate and remittance
  information are filled in from it.
- **Many files at once**: ZIP archives (also a ZIP inside a ZIP), several links, the same report uploaded twice
  (duplicates are left out). Files that are not bank reports (PDF, images, invoices) are skipped and cost nothing.
- **Any encoding and namespace**: UTF-8, Windows-1252 and UTF-16 files, with or without namespace prefixes.

### What you get

- **REPORT.xlsx** in the key-value store (Storage tab), with three sheets:
  - **Payments**: one row per payment with result (rejected, returned, cancelled, blocked, pending, accepted), name,
    IBAN, amount, currency, date, reason code, reason, what to do, the bank's own text, status, payment type
    (credit transfer or direct debit), end-to-end ID, mandate, remittance information, fees, batch and original file.
  - **Reasons**: how many payments and how much money for each reason code, most frequent first.
  - **Reports**: one row per file read, with its type, date, original message ID, status of the whole file, rows and
    problems found, or why it was skipped.
- **SUMMARY**: the numbers for automations (problems, rejected, returned, accepted, amount with problems per currency,
  reasons, files skipped, errors, the link to REPORT.xlsx and a one-line message).
- **Dataset**: one item per payment, to export as JSON, CSV or Excel or to send to your accounting.
- Results, reasons, what to do, column titles and sheet names in **English, Italian, German, Spanish or French**.

The Actor only reads the files you give it. It does not contact your bank and changes nothing there.

### How to use it

1. Download the status report or the camt.054 notification from your online banking or banking software ("status
   report", "Statusbericht", "esito", "informe de estado", "compte rendu"), or take the link from your automation.
2. Upload it (or a ZIP with many reports and the original payment files), add links, or paste the XML. The input form
   is prefilled with an example report with three rejected direct debits: press **Start** to see the result (the
   example is free).
3. Choose the language of the report.
4. Open the **Storage** tab and download **REPORT.xlsx**.

**Automation**: call the Actor from Make, Zapier, n8n or the Apify API with the links to the new reports, then read
`problems` and `reportUrl` from SUMMARY: for example, send REPORT.xlsx to your accounting team, or a reminder to each
customer whose direct debit came back. Switch on "Only payments with a problem" to get only the rows that need work.
Save the input as a **task** and schedule it if your reports are always at the same address.

### Example output

One item of the dataset (shortened):

```json
{
  "result": "rejected",
  "resultText": "Rejected",
  "level": "payment",
  "name": "Example Customer GmbH",
  "iban": "DE02120300000000202051",
  "amount": 450.0,
  "currency": "EUR",
  "date": "2026-11-20",
  "reasonCode": "AC04",
  "reason": "The account is closed.",
  "advice": "Ask the customer or supplier for their new account, then send the payment again.",
  "bankText": "Account closed",
  "status": "RJCT",
  "paymentType": "direct-debit",
  "endToEndId": "INV-2026-0457",
  "mandateId": "MANDATE-0001",
  "remittance": "Invoice 2026-0457",
  "batchId": "SEPA20261113093000-4F2A1C-1",
  "originalMessageId": "SEPA20261113093000-4F2A1C",
  "reportType": "pain.002.001.03",
  "source": "example-report.xml"
}
```

And the message of the run: "3 payments with a problem (3 rejected) for 1,740.40 EUR, from 1 report. Open REPORT.xlsx
in the Storage tab: every payment with the reason and what to do."

### Who is it for

- **Associations, clubs, gyms, schools, landlords and subscription businesses** that collect by SEPA direct debit:
  see at once whose payment came back and why (not enough money, account closed, refund asked, no mandate), with the
  name and the amount, to write the reminder or collect again.
- **Accountants, bookkeepers and payroll offices**: check that every supplier payment and every salary of a payment
  run went through, for every client and every bank.
- **Businesses with many payments**: the status reports of your banking software in a readable list, for the whole
  team.
- **Developers, automations and AI agents**: JSON with every ISO 20022 status and reason code already explained,
  without writing an XML reader for every version.

### Pricing

**Pay per event: $10 per 1,000 rejected or returned payments** ($0.01 for each payment with a problem explained).
Free: accepted, pending and received payments, the original payment files, files that are not reports, duplicates and
the example report. A whole file or batch rejected without a list of its payments counts as one. Set a maximum cost
per run in the run options if you like: when it does not pay for every payment with a problem, the first ones are
listed and charged, the others are left out and the message tells you how many.

### Privacy and security

The Actor runs in your own Apify account: the reports and REPORT.xlsx stay in the storage of your run, and it sends
nothing anywhere else (it only downloads the links you give it). It never contacts your bank. XML files with a DOCTYPE
or entities are refused, and files larger than 50 MB are not read. Delete the run, or set a short data retention, when
you no longer need the files.

### FAQ

**What is a pain.002?** The answer of the bank to a payment file: for the whole file, for each batch and for each
payment, it says accepted, pending or rejected, with an ISO reason code.

**Which banks?** Banks that send ISO 20022 status reports and camt files, as banks in the SEPA area do through online
banking, EBICS or banking software. Some banks use national variants of these files: most keep the same structure and
are read too. A file that cannot be read is listed as skipped and costs nothing.

**A reason code is not in the list.** The row keeps the code and the bank's own text, with the advice to ask your bank.

**What does "partly accepted" mean?** The bank accepted some payments of the file or batch and rejected others. The
rejected ones are listed one by one when the report contains them.

**Does it change anything at my bank?** No. It only reads the files.

**Is a feature missing?** Ask in the Issues tab.

### Auf Deutsch

Macht aus den Antworten der Bank auf SEPA-Dateien eine Excel-Liste: **Statusberichte pain.002** (zum Beispiel per EBICS
abgeholt) und **Rücklastschriften und Rückläufer** aus camt.054, camt.053 und camt.052. Jede abgelehnte oder
zurückgegebene Zahlung mit Name, IBAN, Betrag, Datum, Rückgabegrund (AC04, AM04, MD06, MS02...) in einfachen Worten und
was zu tun ist. Die Original-Datei (pain.001 oder pain.008) im selben ZIP ergänzt fehlende Namen und Beträge. Ganze
abgelehnte Dateien (zum Beispiel FF01) werden mit Anzahl und Summe gezeigt. Texte und Spalten auf Deutsch. Preis: 10 $
pro 1.000 abgelehnte oder zurückgegebene Zahlungen, angenommene Zahlungen sind kostenlos.

### In italiano

Trasforma in Excel gli **esiti** dei file SEPA: i **pain.002** che la banca manda dopo una distinta di bonifici
(pain.001) o di addebiti diretti SDD (pain.008), e gli **insoluti e storni** che arrivano nei camt.054, camt.053 e
camt.052. Per ogni pagamento rifiutato o tornato indietro: nome, IBAN, importo, data, codice del motivo (AC04, AM04,
MD01, MS02...) spiegato in parole semplici e cosa fare. Il file originale messo nello stesso ZIP completa nomi e importi
mancanti. Testi e colonne in italiano. Alcune banche usano varianti nazionali di questi file: quasi sempre hanno la
stessa struttura e vengono lette; un file che non si legge viene saltato e non si paga. Prezzo: 10 $ ogni 1.000
pagamenti rifiutati o restituiti, quelli accettati sono gratis.

### En español

Convierte en Excel las respuestas del banco a los ficheros SEPA: **informes de estado pain.002** y **devoluciones de
recibos** y transferencias en camt.054, camt.053 y camt.052. Cada pago rechazado o devuelto con nombre, IBAN, importe,
fecha, código del motivo de devolución (AC04, AM04, MD06, MS02...) explicado con palabras sencillas y qué hacer. El
fichero original (pain.001 o pain.008) en el mismo ZIP completa nombres e importes. Textos y columnas en español.
Precio: 10 $ por cada 1.000 pagos rechazados o devueltos, los pagos aceptados son gratis.

### En français

Transforme en Excel les réponses de la banque aux fichiers SEPA : **comptes rendus de statut pain.002** et **rejets et
retours de prélèvements** (impayés) et de virements dans les camt.054, camt.053 et camt.052. Chaque paiement rejeté ou
retourné avec nom, IBAN, montant, date, code motif (AC04, AM04, MD06, MS02...) expliqué simplement et ce qu'il faut
faire. Le fichier d'origine (pain.001 ou pain.008) dans le même ZIP complète les noms et montants. Textes et colonnes
en français. Prix : 10 $ pour 1 000 paiements rejetés ou retournés, les paiements acceptés sont gratuits.

# Actor input Schema

## `reportFile` (type: `string`):

The answer of your bank to a SEPA file: a payment status report pain.002 (XML, any version), a statement or notification with returned payments (camt.053, camt.052 or camt.054), or a ZIP archive with many of them. Put the original pain.001 or pain.008 file in the ZIP too: names, IBANs and amounts that the report leaves out are filled in from it. Other files are skipped for free.

## `reportUrls` (type: `array`):

Direct links (https) to report files or ZIP archives, for example from Make, Zapier, n8n or a cloud folder. Links to the original pain.001 or pain.008 files work too.

## `reportContent` (type: `string`):

Paste the content of one XML file. Prefilled with an example status report (three rejected direct debits) so you can try the Actor in one click: the example is free, and it is left out when you upload files or add links.

## `language` (type: `string`):

Reasons, what to do, column titles and sheet names in the dataset and in REPORT.xlsx.

## `onlyProblems` (type: `boolean`):

On: the dataset and REPORT.xlsx list only the rejected, returned, cancelled and blocked payments, and the accepted ones are only counted in SUMMARY. Off: every status of the report is listed (accepted payments are free either way).

## Actor input object example

```json
{
  "reportUrls": [],
  "reportContent": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Document xmlns=\"urn:iso:std:iso:20022:tech:xsd:pain.002.001.03\">\n  <CstmrPmtStsRpt>\n    <GrpHdr>\n      <MsgId>DEMO-STATUS-2026-0001</MsgId>\n      <CreDtTm>2026-11-19T07:45:12</CreDtTm>\n      <InitgPty><Nm>Example Bank</Nm></InitgPty>\n    </GrpHdr>\n    <OrgnlGrpInfAndSts>\n      <OrgnlMsgId>SEPA20261113093000-4F2A1C</OrgnlMsgId>\n      <OrgnlMsgNmId>pain.008.001.02</OrgnlMsgNmId>\n      <OrgnlNbOfTxs>25</OrgnlNbOfTxs>\n      <OrgnlCtrlSum>4870.40</OrgnlCtrlSum>\n      <GrpSts>PART</GrpSts>\n      <NbOfTxsPerSts><DtldNbOfTxs>22</DtldNbOfTxs><DtldSts>ACCP</DtldSts></NbOfTxsPerSts>\n      <NbOfTxsPerSts><DtldNbOfTxs>3</DtldNbOfTxs><DtldSts>RJCT</DtldSts></NbOfTxsPerSts>\n    </OrgnlGrpInfAndSts>\n    <OrgnlPmtInfAndSts>\n      <OrgnlPmtInfId>SEPA20261113093000-4F2A1C-1</OrgnlPmtInfId>\n      <PmtInfSts>PART</PmtInfSts>\n      <TxInfAndSts>\n        <StsId>STS-0001</StsId>\n        <OrgnlEndToEndId>INV-2026-0457</OrgnlEndToEndId>\n        <TxSts>RJCT</TxSts>\n        <StsRsnInf><Orgtr><Id><OrgId><BICOrBEI>EXAMDEFFXXX</BICOrBEI></OrgId></Id></Orgtr>\n          <Rsn><Cd>AC04</Cd></Rsn><AddtlInf>Account closed</AddtlInf></StsRsnInf>\n        <OrgnlTxRef>\n          <Amt><InstdAmt Ccy=\"EUR\">450.00</InstdAmt></Amt>\n          <ReqdColltnDt>2026-11-20</ReqdColltnDt>\n          <PmtTpInf><SvcLvl><Cd>SEPA</Cd></SvcLvl><LclInstrm><Cd>CORE</Cd></LclInstrm><SeqTp>RCUR</SeqTp></PmtTpInf>\n          <MndtRltdInf><MndtId>MANDATE-0001</MndtId><DtOfSgntr>2025-03-01</DtOfSgntr></MndtRltdInf>\n          <RmtInf><Ustrd>Invoice 2026-0457</Ustrd></RmtInf>\n          <Dbtr><Nm>Example Customer GmbH</Nm></Dbtr>\n          <DbtrAcct><Id><IBAN>DE02120300000000202051</IBAN></Id></DbtrAcct>\n        </OrgnlTxRef>\n      </TxInfAndSts>\n      <TxInfAndSts>\n        <StsId>STS-0002</StsId>\n        <OrgnlEndToEndId>INV-2026-0458</OrgnlEndToEndId>\n        <TxSts>RJCT</TxSts>\n        <StsRsnInf><Rsn><Cd>AM04</Cd></Rsn><AddtlInf>Insufficient funds</AddtlInf></StsRsnInf>\n        <OrgnlTxRef>\n          <Amt><InstdAmt Ccy=\"EUR\">1200.50</InstdAmt></Amt>\n          <ReqdColltnDt>2026-11-20</ReqdColltnDt>\n          <MndtRltdInf><MndtId>MANDATE-0002</MndtId><DtOfSgntr>2025-06-15</DtOfSgntr></MndtRltdInf>\n          <RmtInf><Ustrd>Invoice 2026-0458 transport October</Ustrd></RmtInf>\n          <Dbtr><Nm>Example Logistics B.V.</Nm></Dbtr>\n          <DbtrAcct><Id><IBAN>NL91ABNA0417164300</IBAN></Id></DbtrAcct>\n        </OrgnlTxRef>\n      </TxInfAndSts>\n      <TxInfAndSts>\n        <StsId>STS-0003</StsId>\n        <OrgnlEndToEndId>INV-2026-0459</OrgnlEndToEndId>\n        <TxSts>RJCT</TxSts>\n        <StsRsnInf><Rsn><Cd>MD01</Cd></Rsn></StsRsnInf>\n        <OrgnlTxRef>\n          <Amt><InstdAmt Ccy=\"EUR\">89.90</InstdAmt></Amt>\n          <ReqdColltnDt>2026-11-20</ReqdColltnDt>\n          <MndtRltdInf><MndtId>MANDATE-0003</MndtId><DtOfSgntr>2026-01-10</DtOfSgntr></MndtRltdInf>\n          <RmtInf><Strd><CdtrRefInf><Ref>RF18539007547034</Ref></CdtrRefInf></Strd></RmtInf>\n          <Dbtr><Nm>Example Bakery GmbH</Nm></Dbtr>\n          <DbtrAcct><Id><IBAN>AT611904300234573201</IBAN></Id></DbtrAcct>\n        </OrgnlTxRef>\n      </TxInfAndSts>\n    </OrgnlPmtInfAndSts>\n  </CstmrPmtStsRpt>\n</Document>\n",
  "language": "en",
  "onlyProblems": false
}
```

# Actor output Schema

## `payments` (type: `string`):

Every payment of the status reports with its status and reason.

## `report` (type: `string`):

REPORT.xlsx: payments, reasons and reports.

## `summary` (type: `string`):

The result of the run in short: counts, totals, problems and the links to the files.

# 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 = {
    "reportUrls": [],
    "reportContent": `<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.002.001.03">
  <CstmrPmtStsRpt>
    <GrpHdr>
      <MsgId>DEMO-STATUS-2026-0001</MsgId>
      <CreDtTm>2026-11-19T07:45:12</CreDtTm>
      <InitgPty><Nm>Example Bank</Nm></InitgPty>
    </GrpHdr>
    <OrgnlGrpInfAndSts>
      <OrgnlMsgId>SEPA20261113093000-4F2A1C</OrgnlMsgId>
      <OrgnlMsgNmId>pain.008.001.02</OrgnlMsgNmId>
      <OrgnlNbOfTxs>25</OrgnlNbOfTxs>
      <OrgnlCtrlSum>4870.40</OrgnlCtrlSum>
      <GrpSts>PART</GrpSts>
      <NbOfTxsPerSts><DtldNbOfTxs>22</DtldNbOfTxs><DtldSts>ACCP</DtldSts></NbOfTxsPerSts>
      <NbOfTxsPerSts><DtldNbOfTxs>3</DtldNbOfTxs><DtldSts>RJCT</DtldSts></NbOfTxsPerSts>
    </OrgnlGrpInfAndSts>
    <OrgnlPmtInfAndSts>
      <OrgnlPmtInfId>SEPA20261113093000-4F2A1C-1</OrgnlPmtInfId>
      <PmtInfSts>PART</PmtInfSts>
      <TxInfAndSts>
        <StsId>STS-0001</StsId>
        <OrgnlEndToEndId>INV-2026-0457</OrgnlEndToEndId>
        <TxSts>RJCT</TxSts>
        <StsRsnInf><Orgtr><Id><OrgId><BICOrBEI>EXAMDEFFXXX</BICOrBEI></OrgId></Id></Orgtr>
          <Rsn><Cd>AC04</Cd></Rsn><AddtlInf>Account closed</AddtlInf></StsRsnInf>
        <OrgnlTxRef>
          <Amt><InstdAmt Ccy="EUR">450.00</InstdAmt></Amt>
          <ReqdColltnDt>2026-11-20</ReqdColltnDt>
          <PmtTpInf><SvcLvl><Cd>SEPA</Cd></SvcLvl><LclInstrm><Cd>CORE</Cd></LclInstrm><SeqTp>RCUR</SeqTp></PmtTpInf>
          <MndtRltdInf><MndtId>MANDATE-0001</MndtId><DtOfSgntr>2025-03-01</DtOfSgntr></MndtRltdInf>
          <RmtInf><Ustrd>Invoice 2026-0457</Ustrd></RmtInf>
          <Dbtr><Nm>Example Customer GmbH</Nm></Dbtr>
          <DbtrAcct><Id><IBAN>DE02120300000000202051</IBAN></Id></DbtrAcct>
        </OrgnlTxRef>
      </TxInfAndSts>
      <TxInfAndSts>
        <StsId>STS-0002</StsId>
        <OrgnlEndToEndId>INV-2026-0458</OrgnlEndToEndId>
        <TxSts>RJCT</TxSts>
        <StsRsnInf><Rsn><Cd>AM04</Cd></Rsn><AddtlInf>Insufficient funds</AddtlInf></StsRsnInf>
        <OrgnlTxRef>
          <Amt><InstdAmt Ccy="EUR">1200.50</InstdAmt></Amt>
          <ReqdColltnDt>2026-11-20</ReqdColltnDt>
          <MndtRltdInf><MndtId>MANDATE-0002</MndtId><DtOfSgntr>2025-06-15</DtOfSgntr></MndtRltdInf>
          <RmtInf><Ustrd>Invoice 2026-0458 transport October</Ustrd></RmtInf>
          <Dbtr><Nm>Example Logistics B.V.</Nm></Dbtr>
          <DbtrAcct><Id><IBAN>NL91ABNA0417164300</IBAN></Id></DbtrAcct>
        </OrgnlTxRef>
      </TxInfAndSts>
      <TxInfAndSts>
        <StsId>STS-0003</StsId>
        <OrgnlEndToEndId>INV-2026-0459</OrgnlEndToEndId>
        <TxSts>RJCT</TxSts>
        <StsRsnInf><Rsn><Cd>MD01</Cd></Rsn></StsRsnInf>
        <OrgnlTxRef>
          <Amt><InstdAmt Ccy="EUR">89.90</InstdAmt></Amt>
          <ReqdColltnDt>2026-11-20</ReqdColltnDt>
          <MndtRltdInf><MndtId>MANDATE-0003</MndtId><DtOfSgntr>2026-01-10</DtOfSgntr></MndtRltdInf>
          <RmtInf><Strd><CdtrRefInf><Ref>RF18539007547034</Ref></CdtrRefInf></Strd></RmtInf>
          <Dbtr><Nm>Example Bakery GmbH</Nm></Dbtr>
          <DbtrAcct><Id><IBAN>AT611904300234573201</IBAN></Id></DbtrAcct>
        </OrgnlTxRef>
      </TxInfAndSts>
    </OrgnlPmtInfAndSts>
  </CstmrPmtStsRpt>
</Document>`
};

// Run the Actor and wait for it to finish
const run = await client.actor("hardreset83/sepa-rejects-returns-to-excel").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 = {
    "reportUrls": [],
    "reportContent": """<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Document xmlns=\"urn:iso:std:iso:20022:tech:xsd:pain.002.001.03\">
  <CstmrPmtStsRpt>
    <GrpHdr>
      <MsgId>DEMO-STATUS-2026-0001</MsgId>
      <CreDtTm>2026-11-19T07:45:12</CreDtTm>
      <InitgPty><Nm>Example Bank</Nm></InitgPty>
    </GrpHdr>
    <OrgnlGrpInfAndSts>
      <OrgnlMsgId>SEPA20261113093000-4F2A1C</OrgnlMsgId>
      <OrgnlMsgNmId>pain.008.001.02</OrgnlMsgNmId>
      <OrgnlNbOfTxs>25</OrgnlNbOfTxs>
      <OrgnlCtrlSum>4870.40</OrgnlCtrlSum>
      <GrpSts>PART</GrpSts>
      <NbOfTxsPerSts><DtldNbOfTxs>22</DtldNbOfTxs><DtldSts>ACCP</DtldSts></NbOfTxsPerSts>
      <NbOfTxsPerSts><DtldNbOfTxs>3</DtldNbOfTxs><DtldSts>RJCT</DtldSts></NbOfTxsPerSts>
    </OrgnlGrpInfAndSts>
    <OrgnlPmtInfAndSts>
      <OrgnlPmtInfId>SEPA20261113093000-4F2A1C-1</OrgnlPmtInfId>
      <PmtInfSts>PART</PmtInfSts>
      <TxInfAndSts>
        <StsId>STS-0001</StsId>
        <OrgnlEndToEndId>INV-2026-0457</OrgnlEndToEndId>
        <TxSts>RJCT</TxSts>
        <StsRsnInf><Orgtr><Id><OrgId><BICOrBEI>EXAMDEFFXXX</BICOrBEI></OrgId></Id></Orgtr>
          <Rsn><Cd>AC04</Cd></Rsn><AddtlInf>Account closed</AddtlInf></StsRsnInf>
        <OrgnlTxRef>
          <Amt><InstdAmt Ccy=\"EUR\">450.00</InstdAmt></Amt>
          <ReqdColltnDt>2026-11-20</ReqdColltnDt>
          <PmtTpInf><SvcLvl><Cd>SEPA</Cd></SvcLvl><LclInstrm><Cd>CORE</Cd></LclInstrm><SeqTp>RCUR</SeqTp></PmtTpInf>
          <MndtRltdInf><MndtId>MANDATE-0001</MndtId><DtOfSgntr>2025-03-01</DtOfSgntr></MndtRltdInf>
          <RmtInf><Ustrd>Invoice 2026-0457</Ustrd></RmtInf>
          <Dbtr><Nm>Example Customer GmbH</Nm></Dbtr>
          <DbtrAcct><Id><IBAN>DE02120300000000202051</IBAN></Id></DbtrAcct>
        </OrgnlTxRef>
      </TxInfAndSts>
      <TxInfAndSts>
        <StsId>STS-0002</StsId>
        <OrgnlEndToEndId>INV-2026-0458</OrgnlEndToEndId>
        <TxSts>RJCT</TxSts>
        <StsRsnInf><Rsn><Cd>AM04</Cd></Rsn><AddtlInf>Insufficient funds</AddtlInf></StsRsnInf>
        <OrgnlTxRef>
          <Amt><InstdAmt Ccy=\"EUR\">1200.50</InstdAmt></Amt>
          <ReqdColltnDt>2026-11-20</ReqdColltnDt>
          <MndtRltdInf><MndtId>MANDATE-0002</MndtId><DtOfSgntr>2025-06-15</DtOfSgntr></MndtRltdInf>
          <RmtInf><Ustrd>Invoice 2026-0458 transport October</Ustrd></RmtInf>
          <Dbtr><Nm>Example Logistics B.V.</Nm></Dbtr>
          <DbtrAcct><Id><IBAN>NL91ABNA0417164300</IBAN></Id></DbtrAcct>
        </OrgnlTxRef>
      </TxInfAndSts>
      <TxInfAndSts>
        <StsId>STS-0003</StsId>
        <OrgnlEndToEndId>INV-2026-0459</OrgnlEndToEndId>
        <TxSts>RJCT</TxSts>
        <StsRsnInf><Rsn><Cd>MD01</Cd></Rsn></StsRsnInf>
        <OrgnlTxRef>
          <Amt><InstdAmt Ccy=\"EUR\">89.90</InstdAmt></Amt>
          <ReqdColltnDt>2026-11-20</ReqdColltnDt>
          <MndtRltdInf><MndtId>MANDATE-0003</MndtId><DtOfSgntr>2026-01-10</DtOfSgntr></MndtRltdInf>
          <RmtInf><Strd><CdtrRefInf><Ref>RF18539007547034</Ref></CdtrRefInf></Strd></RmtInf>
          <Dbtr><Nm>Example Bakery GmbH</Nm></Dbtr>
          <DbtrAcct><Id><IBAN>AT611904300234573201</IBAN></Id></DbtrAcct>
        </OrgnlTxRef>
      </TxInfAndSts>
    </OrgnlPmtInfAndSts>
  </CstmrPmtStsRpt>
</Document>
""",
}

# Run the Actor and wait for it to finish
run = client.actor("hardreset83/sepa-rejects-returns-to-excel").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 '{
  "reportUrls": [],
  "reportContent": "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>\\n<Document xmlns=\\"urn:iso:std:iso:20022:tech:xsd:pain.002.001.03\\">\\n  <CstmrPmtStsRpt>\\n    <GrpHdr>\\n      <MsgId>DEMO-STATUS-2026-0001</MsgId>\\n      <CreDtTm>2026-11-19T07:45:12</CreDtTm>\\n      <InitgPty><Nm>Example Bank</Nm></InitgPty>\\n    </GrpHdr>\\n    <OrgnlGrpInfAndSts>\\n      <OrgnlMsgId>SEPA20261113093000-4F2A1C</OrgnlMsgId>\\n      <OrgnlMsgNmId>pain.008.001.02</OrgnlMsgNmId>\\n      <OrgnlNbOfTxs>25</OrgnlNbOfTxs>\\n      <OrgnlCtrlSum>4870.40</OrgnlCtrlSum>\\n      <GrpSts>PART</GrpSts>\\n      <NbOfTxsPerSts><DtldNbOfTxs>22</DtldNbOfTxs><DtldSts>ACCP</DtldSts></NbOfTxsPerSts>\\n      <NbOfTxsPerSts><DtldNbOfTxs>3</DtldNbOfTxs><DtldSts>RJCT</DtldSts></NbOfTxsPerSts>\\n    </OrgnlGrpInfAndSts>\\n    <OrgnlPmtInfAndSts>\\n      <OrgnlPmtInfId>SEPA20261113093000-4F2A1C-1</OrgnlPmtInfId>\\n      <PmtInfSts>PART</PmtInfSts>\\n      <TxInfAndSts>\\n        <StsId>STS-0001</StsId>\\n        <OrgnlEndToEndId>INV-2026-0457</OrgnlEndToEndId>\\n        <TxSts>RJCT</TxSts>\\n        <StsRsnInf><Orgtr><Id><OrgId><BICOrBEI>EXAMDEFFXXX</BICOrBEI></OrgId></Id></Orgtr>\\n          <Rsn><Cd>AC04</Cd></Rsn><AddtlInf>Account closed</AddtlInf></StsRsnInf>\\n        <OrgnlTxRef>\\n          <Amt><InstdAmt Ccy=\\"EUR\\">450.00</InstdAmt></Amt>\\n          <ReqdColltnDt>2026-11-20</ReqdColltnDt>\\n          <PmtTpInf><SvcLvl><Cd>SEPA</Cd></SvcLvl><LclInstrm><Cd>CORE</Cd></LclInstrm><SeqTp>RCUR</SeqTp></PmtTpInf>\\n          <MndtRltdInf><MndtId>MANDATE-0001</MndtId><DtOfSgntr>2025-03-01</DtOfSgntr></MndtRltdInf>\\n          <RmtInf><Ustrd>Invoice 2026-0457</Ustrd></RmtInf>\\n          <Dbtr><Nm>Example Customer GmbH</Nm></Dbtr>\\n          <DbtrAcct><Id><IBAN>DE02120300000000202051</IBAN></Id></DbtrAcct>\\n        </OrgnlTxRef>\\n      </TxInfAndSts>\\n      <TxInfAndSts>\\n        <StsId>STS-0002</StsId>\\n        <OrgnlEndToEndId>INV-2026-0458</OrgnlEndToEndId>\\n        <TxSts>RJCT</TxSts>\\n        <StsRsnInf><Rsn><Cd>AM04</Cd></Rsn><AddtlInf>Insufficient funds</AddtlInf></StsRsnInf>\\n        <OrgnlTxRef>\\n          <Amt><InstdAmt Ccy=\\"EUR\\">1200.50</InstdAmt></Amt>\\n          <ReqdColltnDt>2026-11-20</ReqdColltnDt>\\n          <MndtRltdInf><MndtId>MANDATE-0002</MndtId><DtOfSgntr>2025-06-15</DtOfSgntr></MndtRltdInf>\\n          <RmtInf><Ustrd>Invoice 2026-0458 transport October</Ustrd></RmtInf>\\n          <Dbtr><Nm>Example Logistics B.V.</Nm></Dbtr>\\n          <DbtrAcct><Id><IBAN>NL91ABNA0417164300</IBAN></Id></DbtrAcct>\\n        </OrgnlTxRef>\\n      </TxInfAndSts>\\n      <TxInfAndSts>\\n        <StsId>STS-0003</StsId>\\n        <OrgnlEndToEndId>INV-2026-0459</OrgnlEndToEndId>\\n        <TxSts>RJCT</TxSts>\\n        <StsRsnInf><Rsn><Cd>MD01</Cd></Rsn></StsRsnInf>\\n        <OrgnlTxRef>\\n          <Amt><InstdAmt Ccy=\\"EUR\\">89.90</InstdAmt></Amt>\\n          <ReqdColltnDt>2026-11-20</ReqdColltnDt>\\n          <MndtRltdInf><MndtId>MANDATE-0003</MndtId><DtOfSgntr>2026-01-10</DtOfSgntr></MndtRltdInf>\\n          <RmtInf><Strd><CdtrRefInf><Ref>RF18539007547034</Ref></CdtrRefInf></Strd></RmtInf>\\n          <Dbtr><Nm>Example Bakery GmbH</Nm></Dbtr>\\n          <DbtrAcct><Id><IBAN>AT611904300234573201</IBAN></Id></DbtrAcct>\\n        </OrgnlTxRef>\\n      </TxInfAndSts>\\n    </OrgnlPmtInfAndSts>\\n  </CstmrPmtStsRpt>\\n</Document>\\n"
}' |
apify call hardreset83/sepa-rejects-returns-to-excel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hardreset83/sepa-rejects-returns-to-excel"
        }
    }
}
```

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/Usj8aFhf3iSqYkEoY/builds/mvppSGgGoWtmYYScZ/openapi.json
