I am trying to add a repayment to a client which does not match to any existing invoice, credit or prepayment (weird I know but its what my customer is asking for - it will get journalled off later on !) - the closest I have got is to try adding a Bank Transaction as this :
{'BankTransactions': [{'Type': 'RECEIVE-PREPAYMENT', 'BankAccount': {'AccountID': 'e12ec8b0-4a25-47d9-88e6-9e02e62c2d1f'}, 'Contact': {'ContactID': '49445ede-1278-4f58-b3aa-0480236a95d2'}, 'LineItems': [{'Description': 'Payment refunded to card on job 110765', 'Quantity': 1, 'AccountCode': '620', 'UnitAmount': -375.31, 'TaxType': 'NONE', 'LineAmount': -375.31}], 'Date': '2023-12-07', 'Reference': 'Job No : 110765'}]}
But of course Xero barfs at the negative value - and adding as a + value is the wrong way round in the bank account and on the clients account too !
If I try to SPEND-PREPAYMENT this ends up on the Accounts Payable ledger which is not where I want this to go !
Has anyone managed such a feat in the Xero API land ? The documentation seems obtuse to say the least around this area....
Note I have tried this as a PAYMENTS entry as well but it always seems to require a prior transaction to enter a payment against so I simply get the dreaded 'Document not found' error trying to enter as a payment