I've made some progress in working through the API and put together a proof of concept for how some bridging software could work.
Unfortunately, the HMRC sandbox is very limited and doesn't behave at all like the production system would work so understanding exactly how the API should be used is tricky.
If anyone wants to play with what I have so far it's here There are links to download all of the source - It's LAMP (but the P is Python instead of PHP
. Eventually my goal would be to have a self hosted solution (that wouldn't need either apache or mysql but I'm doing it like this for now because it's quicker to make progress on understanding the API.)
https://making-tax-difficult.uk/
Username is "mtd" and password is "access" (without the quotes)
(This is hosted on a low power vm with limited internet access so don't expect whizzy performance. Also there's a deliberate delay of 1 second before each request is made to hmrc.)
Only self-employment and uk-property both under self-assessment are (mostly) working. Everything else is "todo"
Quirks I've found so far:
For self employment if you have multiple businesses, you submit an annual income summary for each tax year for each business and you submit an end of period confirmation statement for each business.
For uk-property you have to submit the annual summary separately for FHL and "other" (non fhl) separately but the end of period confirmation statement is submitted for the property business, you cannot, and do not confirm the FHL and "other" separately.
The MTD obligations are also listed for the "property business" but the periodic updates are submitted for "other" and FHL separately. I'm not sure how the API is supposed to know whether an obligation has been met if someone has both FHL and "other".
If it had been me, I'd have made FHL and "other" synonymous with the self employment businesses where the obligations and confirmation statements are separate. (It would also have made coding to the API easier). I realise that the dates will be the same for both but it doesn't seem unreasonable for me that someone with both might be ready to submit one but waiting for the other. Most obviously, a FHL business might be completely quiescent during the winter months and so people might want to submit well ahead if the only costs are fixed costs.
Or perhaps the answer is that landlords without FHL have to submit an empty expenses for each quarter. The API sandbox returns canned data so it's not possible to "try and see"
oh, and just in case someone finds a security flaw that lets you run arbitrary SQL against the database (for example) then please let me know but there's absolutely nothing on the machine that is hosting this except test data.