Updating rebilling invoice on timeslips and bank transaction explanations

Hi,

I have a bank transaction explanation (“Materials” category, not a standard expense) and that is marked for rebilling on a project. It has been paid for on a previous invoice, but that is not recorded in FreeAgent. I’ve tried linking it to the invoice using a PUT to the URL of the bank transaction explanation, including the “rebilled_on_invoice” field. This returns a 200 code, but the bank transaction explanation does not seem to be updated.

Similarly, I have timeslips for which I would like to set the “billed_on_invoice” field. if I try this using a PUT I get a 200 code, but they don’t seem to be updated.

Example code (Python, using the “requests” package):

session.put('https://api.freeagent.com/v2/bank_transaction_explanations/148094717', json={'bank_transaction_explanation':{'rebilled_on_invoice':'https://api.freeagent.com/v2/invoices/28151121'}})

session.put('https://api.freeagent.com/v2/timeslips/24243917', json={'timeslip':{'billed_on_invoice': 'https://api.freeagent.com/v2/invoices/28151121'}})

Double checking using curl…

curl https://api.freeagent.com/v2/timeslips/24243917 -H "Authorization: Bearer <redacted>" -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d '{"timeslip": {"billed_on_invoice": "https://api.freeagent.com/v2/invoices/28151121"}}'

What can I do to set these fields for payments and timeslips? Am I doing something wrong?

Best regards,
Adam

In the end I’ve had to delete and replace my timeslips so that there was exactly one per invoice item I wanted to raise, then re-do the invoices with those timeslips and the materials payment that was not properly linked before.