Hi again @captgiro,
Thanks a lot for your patience while I was investigating the problems you encountered with creating journal entries in certain accounting categories
You should be able to successfully create journal entries in most categories with codes over 600 by including the base code in the category
uri (e.g. the VAT category would be represented as "category":"https://api.freeagent.com/v2/categories/817"
in your request body). When you need to post an entry to a category with a sub-account, rather than include the sub-code in the uri, our API expects you to specify the linked resource separately (see documentation for additional journal entry attributes here). For example, when posting to one of the user categories (900-910
), your payload should include the following:
"category":"https://api.freeagent.com/v2/categories/{base code}",
"user":"https://api.freeagent.com/v2/users/{user id}",
FreeAgent will then infer the correct sub-account code for the user you specified in your request.
The exception to this would be capital asset categories which require a sub-code (601-607
). As far as I can tell, and for reasons now deeply buried in our git history, support for passing in a sub-code for those has never been implemented. I’ve opened an issue report to document this problem, which is currently being triaged by our Engineers. Thank you very much for taking the time to highlight this issue and, as soon as I have an update, I’ll make sure to let you know on this thread.
All best,
Ewa