Actually impossible to solve. Could be just an approximation. ...Or make second call, calculated difference and make third call to update the invoice by adding an invoice detail with the difference.