# Programmatic Tax Return / e-Steuerauszug

**URL:** https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908
**Category:** Investing / Portfolios
**Created:** [February 12, 2024, 2:45pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908 "2024-02-12T14:45:09Z")
**Posts on this page:** 18
**Page:** 2

<div class="post-metadata">

### Author: ![nabalzbhf](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nabalzbhf/32/3277_2.png) [@nabalzbhf](https://forum.mustachianpost.com/u/nabalzbhf)
#### Post date: [February 20, 2024, 5:51pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/23 "2024-02-20T17:51:36Z")

</div>

> [@jay](#):
>
> I understand it, you’d be considered self-employed,

I’d assume tax status does not automatically transfer to social security status.

---

<div class="post-metadata">

### Author: ![jay](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@jay](https://forum.mustachianpost.com/u/jay)
#### Post date: [February 20, 2024, 6:09pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/24 "2024-02-20T18:09:59Z")

</div>

> [@nabalzbhf](#):
>
> I’d assume tax status does not automatically transfer to social security status.

To me it would be surprising if you’re considered self-employed without being required to contribute to pillar 1. A few sources that point to self-employment and/or AHV contributions:

Kreisschreiben Nr. 36:

> Dieses Kreisschreiben dient als Hilfsmittel zur Abgrenzung einer selbständigen Erwerbs-  
> tätigkeit (Quasi-Wertschriftenhandel) von der privaten Vermögensverwaltung.

> **[Buch](https://wissen.zg.ch/steuerbuch)**
>
> Steuerbuch Zug - Wissensmanager

> Gemäss DBG Art. 16 Abs. 3 und StG § 23 Buchstabe b sind Kapitalgewinne auf Privatvermögen steuerfrei. Steuerbar werden die Kapitalgewinne aber, wenn sie im Rahmen einer selbständigen Erwerbstätigkeit erzielt werden. Dabei spielt es keine Rolle, ob die Tätigkeit im Haupt- oder Nebenberuf, regelmässig, wiederkehrend oder nur einmal ausgeübt wurde. Kapitalgewinne unterliegen dann der direkten Bundessteuer, den kantonalen Steuern und auch der AHV-Beitragspflicht.

> **[Gewerbsmässiger Wertschriftenhandel kommt teuer zu stehen](https://blog.mattig.swiss/Home/Article/4253/?Gewerbsm%C3%A4ssiger-Wertschriftenhandel-kommt-teuer-zu-stehen)**
>
> Die Eidgenössischen Räte haben bereits mehrfach versucht, den gewerbsmässigen Wertschriftenhandel explizit im Gesetz zu verankern.

> Die Kapitalgewinne sind beim Bund, Kanton sowie bei der AHV steuer- und abgabepflichtig.

---

<div class="post-metadata">

### Author: ![aab](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@aab](https://forum.mustachianpost.com/u/aab)
#### Post date: [December 28, 2024, 4:23pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/25 "2024-12-28T16:23:33Z")

</div>

I stumbled on this thread since I wanted to develop a tool to create such barcodes. The effort to program this is probably quite high, but if other people could profit, that would be nice.

> [@jay](#):
>
> That said, as the eSteuerauszug is used as alternative to a regular broker statement, it’s used as documentation/evidence from the broker (especially important when declaring withholding taxes), so I suspect that even if that tool was available to anyone, they wouldn’t accept unofficial PDFs.

I never had to upload any broker statements (even for withholding taxes) - this might depend on the canton though. The use of a custom would probably not be a problem since the person filling out the form is still fully responsible. And a signature doesn’t seem to be required by the standard, so this shouldn’t be required either.

> [@oswand](#):
>
> The problem is with creating the PDF, because most online tax portals only allow PDF uploads, at least for the canton I’m living in (eTax from Ringler Informatik AG) . And exactly that information, meaning the tool being used to generate it **taxstatement-api-2.2.zip** , is not public. I asked the people that are responsible for the standard [2], but they told me they only give out that information to cantons and banks… could have otherwise been a cool project.

The specifications on how to create the barcode is here: [https://www.ech.ch/sites/default/files/dosvers/beilagen/BEIL2\_d\_DEF\_2022-06-07\_eCH-0196\_V2.0.0\_Barcode%20Generierung%20-%20Technische%20Wegleitung.pdf](https://www.ech.ch/sites/default/files/dosvers/beilagen/BEIL2_d_DEF_2022-06-07_eCH-0196_V2.0.0_Barcode%20Generierung%20-%20Technische%20Wegleitung.pdf)

They recommend the use of a Java library, and also provide more precise information on how to use said library.  
Easiest would probably be to create a tool for XML → eCH-0196 PDF to allow some flexibility in the input.

If someone would be up to create such a tool, let me know

---

<div class="post-metadata">

### Author: ![tarioch](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/t/22d042/32.png) [@tarioch](https://forum.mustachianpost.com/u/tarioch)
#### Post date: [December 28, 2024, 6:03pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/26 "2024-12-28T18:03:01Z")

</div>

I’m pretty sure the problem is that even if you produce correct reports, you will not be able to get an approved key to sign the tax statement and therefore the reports will not be accepted/imported into the tax statements.

---

<div class="post-metadata">

### Author: ![oswand](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/oswand/32/15442_2.png) [@oswand](https://forum.mustachianpost.com/u/oswand)
#### Post date: [December 28, 2024, 10:14pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/27 "2024-12-28T22:14:59Z")

</div>

> [@aab](#):
>
> I stumbled on this thread since I wanted to develop a tool to create such barcodes. The effort to program this is probably quite high, but if other people could profit, that would be nice.

I know about it. The problem is that you don’t know what you have to put into the XML and how it’s split up and signing and whatever. Maybe I’m wrong, but that’s what I remember.

---

<div class="post-metadata">

### Author: ![aab](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@aab](https://forum.mustachianpost.com/u/aab)
#### Post date: [December 29, 2024, 1:03pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/28 "2024-12-29T13:03:18Z")

</div>

> [@tarioch](#):
>
> I’m pretty sure the problem is that even if you produce correct reports, you will not be able to get an approved key to sign the tax statement and therefore the reports will not be accepted/imported into the tax statements.

Signing the XML contained in the barcodes does not seem to be required, this is only the case for an attached XML (see specification).

The high complexity lies in the barcode creation, not in the XML-creation. This is why the simplest solution for personal projects would be the use of Selenium for example (as mentioned above). But this would only work per-canton and not for all cantons as a barcode would / should.

---

<div class="post-metadata">

### Author: ![nabalzbhf](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/nabalzbhf/32/3277_2.png) [@nabalzbhf](https://forum.mustachianpost.com/u/nabalzbhf)
#### Post date: [February 19, 2026, 6:02pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/57 "2026-02-19T18:02:45Z")

</div>

107 posts were merged into an existing topic: [OpenSteuerAuszug: generate your own eTax / eSteuerauszug for IBKR, Schwab and others](https://forum.mustachianpost.com/t/opensteuerauszug-generate-your-own-etax-esteuerauszug-for-ibkr-schwab-and-others/18288/2)

---

<div class="post-metadata">

### Author: ![Dr.PI](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/dr.pi/32/5299_2.png) [@Dr.PI](https://forum.mustachianpost.com/u/Dr.PI)
#### Post date: [February 12, 2026, 8:59am UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/159 "2026-02-12T08:59:06Z")

</div>

A post was merged into an existing topic: [Datalevel: eTax documents for IBKR](https://forum.mustachianpost.com/t/datalevel-etax-documents-for-ibkr/17985/46)

---

<div class="post-metadata">

### Author: ![PhilMongoose](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/philmongoose/32/12331_2.png) [@PhilMongoose](https://forum.mustachianpost.com/u/PhilMongoose)
#### Post date: [February 19, 2026, 2:46pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/167 "2026-02-19T14:46:19Z")

</div>

Found another project:

> **[GitHub - aurelschwitter/ibkr-to-etax: Simplify your Swiss tax declaration by...](https://github.com/aurelschwitter/ibkr-to-etax)**
>
> Simplify your Swiss tax declaration by automatically converting Interactive Brokers (IBKR) FlexQuery exports into eCH-0196 electronic tax statements compatible with Swiss cantonal tax systems.

---

<div class="post-metadata">

### Author: ![Pet](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/p/82dd89/32.png) [@Pet](https://forum.mustachianpost.com/u/Pet)
#### Post date: [February 20, 2026, 6:14am UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/168 "2026-02-20T06:14:07Z")

</div>

FYI: The [OpenSteuerAuszug](https://github.com/vroonhof/opensteuerauszug) discussion have been moved to a dedicated thread: [OpenSteuerAuszug: generate your own eTax / eSteuerauszug for IBKR, Schwab and others - #2 by j\_from\_b](https://forum.mustachianpost.com/t/opensteuerauszug-generate-your-own-etax-esteuerauszug-for-ibkr-schwab-and-others/18288/2)

---

<div class="post-metadata">

### Author: ![PhilMongoose](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/philmongoose/32/12331_2.png) [@PhilMongoose](https://forum.mustachianpost.com/u/PhilMongoose)
#### Post date: [September 23, 2026, 8:09pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/169 "2026-09-23T20:09:40Z")

</div>

I stopped looking at OpenSteuerAuszug as I got too busy with other stuff. But ended up having to file my tax return in 2 days.

Today, I turned to AI and hooked up my AI to the browser. After a bit of configuration, I got it working. It’s now churning through the IBKR export and filling in my tax return, adding new tickers, filling in the trades, verifying ISIN, sense checking opening+trades=closing etc.

It’s not very efficient as it takes about half a minute to do each position, but I just set it going. It’s on 11/40 for new positions to add. The good thing is that I can also watch what it is doing and also review the entries afterwards as it is all in the standard web UI.

The tool is also more general as I can apply it to any browser based process now.

---

<div class="post-metadata">

### Author: ![dbu](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/dbu/32/1552_2.png) [@dbu](https://forum.mustachianpost.com/u/dbu)
#### Post date: [September 24, 2026, 4:24am UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/170 "2026-09-24T04:24:18Z")

</div>

And “the AI” didn’t recommend to try filling in a oneliner and attaching the IBKR report (before going mining)? 😁  
(Or is it confirmed that your canton does not accept such reporting?)

---

<div class="post-metadata">

### Author: ![Panzo](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/p/b4bc9f/32.png) [@Panzo](https://forum.mustachianpost.com/u/Panzo)
#### Post date: [September 24, 2026, 4:48am UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/171 "2026-09-24T04:48:12Z")

</div>

Are you comfortable sharing all your tax information with US or are you using a local model?

---

<div class="post-metadata">

### Author: ![PhilMongoose](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/philmongoose/32/12331_2.png) [@PhilMongoose](https://forum.mustachianpost.com/u/PhilMongoose)
#### Post date: [September 24, 2026, 11:37am UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/172 "2026-09-24T11:37:41Z")

</div>

Now it is filing in my property expenses. I was going to just do ‘pauschal’ to save time and effort but now AI and going through the PDFs and adding them to calculate Effective Cost.

Will save me close to 1000 CHF.

---

<div class="post-metadata">

### Author: ![Peppa](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/peppa/32/21604_2.png) [@Peppa](https://forum.mustachianpost.com/u/Peppa)
#### Post date: [September 24, 2026, 11:57am UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/173 "2026-09-24T11:57:56Z")

</div>

> [@Panzo](#):
>
> Are you comfortable sharing all your tax information

I think that is a valid point. I am not.

---

<div class="post-metadata">

### Author: ![PhilMongoose](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/philmongoose/32/12331_2.png) [@PhilMongoose](https://forum.mustachianpost.com/u/PhilMongoose)
#### Post date: [September 24, 2026, 12:57pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/174 "2026-09-24T12:57:45Z")

</div>

> [@Peppa](#):
>
> I think that is a valid point. I am not.

Depends on what information you are sharing. If it is your stock information on US companies which, trading on US exchanges, which you buy through a US broker and declared on your tax return. I’m not sure you’re giving up much information that they don’t already have or can’t already get.

---

<div class="post-metadata">

### Author: ![Peppa](https://forum.mustachianpost.com/user_avatar/forum.mustachianpost.com/peppa/32/21604_2.png) [@Peppa](https://forum.mustachianpost.com/u/Peppa)
#### Post date: [September 24, 2026, 1:22pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/175 "2026-09-24T13:22:54Z")

</div>

I mean data privacy regulations are different between tax administration, bank, broker and AI firm.

---

<div class="post-metadata">

### Author: ![Panzo](https://forum.mustachianpost.com/letter_avatar_proxy/v4/letter/p/b4bc9f/32.png) [@Panzo](https://forum.mustachianpost.com/u/Panzo)
#### Post date: [September 24, 2026, 3:32pm UTC](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908/176 "2026-09-24T15:32:24Z")

</div>

You are training the upcoming AI traderbots

[Previous page](https://forum.mustachianpost.com/t/programmatic-tax-return-e-steuerauszug/11908.md?page=1)
