0

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

1 Answer 1

0

This is an accounting issue rather than an API issue. Double-entry rules mean that you need to attach a payment to something for example you can create an overpayment and then refund this by adding a payment visa the payments endpoint. You can code the line item of the overpayment to an appropriate balance sheet account but you would need to check with an accountant or tax advisor to make sure whatever you do follows good accounting practice

Sign up to request clarification or add additional context in comments.

2 Comments

Sally - you are right that it is an accounting issue - however in real life people can do this - so all I am trying to do is to find the way to mirror - in Xero - what the real life situation is ! To say you need to attach a payment to something is correct - I wish to attach it to the clients receivable account !! Then the accountant can deal with it as and when they get to it.....maybe I should just add it as a payment (not an AR payment) coded to a specific accounts code for this purpose - so it would sit outside the clients receivable account for dealing with down the line ?
Attaching it to a the contacts receivable account would typically involve using a prepayment transaction coded to a prepayment type account in the balance sheet. An accountant can advise further

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.