Invoice Taxes
Taxes and withholdings of each invoice, as recorded in the ERP (optional file).
Taxes (VAT, consumption tax) and withholdings (income tax withholding, ICA withholding, VAT
withholding) of each invoice, as recorded in the ERP. File invoice_taxes.csv.
Optional file: if you do not send it, Fibek keeps the taxes it already had and new invoices are left with unknown taxes (
UNKNOWN). See States.
Dependency: processed right after Invoices and only within the same load: each
erp_invoice_idmust be a valid invoice from that load’s invoices file. It is not enough for the invoice to already exist in Fibek.
Endpoint
POST /manual-csv-integration/upload/invoice-taxes
- Form Field:
file
This file has no endpoint under /full-csv-integration. It is uploaded through the platform’s
Manual Integration (My Company → Integrations → Manual Integration), with a signed-in
session and together with the invoices file of the same load. The endpoint validates and uploads
the file; invoice references are checked when the complete load is processed.
Required Fields
All five columns must always be in the header, even when an UNKNOWN declaration leaves them
empty.
| Field | Type | Description | Validations |
|---|---|---|---|
erp_invoice_id | String | Invoice ID in ERP | Must be a valid invoice from this load’s invoices file. Kept as text |
kind | String | Line type | TAX, WITHHOLDING or UNKNOWN (taxes not known). Surrounding spaces are trimmed and it is uppercased |
code | String | Tax code | Free text, uppercased (e.g., IVA, RETEFUENTE, RETEICA, RETEIVA). Required for TAX and WITHHOLDING; empty for UNKNOWN |
amount | Float | Tax amount | Dot as decimal separator, no thousands separators or exponents. Must fit numeric(18,2); rounded to two decimals. For TAX and WITHHOLDING it must be greater than 0 after rounding. Empty for UNKNOWN |
deducted_from_total | Boolean | For a withholding, whether it was already deducted from the invoice total and balance | true, false, 1 or 0, case-insensitive. Required for TAX and WITHHOLDING; for a tax (TAX) send false: it is not used. Empty for UNKNOWN (false or 0 are also accepted) |
Optional Fields
| Field | Type | Description | Validations | Default |
|---|---|---|---|---|
jurisdiction | String | Tax jurisdiction (e.g., the municipality of the ICA withholding) | - | null |
name | String | Tax name in the ERP | - | null |
base_amount | Float | Base this tax was computed on. Not used for the early payment discount: the amount before taxes of the whole invoice goes in pre_tax_amount of Invoices | Dot as decimal separator, no thousands separators or exponents. Must fit numeric(18,2); rounded to two decimals. Empty for UNKNOWN | null |
rate_percent | Float | Tax rate, per hundred | Always per hundred (percent), with a dot as decimal separator: 19 is a 19 % VAT and 2.5 a 2.5 % income tax withholding (ReteFuente). ICA withholding (ReteICA) also goes per hundred, not per thousand: 9.66 per mille is written 0.966. No thousands separators or exponents. Must fit numeric(7,4); rounded to four decimals. Empty for UNKNOWN | null |
erp_line_ref | String | Stable reference of the line in the ERP | Kept as text. Empty for UNKNOWN | null |
States
Each invoice in the load ends up in one of three states:
- With taxes (
KNOWN): the file carriesTAXorWITHHOLDINGrows for the invoice. - No taxes (
NONE): the file was sent and carries no rows for the invoice. Sending the file means you know the data, even if it only has the header. - Unknown (
UNKNOWN): the invoice carries anUNKNOWNdeclaration, or the file was not sent and the invoice is new.
To declare that you do not know an invoice’s taxes, send a single row with kind = UNKNOWN and
the rest of the tax data empty. The invoice’s previous taxes are deleted. jurisdiction and name
are also accepted on that row, but it is best to leave them empty.
Repeated rows and dropped rows
- Each invoice replaces its complete set of taxes: send all of an invoice’s taxes together.
- A line is identified by
erp_line_ref; without it, bykind,code,jurisdiction,rate_percentandname. Identical rows count once; two different values for the same line discard that invoice’s taxes. - An invalid row discards all of that invoice’s taxes, which keeps the ones it had, and the response carries a warning. Other invoices continue.
- Missing required columns, repeated columns or rows with a different number of columns: the whole file is rejected.
Example CSV
erp_invoice_id,kind,code,amount,deducted_from_total,jurisdiction,name,base_amount,rate_percent,erp_line_ref
INV001,TAX,IVA,19000,false,,IVA,100000,19,001
INV001,WITHHOLDING,RETEFUENTE,2500,true,,ReteFuente,100000,2.5,002
INV001,WITHHOLDING,RETEICA,966,true,,ReteICA,100000,0.966,003
INV002,UNKNOWN,,,,,,,,