Invoice number from the GoCardless referenceSo DATEV clears your open items automatically
GoCardless does not know your invoices – but the payment reference usually contains the invoice number. finHero extracts it and writes it into Belegfeld 1 of every payment, fee and chargeback entry. That way DATEV finds the open item for the payment and the debtor is cleared – without manual matching.
Reference → Belegfeld 1
RE-12344711/2026RE-2026-0042Automatic detection without a pattern – computed with the same logic as the export.
Why it matters
No automatic clearing without the invoice number
Under accrual taxation your invoicing software books the invoice against the debtor. The GoCardless payment has to address the same debtor with the same document number – otherwise the item stays open.
Open-item matching in DATEV
DATEV assigns payments to open items via debtor account and Belegfeld 1. If the invoice number matches, the item is cleared; otherwise it is manual work.
Chargebacks hit the right item
If a direct debit comes back, the reversal entry carries the same invoice number – the item is reopened on the right debtor.
Auditability
Every entry can be traced in both directions via invoice number, GoCardless transaction ID and payout ID – from receipt to entry and back.
Automatic detection
How finHero finds the invoice number
Without any further setting, finHero takes the last whitespace-separated part of the payment reference (or of the description) that contains a digit. If there is none, the GoCardless payment ID goes into the document field.
| Payment reference in GoCardless | Belegfeld 1 | Source |
|---|---|---|
| Firma GmbH RE-1234 | RE-1234 | automatic |
| Rechnung Nr. 4711/2026 Beratung | 4711/2026 | automatic |
| RE-2026-0042 Hosting | RE-2026-0042 | automatic |
| Mitgliedsbeitrag 2026-03 Mueller | 2026-03 | automatic |
| Abo Mustermann | PM00ABC123XYZ | payment ID |
The result is reduced to the DATEV character set for the document field (letters, digits and $ % & * + - /) and cut to 36 characters. The full reference stays in the booking text.
Your own pattern
When the automatic detection does not fit your references
If the invoice number is not at the end or the reference contains other numbers (customer number, month), you store a pattern – a regular expression – in the GoCardless settings. It takes precedence over the automatic detection.
Write a pattern with a capture group
The invoice number goes into the first capture group ( … ). Matching is case-insensitive, at most 200 characters, no ^ or $ needed.
Test on real references
Load the latest payments from your GoCardless account with one click or type in examples. The preview shows live what would end up in the document field – with the same logic as the export.
Save – done
The pattern applies to all future exports. If a reference does not match the pattern, the automatic detection kicks in, then the payment ID.
| Pattern | Reference | Belegfeld 1 |
|---|---|---|
| (RE-\d+) | Firma GmbH RE-1234 | RE-1234 |
| Nr\.?\s*(\d+/\d{4}) | Rechnung Nr. 4711/2026 Beratung | 4711/2026 |
| (RE-\d{4}-\d+) | RE-2026-0042 Hosting | RE-2026-0042 |
All three examples are computed with the real extraction. An invalid or too long pattern is rejected on saving – an export with a broken pattern is impossible.
Not a regex expert?
Let Claude or ChatGPT write the pattern for you
In the settings you copy a ready-made prompt with one click that contains your example references and all technical requirements. Paste the answer into the "pattern" field and check it in the preview.
- The prompt contains 2–3 of your real references – so the pattern fits your format.
- The requirements (capture group, no inline flags, at most 200 characters) are already spelled out.
- You check the result on your references before it goes into an export.
The prompt reveals nothing about your customers except the references you enter yourself.
I need a regular expression (JavaScript/Java compatible) that extracts only my invoice number from GoCardless payment references. Examples of my references: - Firma GmbH RE-1234 - Firma Muster AG RE-1235 - Beratung Mai RE-1240 Requirements: - The invoice number must be in the first capture group ( ... ); the rest of the reference (e.g. company name) must not be in it. - Matching is case-insensitive; do not use inline flags like (?i). - No variable-length lookbehinds, no ^ or $ needed, at most 200 characters. - Reply with the regular expression only, on one line, without surrounding slashes and without explanation.
Clearing in DATEV
Open items in DATEV: invoice from the invoicing software, payment from GoCardless
Under accrual taxation (default) finHero books no revenue. The invoice comes from Lexware Office, sevDesk & co. into DATEV; the GoCardless payment carries the same invoice number in Belegfeld 1 and clears the item.
- Invoice RE-1234 is booked from the invoicing software: debtor to revenue.
- finHero books the payment: GoCardless account to debtor, Belegfeld 1 = RE-1234.
- The fee also carries RE-1234 – so it stays assigned to the payment.
- DATEV finds the open item RE-1234 on the debtor and clears it.
How the complete export is structured – including chargebacks, refunds and payout – is covered in the GoCardless to DATEV guide. Prerequisite for matching: debtor account and invoice number are identical in both systems.
| Amount € | Account | Contra account | Booking text |
|---|---|---|---|
| 119,00 | 10000 | 4400 | Invoice RE-1234 (from the invoicing software) |
| 119,00 | 1816 | 10000 | Payment · RE-1234 (finHero) |
| 1,20 | 6855 | 1816 | GoCardless fee · RE-1234 (finHero) |
Taxation method
Accrual, accrual without invoices or cash basis?
The invoice number always ends up in Belegfeld 1. Whether finHero additionally books a revenue row – and with which date – is determined by your taxation method.
Accrual taxation (default)
No revenue entry by finHero. The invoice comes from the invoicing software, the payment clears it via the invoice number.
Accrual without invoices in DATEV
finHero also books debtor to revenue account, dated on the day the payment was created in GoCardless – GoCardless does not know the real invoice date.
Cash-basis taxation
finHero books the revenue row on the collection date of the direct debit; chargebacks create the revenue reversal with the same invoice number.
GoCardless provides no VAT data – revenue rows go to your default revenue account or, if none is set, to the clarification account. The setting applies globally to GoCardless, Mollie and PayPal.
Practical tips
So the matching reconciles every month
Six things we learned from real GoCardless accounts.
- Put the invoice number into the payment reference of your direct debit – ideally at the end, then the automatic detection applies.
- Check the preview with real references before creating the first export.
- Use a pattern if references contain customer numbers, months or amounts.
- Keep the debtor account identical in invoicing software and finHero – otherwise DATEV does not find the item.
- If the number is missing entirely, the GoCardless payment ID goes into the document field – you still find the payment via the transaction ID in the additional information.
- Under cash-basis taxation: the revenue row carries the collection date, the payment row the payout date – both intended.
The same invoice number is also on every fee entry – details in Booking GoCardless fees.
FAQ
FAQ: invoice number & Belegfeld 1
What is Belegfeld 1 in DATEV?
The field for the document number of an entry. For debtor entries the invoice number belongs there so DATEV can bring payment and open item together. It allows up to 36 characters of letters, digits and a few special characters.
Where does finHero take the invoice number from?
From the payment reference in GoCardless, or from the description as a fallback. Your own pattern is applied first, then the automatic detection (last part with digits), finally the payment ID.
What happens if the reference contains no invoice number?
Then the GoCardless payment ID goes into Belegfeld 1. The item is not cleared automatically but remains uniquely identifiable via the transaction ID. Better: include the invoice number in the reference of the direct debit.
How do I test my pattern?
In finHero's GoCardless settings: type in example references or load the latest payments – the preview immediately shows the result and whether it comes from the pattern, the automatic detection or the payment ID.
Does finHero clear the open items itself?
No. finHero delivers the entries with the correct invoice number; clearing the open items happens in DATEV or your accounting system on import.
Does this also apply to chargebacks and refunds?
Yes. Chargebacks, failed debits, refunds and fees carry the same invoice number as the original payment.
Still have questions? Go to the help center
Read more
Open items that clear themselves
Connect GoCardless, check the invoice-number preview and create your first booking batch for free.
Create your first export for freecancel monthly · read access only




