import { Callout } from "zudoku/ui/Callout";

# Export a payment file as a pain file

This page describes how 365 business Banking writes credit transfers as pain.001 and direct debits as pain.008 for upload to your online banking.

**Applies to:** payment initiation service *Bank Account (pain File Export)*

## Step by step

The process up to the payment is the same as for any other bank account: payment suggestion in the payment journal, review, then **Carry Out Payment**.

1. Business Central writes the payments as pain.001 in the version from your [ISO 20022 File Setup](setup.mdx) and offers the file in your browser for download. The file name is `pain.001_<message ID>.xml`.
2. After saving, Business Central reports that the file was created and that you must upload it to your bank to carry out the payments.
3. Upload the file in your online banking and approve it there as usual.

If the posting date lies in the future, it is entered in the file as the requested execution date. This makes a future-dated transfer possible.

For an account with the **Payment Scheme** *International*, every payment requires the recipient's name, their IBAN **or** their account number, and the BIC of their bank. A bank code without a BIC is not supported, and Business Central rejects instant credit transfers for such accounts with a message. See [International payments](../../payment-types/international-payment.mdx).

The message ID comes from the **Payment Message ID Nos.** in the **Banking Setup**. Your bank rejects a second file with the same ID. This detects a payment run that was uploaded twice by mistake.

## What the status Completed means here

<Callout type="danger" title="Completed means file written, not paid">
As soon as the file is saved, the journal lines have the payment status *Completed* and can be posted. This status **only means that the file was written**, not that your bank carried out the payment. Business Central cannot determine this, because there is no communication with your bank. **The upload is your step and is not made up for automatically if it is forgotten.**

Therefore, post only once the bank has accepted the file.
</Callout>

**Carry Out Payment and Post** posts the lines as soon as the file is saved, that is, before you have uploaded it. If you want to wait until the bank accepts the file, choose **Carry Out Payment** and post later.

If you cancel the download, no changes are made: Business Central reports that the payment file was not saved and the payments are still open. The lines remain *Open* and can be carried out again.

## Direct debits

The same applies to a direct debit collection: **Carry Out Direct Debit** in the cash receipt journal writes `pain.008_<message ID>.xml`, and you upload the file to your bank to collect the direct debits. Direct debits are only available in the *SEPA* scheme, under the CORE and the B2B scheme, single and as collective direct debits.

Once the file is saved, the direct debit collection entries get the status *Carried-Out/File Created*. A second **Carry Out Direct Debit** only takes entries with the status *New* and therefore does not collect the same direct debit twice.

<Callout type="caution" title="The mandate counter is updated on download">
A file does not report back whether the bank collected the amount. Business Central therefore updates the mandate counter as soon as the file is saved. If the file is not uploaded, the counter is no longer correct; only a returned direct debit or a correction on the mandate corrects it. Therefore, upload every pain.008 file that you save.
</Callout>

In the pain.008, the sequence type comes from the mandate: *OOFF* for a one-off mandate, and for a recurring mandate *FRST* on the first collection and *RCUR* after that. Each collection date and sequence type gets a separate payment block; in a collective direct debit, the direct debits of a block share one end-to-end reference.

Customers with the partner type *Company* are collected as B2B direct debits, all others as CORE direct debits. The two types must not be in one file: a run with both is rejected with "CORE and B2B direct debits cannot be sent in one file. Carry them out separately."

## If the export is refused

If Business Central reports that the payment cannot be written in the chosen format and lists reasons, a payment does not match the format. For example, the BIC is missing for an international payment. Fix the listed points in the journal and carry out the payment again.

| Message | Cause and remedy |
|---|---|
| "Bank account … follows the International rulebook …" | Direct debits are only available in the SEPA procedure. Collect from a SEPA account. |

## See also

- [Carry out payment: process per bank connection](../../bank-payment/carry-out-payment.mdx)
- [Combine banking services](../mixed-operation.mdx)
- [International payments](../../payment-types/international-payment.mdx)
