Invoice
Correct or void an invoice
An invoice the DGII accepted cannot be edited or deleted. To void it or change its amounts, you issue a note that modifies it: a credit note (E34) to void it or reduce what was invoiced, or a debit note (E33) to increase it. Each note is one more invoice in /v1/invoices, with its own invoiceId and its own e-NCF.
Issue a credit or debit note
Section titled “Issue a credit or debit note”The note states the original invoice in originalInvoiceId, the modification code, and the reason. Its items are the amounts the note corrects, not those of the original invoice:
import { createTimbroInvoices } from "@timbro/invoices";
const timbro = createTimbroInvoices({ apiKey: process.env.TIMBRO_INVOICES_API_KEY! });const creditNote = await timbro.invoices.create({ invoiceReference: "sale-842-credit-note-1", type: "E34", originalInvoiceId: "f35b7ae4-c484-4c63-981e-4f0f15e913b5", modificationCode: "3", reason: "Partial return", currency: "DOP", incomeType: "01", paymentTerms: { type: "immediate" }, items: [{ description: "Returned service", quantity: "1", unit: "unit", kind: "service", unitPrice: "100.00", tax: { kind: "itbis_18", included: true }, }],});import os
from timbro_invoices import TimbroInvoices
timbro = TimbroInvoices(api_key=os.environ["TIMBRO_INVOICES_API_KEY"])credit_note = timbro.invoices.create({ "invoiceReference": "sale-842-credit-note-1", "type": "E34", "originalInvoiceId": "f35b7ae4-c484-4c63-981e-4f0f15e913b5", "modificationCode": "3", "reason": "Partial return", "currency": "DOP", "incomeType": "01", "paymentTerms": {"type": "immediate"}, "items": [{ "description": "Returned service", "quantity": "1", "unit": "unit", "kind": "service", "unitPrice": "100.00", "tax": {"kind": "itbis_18", "included": True}, }],})| Code | What it is for | Types |
|---|---|---|
1 |
Void the whole invoice | E34 |
2 |
Correct a text, such as the buyer’s name | E33 and E34 |
3 |
Correct amounts | E33 and E34 |
The original invoice must be accepted. Timbro checks that a credit note does not exceed the balance left on the original invoice, counting earlier notes. The reason (reason) allows up to 90 characters.
Issuing a note does not return money. If the customer paid with Timbro, refund the payment and link the note to the refund.
Correct an invoice you did not issue with Timbro
Section titled “Correct an invoice you did not issue with Timbro”If the original invoice was issued with another invoicing system or on paper, Timbro does not have its invoiceId. Send externalOriginal instead, with its number and issue date:
{ "fiscalNumber": "E310000000123", "issuedOn": "2026-08-14"}fiscalNumber can be an e-NCF or a paper NCF. If the original is a Consumer Invoice (E32), also send its total, because the DGII requires the buyer’s data on a note against a Consumer Invoice of RD$ 250,000.00 or more. In that case, send the original invoice’s buyer in externalOriginal.buyer. If the original was issued under another RNC, for example before a merger, send that RNC in issuerTaxId.
Replace a rejected invoice
Section titled “Replace a rejected invoice”If the API responds 422 and does not return an invoiceId, no invoice was created. Correct the fields the error points to and call invoices.create again.
If the DGII rejected the invoice (authorityRejected), or an administrator of the business closed it before it reached the DGII (closed), issue its replacement with invoices.replace. Send the rejected invoice’s invoiceId and the complete, already corrected request:
const replacement = await timbro.invoices.replace( "f35b7ae4-c484-4c63-981e-4f0f15e913b5", { invoiceReference: "sale-842-invoice-2", type: "E32", currency: "DOP", incomeType: "01", paymentTerms: { type: "immediate" }, items: [{ description: "Service", quantity: "1", unit: "unit", kind: "service", unitPrice: "1250.00", tax: { kind: "itbis_18", included: true }, }], },);replacement = timbro.invoices.replace( "f35b7ae4-c484-4c63-981e-4f0f15e913b5", { "invoiceReference": "sale-842-invoice-2", "type": "E32", "currency": "DOP", "incomeType": "01", "paymentTerms": {"type": "immediate"}, "items": [{ "description": "Service", "quantity": "1", "unit": "unit", "kind": "service", "unitPrice": "1250.00", "tax": {"kind": "itbis_18", "included": True}, }], },)The replacement has a new invoiceId and a new e-NCF, and replacesInvoiceId identifies the invoice it replaces. If you use source, keep its id and send a new version. If the response is lost, repeat the same request with the same invoiceReference to retrieve the same replacement. Some replacements need an authorization before they are issued; if that is the case, the API response says so.
A replacement is not a credit or debit note: it is for an invoice that was never accepted.