Numbering
SendInvoiceNumber as "Next" with EInvoiceType 1 or 2 to generate it from the company’s e-Invoice numbering (a fixed prefix, the year and a 9-digit sequence). "Next" cannot be sent on update, and InvoiceNumber must be unique in the company among purchase return invoices.
Warehouse movement
Every line’s generated warehouse movement is outbound for a purchase return invoice (goods are sent back to the supplier, so stock decreases), soLots/SerialNumbers follow the outbound rules.
No real purchase return invoices exist yet in the data used to build this API, so the outbound direction of the generated warehouse movement is inferred from the inbound/outbound convention of the other invoice types, not directly verified. Report any discrepancy you find.
Customer ledger
A purchase return invoice’s customer ledger entry is a debit (it reverses the credit a purchase invoice would have created). If it has already been closed by a payment, the invoice’s customer, amount and currency can no longer be changed, and the invoice cannot be deleted (3016).