Skip to content
Shop integration & processes

Partial Deliveries and Part Invoices in the B2B Shop

Partial deliveries and part invoices between shop, middleware and ERP: data model, open quantity, document references and the fields of the electronic invoice.

15 min read TeillieferungTeilrechnungAuftragsabwicklungERP-AnbindungB2B

A wholesaler confirms an order with twelve line items. Eight of them are in stock, three arrive from the manufacturer in fourteen days, one has been discontinued. The shipment goes out today anyway, because the customer needs those eight items. From that moment on there is no longer a single document but a chain: two delivery notes, at least two invoices, an open quantity that has to be tracked somewhere, and a customer account that is supposed to show both together. This article describes how that chain is built between shop, middleware and ERP system, which fields the electronic invoice provides for it, and how you can tell that the mapping holds. Anyone connecting ERP and shop in wholesale decides at this point whether the online channel produces documents or produces queries.

Key takeaways

  • A partial delivery is not a malfunction but an agreement: without the buyer's consent the obligor is not entitled to render part performance (Federal Ministry of Justice).
  • For VAT purposes the tax arises per part performance as soon as the consideration for a part of an economically divisible supply has been agreed separately (Federal Ministry of Justice) - the document chain follows the agreement, not the conveyor belt.
  • The European invoicing standard treats the part invoice as a document type of its own: code 326 in field BT-3 (KoSIT), while the code list also carries 386 for the prepayment invoice (OpenPeppol).
  • An invoice may name any number of preceding invoices (BG-3, cardinality 0..*), but only a single despatch advice at header level (BT-16, cardinality 0..1) (KoSIT) - invoicing per delivery note avoids that constraint.
  • The open quantity per order line is the key value: it belongs in the middleware, is derived from delivery events and makes double invoicing visible.
  • The final invoice deducts part payments received earlier where invoices were issued for them (Federal Ministry of Justice).

Why one order splits into several documents

In business-to-business trade the complete delivery of an order is the normal case, but not the only one. An order splits as soon as one line item cannot travel with the rest: one article is on order, a second sits in a different warehouse, a third is batch-managed and waiting for quality assurance to release it. The decision to ship anyway is taken in order processing and is usually the commercially correct one - the customer needs the eight items that are available, not the wait for the ninth. Technically the work begins at exactly that moment, because from here on every document carries only a section of the order.

The shop initially notices none of this. It has created an order, sent an order confirmation and is waiting for status messages. Whether one delivery or three come out of it is decided by the ERP system. As long as the interface only knows the state "shipped", the customer account tips into a half-truth with the first partial shipment: the order looks completed although four line items are still open. Anyone mirroring live order status from the ERP needs a data model that permits several deliveries and several invoices per order - and needs it before the first partial shipment happens, not afterwards.

Availability and inbound stock

The most frequent trigger: part of the order is in stock, the rest comes from the manufacturer. The middleware therefore has to keep the order as a header with line items whose quantities move independently of one another.

Logistics and pack sizes

Bulky goods, dangerous goods and temperature-controlled items leave the building separately. Even a single order spreads across two shipments when weight limits or shipping methods require it.

Commercial reasons

An exhausted credit limit, prepayment for a partial amount or an approval in the customer's purchasing department push part of the order back. The reason belongs on the delivery as a field so that the credit limit check in the checkout remains traceable later.

A partial delivery is an agreement, not a malfunction

The German Civil Code sets out the starting point plainly: the obligor is not entitled to render part performance (Federal Ministry of Justice). A partial delivery is therefore not a supplier's right but something that is agreed - in the framework contract, in the terms of sale or in the individual order. For the interface this means: the permission is a data item, not a gut feeling. A field on the order header, pre-filled from the customer master record and overridable in the checkout, is the technical equivalent of that agreement. Without it, order processing decides every case anew, and the decision cannot be reconstructed afterwards.

For VAT purposes more than logistics hangs on the same agreement. Where the tax is calculated on agreed consideration, it arises at the end of the pre-registration period in which the supplies were carried out; this also applies to part performances, which exist where the consideration for particular parts of an economically divisible supply is agreed separately (Federal Ministry of Justice). Whether a partial delivery is a part performance in that sense is therefore decided by the consideration agreement and not by the packing slip. Commercial law adds that the buyer has to examine the goods without undue delay after delivery by the seller, so far as this is practicable in the ordinary course of business (Federal Ministry of Justice) - with two deliveries there are two notification periods, and the customer needs a separate delivery note per shipment in order to keep them.

The permission belongs on the order header

A single field saves a lot of clarification later: partial_delivery_allowed with the values yes, no and on_request, pre-filled from the customer master record in the ERP, visible in the checkout and stored with the order. If it says no, the ERP system blocks the partial shipment and the shop states the lead time of the slowest line item as the date for the whole order. If it says yes, the later document chain is covered by the customer - and documented in the middleware.

The document chain and its references

One order with two deliveries quickly becomes six documents: order confirmation, two delivery notes, two invoices and - if a payment on account was involved - a final invoice that deducts the part payment again. Each of these documents is complete in itself and still carries a reference to its predecessor. Those references are the actual subject of the integration work; without them the recipient has six documents and no chain.

The references run in two directions. Downwards, every document points to the order it came from and to the order line it serves. Backwards, every invoice points to the delivery note it settles, and the final invoice additionally to all part invoices that preceded it. Anyone keeping the chain in the middleware can answer the question that counts in a dispute: which quantity of which line item was delivered when, and with which document was it invoiced? The document data from the ERP system supplies the values, the middleware holds the connections.

  • Order confirmation - names the order number, all line items with the quantity ordered and the confirmed delivery date per line item, not just one date for the entire order.
  • Delivery note per shipment - carries order number, line number, delivered quantity and the remaining open quantity. Only the open quantity makes the document usable for the customer's goods receipt.
  • Part invoice per delivery - settles exactly the quantities of one delivery note and names it. This is the standard case where delivery and invoice run in the same rhythm.
  • Collective invoice across several deliveries - bundles several delivery notes from one period. It needs an invoicing period and, per line, the reference to the delivery the quantity came from.
  • Final invoice - closes the order and deducts part payments received for which invoices have already been issued (Federal Ministry of Justice).
  • Cancellation and correction - every correction refers to the corrected document; in the RMA process for returns the credit note depends on it.

What the electronic invoice provides for this

The European standard for the electronic invoice knows the case. Field BT-3 carries the code for the invoice type, and the German CIUS XRechnung names eight codes from code list UNTDID 1001 that should be transmitted there: 326 for the part invoice, 380 for the commercial invoice, 384 for the corrected invoice, 389 for the self-billed invoice, 381 for the credit note as well as 875, 876 and 877 for partial and final construction invoices (KoSIT). The code list itself additionally carries 386 for the prepayment invoice (OpenPeppol). Anyone sending a part invoice as 380 loses a piece of information the recipient could have used for mapping.

Two cardinalities are decisive for the chain. The group BG-3 with the reference to the preceding invoice may occur any number of times (0..*) and carries per occurrence the identifier of the preceding invoice in BT-25 and optionally its issue date in BT-26 (KoSIT). A final invoice can therefore name every part invoice that preceded it. The identifier for a referenced despatch advice in BT-16, by contrast, occurs at most once (0..1), as does the actual delivery date in BT-72 (KoSIT). At header level exactly one delivery can be named - a collective invoice covering three delivery notes does not fit in there.

part-invoice-ubl.xml
<Invoice>
  <cbc:ID>RE-2026-04417</cbc:ID>
  <cbc:IssueDate>2026-09-14</cbc:IssueDate>
  <cbc:InvoiceTypeCode>326</cbc:InvoiceTypeCode>
  <cac:OrderReference>
    <cbc:ID>AB-4711</cbc:ID>
  </cac:OrderReference>
  <cac:DespatchDocumentReference>
    <cbc:ID>LS-2026-08810</cbc:ID>
  </cac:DespatchDocumentReference>
  <cac:Delivery>
    <cbc:ActualDeliveryDate>2026-09-10</cbc:ActualDeliveryDate>
  </cac:Delivery>
  <cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:InvoicedQuantity unitCode="H87">8</cbc:InvoicedQuantity>
    <cac:OrderLineReference>
      <cbc:LineID>10</cbc:LineID>
    </cac:OrderLineReference>
  </cac:InvoiceLine>
</Invoice>

The excerpt shows the places where the mapping hangs: the order number as a bracket around everything, the despatch advice identifier as the reference to the delivery note, the actual delivery date as the point in time of the supply and the order line number per invoice line. German VAT law requires the invoice to state the point in time of the supply or other service anyway (Federal Ministry of Justice); with two partial deliveries those are two different points in time in two different invoices. Anyone issuing both invoices with the date of the second shipment has formally damaged the document. Which deadlines apply from 2027 is covered in the article on the electronic invoicing mandate.

A collective invoice needs the line level

At header level the electronic invoice permits only one despatch advice and one delivery date (KoSIT). Anyone bundling several deliveries into one invoice therefore moves the mapping into the invoice line: group BG-26 carries the start and end date of the invoicing period per line in BT-134 and BT-135, and the invoice header receives the invoicing period across all lines in BG-14 with BT-73 and BT-74 (KoSIT). Without those fields the document states a total whose origin the recipient has to guess.

The data model in the middleware

Shop and ERP system have different notions of what an order is. In the shop it is a basket that has been paid for or released. In the ERP system it is a header with line items carrying quantities in several states: ordered, planned, picked, delivered, invoiced. The middleware translates between the two, and it does so most reliably when it keeps the ERP-side state and supplies the shop with a simplified view of it - not the other way round.

The structure is manageable: one order, below it line items, below each line item a list of delivery events and a list of invoicing events. Every event carries quantity, date, document number and the identifier from the source system. From that list every question can be answered without maintaining a second state: the delivered quantity is the sum of the delivery events, the invoiced quantity the sum of the invoicing events, the open quantity the difference to the ordered quantity. Anyone additionally storing and updating those values as separate fields ends up with three truths and a reconciliation job. An interface with clean domain logic calculates them from the event list instead.

order-partial-deliveries.json
{
  "order_no": "AB-4711",
  "partial_delivery_allowed": "yes",
  "lines": [
    {
      "line_no": 10,
      "sku": "40-2517-KH25",
      "qty_ordered": 12,
      "deliveries": [
        { "doc": "LS-2026-08810", "qty": 8, "date": "2026-09-10" },
        { "doc": "LS-2026-09004", "qty": 4, "date": "2026-09-24" }
      ],
      "invoices": [
        { "doc": "RE-2026-04417", "qty": 8, "type_code": "326", "refers_to": "LS-2026-08810" },
        { "doc": "RE-2026-04620", "qty": 4, "type_code": "380", "refers_to": "LS-2026-09004" }
      ]
    }
  ]
}
Terminal
$ curl -s '/api/orders/AB-4711/open-quantities' | jq '.lines[]'
{ "line_no": 10, "qty_ordered": 12, "qty_delivered": 12, "qty_invoiced": 12, "qty_open": 0 }
$ curl -s '/api/orders/AB-4711/consistency' | jq
{ "deliveries": 2, "invoices": 2, "unbilled_deliveries": [], "invoiced_without_delivery": [], "status": "closed" }

The open quantity is the key value

In practice the expensive mistakes do not arise with the first partial shipment but with the second. A line item is invoiced twice because the part invoice from the ERP and the invoice from the shop process both draw on the same quantity. An open quantity is left lying because the order in the shop jumped to "completed" after the first delivery. Or a follow-up delivery is shipped although the customer cancelled the open quantity long ago. All three cases have the same cause: there is more than one place where the open quantity is kept. Every inventory synchronisation across several warehouses knows the same pattern.

  1. The ordered quantity per line item is fixed when the order is created and changed afterwards only through a documented order change.
  2. The delivered quantity is derived exclusively from delivery events in the ERP, not from the shipping status of a logistics provider.
  3. The invoiced quantity is derived exclusively from invoicing events, and every invoicing event names the delivery note it settles.
  4. The open quantity is calculated and not stored: ordered quantity minus delivered quantity, per line item.
  5. An invoice without a matching delivery event, and a delivery event without an invoice after a defined period, are findings that belong in a report - not in a log nobody reads.
  6. If the customer cancels the open quantity, a separate event with reason and timestamp is created; the ordered quantity remains unchanged.

Two figures that have to match

The sum of delivered quantities and the sum of invoiced quantities are two independently created figures per order line. If they agree and the open quantity is zero, the order is complete. If they diverge, either a delivery has no invoice or an invoice has no delivery. This check carries the same idea as the reconciliation of payments and documents: two separately maintained data sets that verify one another find errors that a single data set hides.

Payment on account, part invoice, final invoice

With orders that have long lead times a second case is added: the payment on account. It is not a partial delivery but a part payment received before the supply. German VAT law regulates the closing explicitly: where a final invoice is issued, the part payments received before the supply or other service was carried out and the tax amounts attributable to them are to be deducted in it, provided invoices were issued for those part payments (Federal Ministry of Justice). For the interface this means the final invoice needs the list of payment-on-account invoices with net amount and tax amount, not just a total.

Technically this is exactly the case for which BG-3 may occur repeatedly. The final invoice names every preceding invoice in BT-25 and its issue date in BT-26 (KoSIT) and deducts the already invoiced part amounts in separate lines. The deadline for invoicing runs independently of the document type: for a supply to another business for that business's enterprise the invoice has to be issued within six months of the supply being carried out, provided the transaction is not exempt under Section 4 numbers 8 to 29 of the German VAT Act (Federal Ministry of Justice). Anyone collecting part invoices in order to combine them into a final invoice later should have that deadline in the calendar of stocktaking and year-end tasks.

Document situationWhat the customer receivesWhat the interface has to supply
Complete deliveryOne delivery note, one invoiceOrder number and line reference per invoice line
Two partial deliveries, one invoice eachTwo delivery notes, two invoicesPer invoice code 326 or 380 and the reference to the delivery note
Several deliveries, one collective invoiceSeveral delivery notes, one invoiceInvoicing period in the header and per line (BG-14, BG-26)
Payment on account and final invoiceInvoice on account, then final invoiceAll preceding invoices in BG-3 with amount and tax amount
Partial cancellation of the open quantityConfirmation of the cancellationEvent with reason and timestamp, ordered quantity stays documented
Return from a partial deliveryCredit note with referenceReference to the corrected invoice and the delivery note

What the customer has to see in the account

The document chain is only finished once it arrives in the customer account. An order shown as partially delivered needs three pieces of information at a glance: which line items were delivered in which quantity, which quantity is open and which date applies to the rest. The state of the whole order is secondary here - the buyer wants to know whether their line item was included, not whether the order counts as completed in a statistic. A progress bar per line item says more about that than a status word per order.

Access to the documents themselves belongs with it. Every delivery note and every invoice sits in the account as a file, sorted by date and grouped per order. The relationship is made visible, not assumed: the invoice names the delivery note it settles, and the delivery note names the invoice as soon as it exists. Anyone who has already connected shipping and logistics interfaces attaches the tracking to the delivery event and not to the order - with two shipments there are two numbers, and storing one of them in the order header costs a query later.

Accounting, allocation and retention

In accounting the chain meets the payment. Two part invoices can arrive in one transfer, one part invoice in two instalments, and the payment reference occasionally names the order number instead of the invoice number. The allocation succeeds when both numbers appear in the document and the interface to accounting passes the order reference along with each invoice. For the handover to financial accounting the tax point per document also counts: with part performances the tax arises per part performance and not only at the end of the order (Federal Ministry of Justice).

On the retention side, different periods hang on the chain. The business has to retain a copy of the invoice it issued as well as all invoices it received for eight years (Federal Ministry of Justice); the Fiscal Code names the same period for accounting vouchers unless other tax laws allow shorter retention periods. For received delivery notes that are not accounting vouchers, by contrast, the retention period ends when the invoice is received (Federal Ministry of Justice). Anyone filing delivery notes and invoices in the same archive and treating them identically either keeps too much or too little; which file may disappear when belongs in the deletion concept across system boundaries.

The obligor is not entitled to render part performance.

German Civil Code, Section 266 (Federal Ministry of Justice)

How to tell that the chain holds

Partial delivery logic can be tested without waiting for the next shortage. The test case stays the same: an order with several line items, one delivery covering part of the quantities, an invoice for it, then the second delivery and the final invoice. What matters is that the check starts at the documents and not at the status fields - a status field says what a system believes, a document says what it has issued.

  • The sum of invoiced quantities per line item matches the sum of delivered quantities, and both match the ordered quantity.
  • Every invoice names exactly one delivery note or - in a collective invoice - the invoicing period per line.
  • Every invoice carries a document type code that fits the document kind, and the final invoice names all preceding invoices.
  • The delivery date in the invoice is the date of the associated delivery, not the creation date of the document.
  • The customer account shows the open quantity per line item and separate tracking per shipment.
  • An order with an open quantity cannot be set to the completed state as long as no cancellation event exists.

Partial deliveries are not an edge case to be caught up with in the next release but the normal operation of an assortment with inbound stock. Whether the online channel grows on that or produces queries is decided in three places: a data model that permits several deliveries and invoices per order, documents that name one another, and a customer account that shows the open quantity. We build this chain into existing systems - from connecting to SAP through the middleware to the electronic invoice - and we test it against real documents instead of status fields. An overview of the individual building blocks is available on the page about our services.

Sources and regulations

This article is based on data from: the German Civil Code (Section 266), the German VAT Act (Sections 13, 14, 14b and 27), the German Commercial Code (Section 377) and the German Fiscal Code (Section 147) in the version published on the portal of the Federal Ministry of Justice, the specification Standard XRechnung, CIUS and Extension in version 3.0.2 issued by the German Coordination Office for IT Standards (KoSIT), and the code list UNTDID 1001 in the documentation of OpenPeppol. All figures stated refer to the status of the respective publication.

Related Articles

Shop integration & processes

Live Order Status from Your ERP in the B2B Account

Show picking, partial delivery and invoice status live from your ERP in the B2B customer account: build the status return channel without a new data silo.

12 min read
ERP & merchandise management

Units of Measure and Pack Sizes from ERP to Your Shop

Separate base, stock, selling and purchase units, pull conversion factors from the ERP, and map stock, minimum quantities and unit prices correctly.

13 min read
ERP & merchandise management

Multi-Entity ERP: Running One Shop Across Company Codes

Corporate groups running several ERP entities and one shop: item routing, number ranges, tax codes, stock aggregation and order splitting done properly.

13 min read