Issuing an invoice in Base
addInvoice issues an invoice for an order using a chosen numbering series configured in your Base account.
invoice_id, which you then use to download the file via getInvoiceFile or list invoices via getInvoices.
Replacing with an invoice from your ERP
If you issue invoices in your own ERP and don’t want to duplicate numbering across both systems, useaddOrderInvoiceFile. It replaces the standard Base invoice with your own PDF (or XML, for countries where that’s required, such as Brazil).
Recommended flow
When using an external ERP, follow these steps for each order:1
Issue the invoice in your ERP
Your ERP generates the invoice — producing both the invoice number and the PDF.
2
Create a placeholder invoice in Base
Call
addInvoice for the order. You just need a valid series_id — the number and VAT rate don’t matter much here since you’ll overwrite them in the next step.3
Attach your ERP invoice to Base
Call
addOrderInvoiceFile with the invoice_id from step 2, the PDF from your ERP (base64 with "data:" prefix), and external_invoice_number set to your real invoice number.4
Forward to the marketplace
Forwarding the invoice to the marketplace (where the integration supports it) is typically tied to a specific order status. This is configured per integration and runs in batches — not instantly. Timing follows the same pattern as tracking number delivery.