Skip to Content

Detractions, perceptions and withholdings in Odoo: setup and bulk payment TXT

When each regime applies, how to set it up in Odoo 19 and how to generate the TXT file for bulk detraction payments
November 20, 2026 by
Detractions, perceptions and withholdings in Odoo: setup and bulk payment TXT
Wilfredo Fernando Pastor Avila
| No comments yet

Detractions, perceptions and withholdings are three different mechanisms to secure payment of the IGV (Peru's VAT). In a detraction, the buyer deducts a percentage of the price and deposits it in the supplier's account at Banco de la Nación. In a perception, the seller designated as an agent charges the customer an additional percentage. In a withholding, the buyer designated as an agent withholds 3% of the payment to the supplier. Odoo 19 computes the detraction on the sales invoice and reports it to SUNAT; detraction payments on purchases, self-detraction and the TXT file for bulk online payment are handled with additional modules, such as the ones we use at Ganemo.

When each regime applies

Detraction (SPOT)PerceptionWithholding
Who actsThe buyer or user deposits; the supplier may self-detract if it collected the full amount without the deposit being made.The seller designated as a perception agent collects the extra amount.The buyer designated as a withholding agent keeps part of the payment.
Which transactionsGoods and services in the annexes of RS No. 183-2004/SUNAT, road freight transport and public passenger transport.Sale of goods listed in Appendix 1 of Law No. 29173.IGV-taxed transactions with non-excluded suppliers.
Reference rateDepends on the good or service: for example 12% for several Annex 3 services and 4% for road freight.2% general; 0.5% if the customer is also a perception agent and the voucher allows a tax credit.3%.
ThresholdTransactions above S/ 700, except for some goods; for freight the amount is compared with the reference value.Its own rules by type of good and customer.Vouchers above S/ 700.

The regimes do not stack: withholding does not apply to transactions subject to the detraction system or to purchases from perception agents, and perception does not apply to transactions subject to detraction either. Rates and lists of goods change by resolution, so confirm the current percentage for each product on SUNAT's portal before setting it up.

Detraction deadlines and penalty

  • For Annex 3 services, when the user deposits: by the date of the partial or full payment to the supplier, or within the fifth business day of the month following the one in which the voucher was recorded in the Purchase Register, whichever comes first.
  • When the supplier is the obligated party because it collected the full amount without the deposit being credited: within the fifth business day after receiving the amount.
  • Failing to deposit on time is penalized with a fine equal to 50% of the amount not deposited.
  • Bulk deposits online accept one or more deposits per file; at Banco de la Nación branches a minimum of ten is required.

What Odoo 19 does and what Ganemo's modules add

  • Native Odoo 19, on sales. Each product subject to detraction carries a code from SUNAT's catalogue 54 and its percentage. If the invoice has operation type 1001 (transaction subject to detraction), Odoo computes the amount always in soles, adds the legend «Operación sujeta a detracción», reports in the XML your company's detraction account at Banco de la Nación and declares the net amount pending payment without the detraction.
  • Native Odoo 19, on purchases. The vendor bill stores the date and number of the deposit certificate, which flow to the purchase register. The Peruvian chart of accounts includes accounts 40113 (IGV, perception regime) and 40114 (IGV, withholding regime) and a 3% IGV withholding tax.
  • What native Odoo does not do. It does not generate the bulk detraction payment TXT, and its electronic invoicing sends invoices, receipts and notes from sales journals: it does not issue electronic withholding or perception vouchers.
  • Ganemo modules installed in our production Odoo 19. «Base Spot» adds detraction, withholding and operation type fields to vendor bills; «Payment term lines» splits the detraction or withholding into its own due line so it can be reconciled separately; «Electronic Invoicing Peru» prevents posting a sale subject to detraction with the wrong operation type; and «Pagos masivos de detracciones» creates the detraction payments, groups them into a batch and generates the TXT file, both for buyer deposits and for self-detraction.

Step by step: set up detractions and generate the TXT in Odoo

  1. Your company's detraction account. On the company contact, accounting tab, record the 11-digit account at Banco de la Nación. Odoo needs it for the sales XML and the module requires it for the file.
  2. Products. On each product or service subject to the system, choose the catalogue 54 code and the percentage set by the current resolution.
  3. Suppliers. Record the 11-digit RUC and each supplier's detraction account at Banco de la Nación. Without it the batch cannot be generated.
  4. Payment terms. Create a term with two lines, for example 88% and 12%, and flag the second as a detraction or withholding so it becomes its own due line.
  5. Sales invoices. Use operation type 1001 when the sale is subject to the system. Check the legend and the amount on the PDF.
  6. Vendor bills. Flag the detraction, the operation type and the code of the good or service in the other information tab.
  7. Detraction payments. Select the bills and use the detraction payment wizard: Odoo proposes the amount and the destination account and explains where each figure came from.
  8. Batch and TXT. Group the payments into a batch, assign the batch number in AANNNN format (for example 260001) and generate the file. The module names it D, plus the RUC, plus the batch number, with a TXT extension.
  9. Payment. Upload the file in the bulk detraction payment option of SUNAT Operaciones en Línea and pay through your affiliated bank.
  10. Certificates. Record on each bill the date and number of the deposit certificate. That data reaches the purchase register and the SIRE RCE.

What the bulk payment TXT file looks like

SUNAT and Banco de la Nación's bulk deposit instructions define a fixed-width file. The bank checks positions and lengths and rejects the whole file if a single row fails, without saying which one; that is why our module measures every record before handing it over.

  • Name: D, plus the depositor's RUC, plus the batch number, with a TXT extension.
  • 68-character header: an asterisk if the buyer deposits (or P if it is the supplier), the depositor's RUC and company name, the batch number and the batch total.
  • 107-character detail per deposit: supplier document type and number, code of the good or service, supplier's account at Banco de la Nación, amount, operation type, period and voucher type, series and number.
  • Amounts in whole soles: thirteen digits for the integer part and two decimals that must be zeros, with no decimal point.

Common errors

  • Repeated or malformed batch number. It must have six digits and never repeat for the same company.
  • Supplier without a Banco de la Nación account or with an incomplete RUC. The whole batch fails.
  • Credit notes in the batch. A credit note does not give rise to a deposit; take it out of the batch.
  • Vouchers the file does not accept. Only invoices, sales receipts and waybills travel in it; a debit note is declared as an invoice.
  • Detraction computed in dollars. The deposit is always in soles and in whole amounts.
  • Applying withholding to an invoice subject to detraction. The regimes do not stack.
  • Certificate not recorded. Without the deposit date and number, the purchase register is incomplete.

How we do it at Ganemo

Method first. We review with you which products and services are subject to the system and at what rate, put the weekly detraction payment procedure in writing and train treasury to generate and upload the batch without depending on anyone. We start with standard Odoo and add modules only where they save real work.

Then AI as an accelerator. Your own AI agent (Claude Code or ChatGPT Codex), connected to Odoo with keys stored in Secrevo, can check before generating the batch that each supplier has a RUC and a Banco de la Nación account, detect credit notes or vouchers the file does not accept and compare the configured rates with SUNAT's current list. We don't sell certificates, we deliver results.

Want to stop building the TXT by hand? Book a diagnosis or message us on WhatsApp at +1 (828) 672 6150.

Related guides

Frequently asked questions

Does Odoo generate the bulk detraction payment TXT?

Native Odoo does not. Our bulk detraction payments module generates it and validates the whole batch before creating the file.

Can I pay detractions on dollar bills?

Yes, but the deposit is in soles and in whole amounts. The module converts at the payment's exchange rate and rounds as the instructions require.

What is self-detraction?

It is the deposit the supplier itself makes when it collected the full amount without the customer depositing. The module handles that case with its own account and a file header starting with P.

Does Odoo issue electronic withholding vouchers?

Odoo's native Peruvian e-invoicing does not issue them. If you are a withholding agent, that issuing has to be handled through another channel and the withholding recorded in Odoo with its tax and account.

How often should the batch be generated?

It depends on your payments. The deadline falls on the first payment to the supplier or the fifth business day of the following month, so many companies generate one batch a week together with their payment run.

Sources

Detractions, perceptions and withholdings in Odoo: setup and bulk payment TXT
Wilfredo Fernando Pastor Avila November 20, 2026
Share this post
Tags
Archive
Sign in to leave a comment
Electronic waybill (GRE) in Odoo: sender, carrier, series and rejections
Who issues each waybill, what data SUNAT requires, how to set up Odoo 19 and how to solve the most common rejections