Commerce Invoicing 200-Line Posting Limit
Overview
Salesforce's Commerce Invoicing engine silently rejects invoice posting when an Invoice contains more than 200 InvoiceLine records. This is not a governor limit or a configurable threshold -- it is a hard constraint inside the managed billing engine. Neither the standard UI posting action nor the REST API can bypass it.
This article documents the evidence for this limit, the alternative approaches that were tested and ruled out, and the remaining options for orgs that need to post large invoices.
Commerce Invoicing 200-Line Posting Limit
When posting an Invoice from Draft to Posted status, Salesforce's Commerce Invoicing engine enforces an internal limit of 200 InvoiceLine records per invoice. Invoices at or below 200 lines post successfully. Invoices above 200 lines fail with:
record limit reached. cannot submit more than 200 records into this call
This limit is not documented in Salesforce's official governor limits or Commerce Invoicing documentation.
Evidence
Testing against multiple invoices confirms the boundary:
| Invoice | Line Count | Posting Result |
|---|---|---|
| DOC-000000370 | 200 | Posted successfully |
| DOC-000000375 | >200 | Failed |
| DOC-000000376 | >200 | Failed |
| DOC-000000377 | >200 | Failed |
| DOC-000000378 | >200 | Failed |
| DOC-000000396 | 219 | Failed (API test) |
The largest successfully posted invoice contained exactly 200 lines. Every invoice above 200 lines failed.
REST API Does Not Bypass the Limit
The Commerce Invoicing REST API endpoint (/commerce/invoicing/invoices/collection/actions/post) was tested as a potential workaround:
POST /services/data/v62.0/commerce/invoicing/invoices/collection/actions/post
Content-Type: application/json
{
"invoiceIds": ["3ttXXXXXXXXXXXXXXX"]
}
The API returns 202 Accepted and creates an AsyncOperationTracker record. However, the tracker resolves to CompletedWithFailures with the same error message. The REST API is a thin async wrapper around the same internal billing engine -- it does not use a different code path.
Approaches Investigated and Ruled Out
| # | Approach | Result | Reason |
|---|---|---|---|
| 1 | Collection API | Failed | Same internal engine, same limit |
| 2 | Sub-Invoice Consolidation | Not viable | Different billing framework; known platform issues |
| 3 | Invoice Splitting | Blocked | Business requirement: one invoice per order |
| 4 | Batch Size Configuration | No effect | Controls invoice generation batching, not posting |
| 5 | Batch Run Action | No effect | Batches invoices (plural), not invoice lines |
| 6 | Consecutive Batch Jobs | No effect | Addresses concurrency between invoices, not line count within one |
| 7 | Direct Status Update | Blocked | Invoice.Status is not updateable via DML |
| 8 | Custom Posting Logic | Extreme risk | Billing engine is opaque; bypassing it risks data integrity |
| 9 | Salesforce Support Case | Best option | Only path to an engine-level resolution |
Where the Limit Lives
The 200-record constraint is inside the managed InvoiceDraftToPostedAsyncMessageHandler -- the internal job that processes invoice posting. This handler processes all InvoiceLines in a single internal call. Because it is managed code (not customer-accessible Apex), the limit cannot be modified, overridden, or bypassed through configuration.
The AsyncOperationTracker record confirms the job type:
JobType: InvoiceDraftToPostedAsyncMessageHandler
Status: CompletedWithFailures
Viable Paths Forward
Option 1: Salesforce Support Escalation (Recommended)
File a support case with the following evidence:
- The specific error message and affected Invoice IDs
- Proof that the REST API produces the same result
- The
AsyncOperationTrackerrecords showing the failure - Business justification for why invoices need more than 200 lines
Request either a limit increase or confirmation that this is a permanent platform constraint.
Option 2: Business Process Redesign
If Salesforce confirms the limit is permanent, the business process must adapt. Options include:
- Linked invoices: Split one logical order across multiple invoices, linked by a custom grouping identifier. Downstream systems (ERP, AP) would need to handle grouped invoices.
- Line consolidation: Aggregate similar invoice lines before invoice generation to stay under 200. This sacrifices line-level detail.
Option 3: Monitor Future Releases
Commerce Invoicing is actively developed. Watch release notes (Summer '26+) for changes to the posting engine or configurable batch size settings.
Key Takeaways
- The 200-line invoice posting limit is an engine-level constraint, not a governor limit.
- The REST API uses the same internal engine and does not bypass the limit.
- No Apex workaround, configuration change, or API endpoint can resolve this.
- Salesforce Support escalation is the primary path forward.
- If the limit is permanent, business process changes (invoice splitting or line consolidation) are the only alternatives.