---
title: "Withholding tax and TEJ XML export | GestaPro"
description: "Withholding tax calculated on every invoice and TEJ export: certificates in DeclarationsRS XML format, checked against the official schema before filing."
url: "https://gesta-pro.com/en/export-tej-retenue-a-la-source"
lang: en
site: "GestaPro"
---

# Withholding tax and TEJ export in a single file.

The TEJ export produces withholding tax certificates in the XML format expected by the tej.finances.gov.tn platform. GestaPro calculates the withholding on each invoice, groups the month's payments and generates the DeclarationsRS file compliant with official schema v1.0, checked before download and ready to be filed on TEJ.

## Withholding tax and TEJ in GestaPro: the essentials

- **Platform**: TEJ, tej.finances.gov.tn
- **Format**: DeclarationsRS XML, official schema v1.0
- **File name**: [tax ID]-[year]-[month]-[filing type].xml
- **Withholding base**: Amount incl. VAT excluding stamp duty
- **Available rates**: 0,5; 1; 1,5; 2,5; 3; 5; 10; 15; 20 and 25%
- **Application threshold**: 1 000 DT TTC by default, configurable
- **Filing type**: 0: initial return; 1: amended return

## How does GestaPro calculate withholding tax?

Amounts in the file are expressed in millimes. An invoice with several VAT rates produces one transaction per rate, prorated to the amount paid.

| Amount | Calculation |
| --- | --- |
| Excl. VAT | Excluding taxes after overall discount, including FODEC (VAT base) |
| VAT | Excl. VAT × VAT rate (0, 7, 13 or 19%) |
| Incl. VAT | Excl. VAT + VAT, excluding stamp duty |
| Withholding | Incl. VAT × withholding rate |
| Net paid | Incl. VAT − withholding |

## Who files the withholding certificate on TEJ?

On TEJ, the certificate is filed by the party who pays and applies the withholding. GestaPro handles both directions in two tabs.

| Case | Filer | File prepared by GestaPro |
| --- | --- | --- |
| Withholding applied (purchases) | Your company, which pays the supplier | One file per month, one certificate per supplier and per payment day |
| Tax withheld from us (sales) | Your client, who pays your invoice | One file per paying client and per month, to be sent to them |

> The file is filed on tej.finances.gov.tn before the end of the month following the payment.

## How do you export the TEJ file from GestaPro?

1. Enter the withholding rate on the sales or purchase invoice: the amount withheld is deducted from the net payable.
2. Record the payments: the certificate follows the month of payment.
3. Open Withholding tax › TEJ export, choose the month, the purchases or sales tab and the filing type.
4. GestaPro checks each file: official XSD schema, VAT rates accepted by TEJ, consistency of amounts.
5. Download the XML file, or a ZIP archive if there are several filers, then file it on TEJ.

## Where can you track the period's withholding tax?

- Withholding on sales and withholding on purchases, in two tabs
- Amount withheld per document and total for the period
- TEJ export of a single invoice from its record
- Transaction type chosen automatically according to the rate, or set manually

## Frequently asked questions

### What is the TEJ file?

It is the XML file of withholding tax certificates filed on the TEJ platform of the Tunisian tax administration (tej.finances.gov.tn). GestaPro generates it in DeclarationsRS format, official schema v1.0.

### On what amount is withholding tax calculated?

On the amount incl. VAT excluding stamp duty, that is, the amount excl. VAT (including FODEC) plus VAT. The net paid is this amount incl. VAT less the withholding.

### Can an amended return be filed?

Yes. Choose filing type 1, amended return, when exporting: the file name then carries filing type code 1.

### Does GestaPro check the file before filing?

Yes. Each file is validated against the official XSD schema and checked: VAT rates accepted by TEJ, withholding lower than the amount excl. VAT, amount incl. VAT equal to the amount excl. VAT plus VAT. A file with errors is not offered for download.

## Other GestaPro modules

- [Invoicing in Tunisia](https://gesta-pro.com/en/logiciel-facturation-tunisie) — From quote to invoice, with VAT, FODEC, stamp duty and withholding tax calculated to the millime.
- [TTN e-invoicing](https://gesta-pro.com/en/facture-electronique-ttn) — TEIF 1.8.8, TunTrust signature, El Fatoora transmission and tracking.
- [Accounting in Tunisia](https://gesta-pro.com/en/logiciel-comptabilite-tunisie) — Entries generated from operations, general ledger, trial balance, balance sheet and VAT.

## See GestaPro with your own documents

- Request a demo: https://gesta-pro.com/en/contact
- Online demo: https://gesta-pro.com/en/demo-en-ligne

## Site pages

- [Home](https://gesta-pro.com/en/)
- [Features](https://gesta-pro.com/en/fonctionnalites)
- [Pricing](https://gesta-pro.com/en/tarifs)
- [Online demo](https://gesta-pro.com/en/demo-en-ligne)
- [Request a demo](https://gesta-pro.com/en/contact)

## GestaPro solutions

- [Invoicing in Tunisia](https://gesta-pro.com/en/logiciel-facturation-tunisie) — From quote to invoice, with VAT, FODEC, stamp duty and withholding tax calculated to the millime.
- [TTN e-invoicing](https://gesta-pro.com/en/facture-electronique-ttn) — TEIF 1.8.8, TunTrust signature, El Fatoora transmission and tracking.
- [Withholding tax & TEJ](https://gesta-pro.com/en/export-tej-retenue-a-la-source) — Withholding certificates in TEJ XML format, checked before filing.
- [Accounting in Tunisia](https://gesta-pro.com/en/logiciel-comptabilite-tunisie) — Entries generated from operations, general ledger, trial balance, balance sheet and VAT.
- [POS software](https://gesta-pro.com/en/logiciel-de-caisse) — Touchscreen counter sales, 80 mm receipts, X and Z reports.
- [Multi-store POS](https://gesta-pro.com/en/logiciel-caisse-multi-magasins) — Multiple stores, offline sales, loyalty and promotions.
- [Barcodes & QR codes](https://gesta-pro.com/en/codes-barres-qr) — EAN-13 and QR labels, scanning in documents and inventory.
- [CRM in Tunisia](https://gesta-pro.com/en/crm-tunisie) — Prospects, opportunities linked to quotes, activities and reminders.
- [Customer portal](https://gesta-pro.com/en/portail-client-facturation-en-ligne) — Documents, statement, quotes signed online and customer messaging.
- [Construction management in Tunisia](https://gesta-pro.com/en/logiciel-gestion-btp-tunisie) — Contracts, progress billing, retention and guarantees.
- [Payroll in Tunisia](https://gesta-pro.com/en/logiciel-paie-tunisie) — CNSS, IRPP and CSS payslips, leave, time clock and declarations.
- [Artificial intelligence](https://gesta-pro.com/en/intelligence-artificielle) — 14 AI capabilities, always approved by a person.

GestaPro summary for AI assistants: https://gesta-pro.com/llms-en.txt
