Skip to main content
Base gives you two ways to handle invoices: it can issue an invoice itself using its own numbering series, or it can accept a ready-made invoice issued by your external ERP or accounting system and attach it to an order. Both approaches are fully supported and can be mixed across different order sources.

Issuing an invoice in Base

addInvoice issues an invoice for an order using a chosen numbering series configured in your Base account.
The response returns 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, use addOrderInvoiceFile. It replaces the standard Base invoice with your own PDF (or XML, for countries where that’s required, such as Brazil).
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.
If you have complex numbering-series logic — different cost centers, countries, or VAT regimes — consider driving it via extra fields rather than hardcoded rules in your integration. Updating a rule then only requires a change in Base, not a code deployment.