In this article (8 sections)
The context
Step: going live on Revenue Cloud Billing while invoices already exist elsewhere. Some are historical, some come from another system. They have to appear next to the invoices Revenue Cloud generates, so the customer view and the books are complete.
The problem
A Data Loader import of invoice rows fails: Invoice, InvoiceLine and BillingSchedule cannot be inserted by direct DML, meaning a plain record insert.
The first version of this article concluded that the platform refused any invoice creation. That was wrong. The limit applies to direct inserts, not to the API. Salesforce documents an Invoice Ingestion endpoint that ingests or generates an invoice from internal or external billing transaction data, and invoices can also be generated from an account or an order, not only from billing schedules.
The billing objects follow the same logic elsewhere: invoice status isn’t writable either, and posting goes through the standard post action. An invoice comes out of the billing engine through a defined path, never as a row someone writes. An import goes around that path, so it’s refused. The ingestion API is that path, opened to invoices produced elsewhere.
The solution
There are three supported paths.
Ingest them. The documented ingestion endpoint is built for exactly this: invoices produced elsewhere, brought in as invoices. It’s the first one to try.
Rebuild the upstream records so the engine produces the invoice itself. You get one consistent model, at the cost of inventing orders that never existed.
Keep them separate, in their own object, and bring only the accounting impact into Salesforce. Accurate, but there are two places to look.
Flow
Every box on the top row is a prerequisite that produces no error when it is missing: the schedules simply never appear. The order line is the other silent failure: it needs period boundary and billing frequency fields that are not surfaced as required, so a data import passes cleanly and nothing ever bills.
- Prerequisites — Billing context (extended + activated), Billing settings (context mapping), Billing defaults (entity, treatments)
- Source — OrderItem (with period fields)
- Engine — ScheduleGroup (BSGEntitiesMapping), BillingSchedule (never created by hand)
- Output — Invoice (draft, then posted), InvoiceLine (TaxCode stays empty), Ledger rule (insert-only criteria)
How to set it up
One question picks the path: will these invoices ever need to be amended inside Salesforce? If so, rebuild. If they are read-only history, ingest them or keep them separate, because the cost of rebuilding can’t be recovered.
Then read the ingestion input reference before writing anything. I haven’t yet run this endpoint on a project org, so the field-level detail comes from the documentation, not from a test.
Alternatives
The choice depends on what will happen to those invoices. For pure history, a read-only archive outside the billing objects usually wins: it costs far less than pushing that history through the engine. When the invoices have to live in billing, the documented ingestion API comes first. Rebuilding orders is for invoices that will have to be amended in Salesforce.
In practice
- Decide first whether these invoices will ever be amended. That picks the path.
- Try the documented ingestion API before rebuilding orders that never existed.
- Settle invoice numbering before the first posted invoice.
- Keep pure history in a read-only archive.