I have an integration for the purchase order, receipt, and invoicing process using a REST API. In this process, I first receive the item lines and then generate the invoice. I use the transform method for both receipt and invoicing. In the sandbox environment, everything works correctly, but in production, the invoice is created for the total quantity of items rather than just the received lines.