I am trying to update an Invoice in XERO by using the XERO-API. I am able to save the invoice as 'Draft' which is an outstanding amount that the customer to pay. When the payment is done, I want to send a request to the Xero and want to change the status to 'PAID'; amountDue = '$ 0.00' and AmountPaid = '$XX.xx'. I am not able to update this info and I am working on PHP. There is not much discussion/ research on this either.
$refXero = 'INV-123456';
$invoices = $xero->loadByGUID('Accounting\\Invoice', $refXero );
**//I am getting errors from here onwards:-**
$invoices->setAmountDue('0');
$invoices->setAmountPaid('50.00');
$invoices->setStatus('PAID');
$invoices->setDate('2019-10-15');
$invoices->save();
The error I am getting is 'Call to undefined method XeroPHP\Models\Accounting\Invoice::setAmountDue()'
How can I send this info and update this.
Thanks