XERO API, Update payment amount

322 views Asked by At

I need to create note for an invoice on XERO using XERO API, however, it seems that this functionality is not yet available. So my next solution is to set the amount of a payment into $0.00. My problem is that xero api returns a validation error but no additional detail.

if (payment != null && payment.Status != PaymentStatus.Deleted)
 {
     api.Payments.Update(new Payment { Id = payment.Id, Amount =  0 });
 }

It seems that only payment that you want to delete is being updated.

api.Payments.Update(new Payment { Id = payment.Id, Status = PaymentStatus.Deleted });

any suggestions or advise?

1

There are 1 answers

0
Adam Moore On

Payments in Xero can't be updated. You can only delete them and redo them.

This is true in both the web app and the API.

If you're trying to add a note I'd recommend adding a description--only line item to the invoice