OpenSteuerAuszug: generate your own eTax / eSteuerauszug for IBKR, Schwab and others

<OpenPosition accountId="accountId" acctAlias="" model="" currency="EUR" fxRateToBase="0.93109" assetCategory="STK" subCategory="ETF" symbol="IWDA" description="ISHARES CORE MSCI WORLD" conid="conid" securityID="IE00B4L5Y983" securityIDType="ISIN" cusip="" isin="IE00B4L5Y983" figi="BBG000P71QK5" listingExchange="AEB" underlyingConid="" underlyingSymbol="IWDA" underlyingSecurityID="" underlyingListingExchange="" issuer="" issuerCountryCode="IE" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" reportDate="2025" position="13" markPrice="111.53" positionValue="1449.89" openPrice="58.33" costBasisPrice="58.33" costBasisMoney="758.19" percentOfNAV="3.49" fifoPnlUnrealized="691.7" side="Long" levelOfDetail="SUMMARY" openDateTime="" holdingPeriodDateTime="" vestingDate="" code="" originatingOrderID="" originatingTransactionID="" accruedInt="" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0" />
<Transfer accountId="accountId" acctAlias="" model="" currency="EUR" fxRateToBase="0.944" assetCategory="STK" subCategory="ETF" symbol="IWDA" description="ISHARES CORE MSCI WORLD" conid="conid" securityID="IE00B4L5Y983" securityIDType="ISIN" cusip="" isin="IE00B4L5Y983" figi="BBG000P71QK5" listingExchange="AEB" underlyingConid="" underlyingSymbol="IWDA" underlyingSecurityID="" underlyingListingExchange="" issuer="" issuerCountryCode="IE" multiplier="1" strike="" expiry="" putCall="" principalAdjustFactor="" reportDate="2025" date="20250813" dateTime="20250813" settleDate="20250815" type="FOP" direction="IN" company="--" account="account" accountName="" deliveringBroker="Multiple" quantity="13" transferPrice="0" positionAmount="1354.02" positionAmountInBase="1278.19488" pnlAmount="0" pnlAmountInBase="0" cashTransfer="0" code="" clientReference="" transactionID="transactionID" levelOfDetail="TRANSFER" positionInstructionID="" positionInstructionSetID="" serialNumber="" deliveryType="" commodityType="" fineness="0.0" weight="0.0" />
1 Like

I added a link to datalevel and other solution (a chrome extension that can auto fill the ZRH tax form) to opensteuerauszug/README.md at main · vroonhof/opensteuerauszug · GitHub

3 Likes

Has anyone thought of trying opensternauszug with postfinance or swissquote? “unetical”?

4 Likes

That should work out pretty well I assume. The precject allows hooking in any importers as far as I have seen. Using extensive export sample data (best would be some machine readable format like CSV or XML) which privides all needed data (also PDF could work), optionally an ecport documentation, and the two existing importers (IBKR, Schwab), I would assume an agentic AI can create a very good vasis to build on. That would be an interesting experiment for any bank or broker which does not offer eSteuerauszug or charges for it extra.

I read that the java library is supposed to be open source, but is this documented anywhere? If so, then maybe it makes more sense to focus on the IBKR → XML conversion if we have a verified and usable XML → PDF converter.

1 Like

Die API wird als Open Source Software unter Apache Lizenz
V 2.0 ĂŒber die nachfolgende URL zur VerfĂŒgung gestellt. Die Quellen, Java Doc und Beispiele
stehen ebenfalls ĂŒber die nachfolgende URL in der Datei taxstatement-api-2.2.zip zur
VerfĂŒgung.

This is pretty clear. I wonder if we can just take the JAR file we have found in official tax software (see posts above), decompile it and make it available on GitHub under the described Apache licence. The decompiled code looks quite readable. I could do this with minimal efforts.

Does anybody see blockers or potential legal issues here?

The main issue is that you don’t really have proof of what the license is (I don’t think the jar carries licensing information). (You’d need access to the zip to confirm what the actual license is)

If you want to have fun, you could have a clean room setup with two Claude Code Setup :grinning_face_with_smiling_eyes:

One Claude Code writes description/documentation (without copying the code). And the other does not have access to the original and writes the code (potentially in another language).

If you combine that with a harness to test compatibility (have the second cc be able to run tests against the original lib for behavior testing), it would probably work and not have any copyright issue)

I’m also sceptical as to whether the whole thing was released and even if it was, it looks like they tried to walk it back and remove all links to it, so I wouldn’t try to poke the bear. Nonetheless, it could be worthwhile to decompile and analyze to understand how it works and learn from it even if we cannot integrate the jar directly into our own software.

I am getting to the point where I actually should be doing my tax return instead of hacking on this. Did anybody try the behavior on private tax for DA-1. Does it still have an option / warning to add supporting evidence for the withholding if you provide a steuerauszug?

Context: I am wondering how much we need to provide evidence that we actually saw a matching withholding in the broker export [seperate issue if the DA-1 folk will actually accept it]

I only just got the code for the tax return.

For WHT, I normally attach the 1043-S certificate for the US WHT. You can always attach additional documents.

A generated pdf should not be able to replace the da-1 evidence. (I don’t even know if it might be considered fraud, but it’s definitely playing with fire). Trying to trick the software to avoid filing out the fields manually is one thing, replacing the requested documented proof with ones you created yourself is entirely different.

I don’t even know if it might be considered fraud, but it’s definitely playing with fire

I do not really agree here. We are not trying to provide fake information, trick them or such. The only thing we are doing is improving the data quality of the imported data (automated is less error prone than manually typing), and simplify our and their life.

Did anybody try the behavior on private tax for DA-1. Does it still have an option / warning to add supporting evidence for the withholding if you provide a steuerauszug?

ZH: There is no option to attach an additional document to the e-taxstatement import as the is when you manually enter a position. If you really want to attach a “official” document, you can attach an activity report at the end before handing in the tax return (there is a dedicated section for attachments to the securities declaration).

But I will not attach it. As always, tax authorities can ask for an additional proof (they also did that in the past in my case for other deductions). Since all things we are handing in here are legit, it is not an issue for us to send the the officially expected activity report on request.

If this approach of non-officially generated e-taxstatement would not be accepted, it would basically void datalevel’ IBKR e-taxstatement, which the sell, as well. I would assume that they did some validation of their business model before building it.

1 Like

At this point we don’t know the internal processes eniugh know what documents the DA-1 folk getvto see.

Alternatively we could add an option to concatenate 1043-S in tge PDF

Datalevel coukd add the warm fuzzy feeling of an audited path but that would require them to take on quite sone liability.

Anyway I think it is nect to impossible to hold us equities abd not get the withholding as reported on the kurskiste s

I understand what you’re trying to do. For the general declaration it sounds fine (they don’t care about justification anyway).

For da-1 I was asked multiple time to provide better proof.

If you’re going to generate your own proof, for me it’s different and there’s a risk this is misleading. It should be extremely clear that this isn’t different than providing your own excel spreadsheet as an attachment.

(And actually if what you want is minimize typing, many people do that, enter your IBKR holding as single line and attach dividend report / end of year statement / spreadsheet)

For me it’s a nice hack, but you already know that’s not the intent of the standard (this was meant for the financial institution to provide alongside the pdf statement.

(And yeah you could attach the original statement to the generated barcode, but also sounds fishy and similar to editing pdfs before uploading them which would be fine but can make them fairly unhappy and become something closer to fraud if your software makes mistakes and the XML doesn’t match)

I guess if they encounter any issue they have an easy fix and can check the certificate who signed the XML.

1 Like

(And yeah you could attach the original statement to the generated barcode, but also sounds fishy and similar to editing pdfs before uploading them which would be fine but can make them fairly unhappy and become something closer to fraud if your software makes mistakes and the XML doesn’t match)

That brings me to an interesting idea: instead of concatenating the PDFs (e-taxstatement und IBKR PDF), we can add the original IBKR flex query XML used for generating the PDF as an attachment (you can attach files inside the PDF without altering the attachment). Optionally, we can also provide an option which allows to do the same with an IBKR PDF export. And add a clear hint inside the generated e-taxstatement on the first page that the PDF contains attached official files.

I guess if they encounter any issue they have an easy fix and can check the certificate who signed the XML.

Not exactly sure which signature you mean, but at least e-taxstatements do not contain any type of signatures (neither PDF nor XML in barcodes). As long as the PDF follows the standard specs, it is importable into your tax software in my understanding. It is currently not possible for them to block our reports in general based on a signature or such, but they can of course manually ask case-by-case for another report then checking it.

Quoting the spec

Les instructions techniques traitent les points suivants:

  • Extraire les donnĂ©es qualifiĂ©es du point de vue fiscal
  • Ajouter une signature
  • CrĂ©er un code barres de page
  • CrĂ©er une feuille Ă  codes barres
  • Extraire XML du codes barres
  • ContrĂŽler la signature
  • Transformer en dĂ©claration d’impĂŽt Ă©lectronique
  • ExĂ©cuter la taxation partiellement automatisĂ©e

I think the embedded XML has an optional digital signature.

Huh, but this is on page 1 of the OpenSteuerAuszug that you upload. It is clearly written how this document was generated, what is the purpose (making it easier for everyone) etc.
Nowhere there is a claim that this is some kind of official IBKR document that you “faked”.
In what way should that be misleading?

Especially if you cross-check it in the end with the IBKR activity report and see that you get the same numbers. Worst thing they can do is ask for the IBKR-exported activity report & then you provide it to show that it is the same as the OpenSteuerAuszug, no?

1 Like

That’s great if it’s clear it’s not anything official and akin to uploading your own spreadsheet.

But I’m fairly sure you’ll want to have another file uploaded for the da-1 since they require a proof.

Yeah they don’t ask for more proof with the DA-1 if you upload the eOpenSteuerAuszug, but if you wanna be proactive you can just upload the standard activity report at the end (ZH).

But overall it’s very transparent IMO.

1 Like