Invoice
Set up invoicing
Before issuing invoices, the business needs its digital certificate and, to invoice Live, the e-NCF sequences the DGII granted it. An owner or administrator can import the certificate and record the sequences in Portal Timbro, or your system can do it with the API. If the business already completed these steps in Portal Timbro, go to Issue an invoice from your system.
These operations are under /v1/business and require an administrator key. Send the certificate and its password only from your server, and do not store them in logs.
Prepare Test mode
Section titled “Prepare Test mode”- Call
POST /v1/business/configure-invoicingwith{"mode":"test"}and an idempotency key (Idempotency-Key) that does not change between attempts. - Call
POST /v1/business/import-signing-certificatewith the certificate incertificateP12Base64and its password inpassword. The business has a single certificate, which Timbro uses in both modes. If you import another valid certificate, it replaces the previous one in both modes. - Call
POST /v1/business/issue-test-invoiceto issue the test invoice.documentTypeis optional.
Test invoices go to the DGII test environment and have no fiscal value. In Test mode you do not have to record e-NCF sequences, because Timbro assigns them.
Check which types you can issue
Section titled “Check which types you can issue”Read the business with GET /v1/business. capabilities.invoices.test.status and capabilities.invoices.live.status say whether each mode is active. Inside invoicing.test and invoicing.live, documentTypes has one entry per e-CF type:
- A
readytype can be issued, and itsnumberingshows how many numbers it has left and when the sequence expires. - An
actionRequiredtype lists inreasonswhat is missing, such assigning_certificate_missingorauthorization_missing, in the order you must resolve them.
The list is empty until you set up invoicing for that mode, and it is null when Timbro could not retrieve it at that moment. In that case, read the business again. Before offering a type in your system, check that it is ready.
Switch to Live mode
Section titled “Switch to Live mode”- Call
POST /v1/business/configure-invoicingwith{"mode":"live"}and its own idempotency key (Idempotency-Key) that stays the same across retries. The certificate you already imported also works Live. - Record each e-NCF sequence the DGII granted the business in its Oficina Virtual with
POST /v1/business/record-sequence. SenddocumentType,firstNumber,lastNumber, andexpiresOn. Consumer Invoice (E32) and credit note (E34) sequences do not expire, so they take noexpiresOn.nextNumberis optional and, if you do not send it, it equalsfirstNumber. - Read the business again. Live invoicing is
activewhen the certificate is valid and at least one type isready.
The record-sequence response is the complete business, so you can see right away whether the type is ready or what it still needs. While Live mode is not active, each requirements entry with mode: "live" says what is missing, such as the issuer profile, the certificate, the sequences, or the DGII confirmation, and which types it affects (documentTypes).
In Portal Timbro, the owner or an administrator can record the same sequences with a guide that explains how to request them from the DGII.
When a type is ready Live, create a Live API key with Invoicing access in Portal Timbro. That key gives access to the API, but it does not replace the certificate or the sequences.