# Online documentation

**URL:** <https://api-discuss.freeagent.com/t/online-documentation/438>\
**Category:** Uncategorized\
**Created:** [18 June 2013 04:36 UTC](https://api-discuss.freeagent.com/t/online-documentation/438 "2013-06-18T04:36:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://api-discuss.freeagent.com/u/ben)\
**Post date:** [18 June 2013 04:36 UTC](https://api-discuss.freeagent.com/t/online-documentation/438/1 "2013-06-18T04:36:20Z")

</div>

Hi,\*\*\*\*

* * *

I’m working on some Haskell bindings to freeagent and as part of this I’ve  
been experimenting with auto generating the Haskell types from the json  
embedded in your online documentation (quite a fun little project).\*\*\*\*

* * *

I’ve run into a little problem, in that the responses I get have different  
fields to those documented. For example, the response for company (  
[https://dev.freeagent.com/docs/company](https://dev.freeagent.com/docs/company)) has 4 extra fields in addition to  
the 12 mentioned in the documentation. (I can’t remember what they are  
offhand and I haven’t pushed my code to github yet, sorry). I’d also  
comment that there are quite a few fields that seem to be encoded as  
strings which actually look more like numbers e.g. current\_balance on bank  
accounts.\*\*\*\*

* * *

I have a plan to work around this, but I thought I’d let you know. I’ll  
ping you again when I’ve got the project into a usable state - unless  
you’ve got any Haskell hackers working there who’s like to join in J?\*\*\*\*

* * *

Thanks,\*\*\*\*

Ben Ford

---

<div class="post-metadata">

**Author:** ![ben](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://api-discuss.freeagent.com/u/ben)\
**Post date:** [18 June 2013 11:14 UTC](https://api-discuss.freeagent.com/t/online-documentation/438/2 "2013-06-18T11:14:19Z")

</div>

Hi Jonathan,

I was getting quite a few errors with my old approach. One example is:

{  
“company”: {  
“company\_registration\_number”: “xxx”,  
“company\_start\_date”: “2013-03-19”,  
“currency”: “GBP”,  
“first\_accounting\_year\_end”: “2014-03-31”,  
“freeagent\_start\_date”: “2013-03-19”,  
“mileage\_units”: “miles”,  
“name”: “xxxx”,  
“sales\_tax\_is\_value\_added”: true,  
“sales\_tax\_name”: “VAT”,  
“sales\_tax\_rates”: [  
“0.0”,  
“5.0”,  
“15.0”,  
“17.5”,  
“20.0”  
],  
“sales\_tax\_registration\_number”: “xxxx”,  
“sales\_tax\_registration\_status”: “Registered”,  
“subdomain”: “xxxx”,  
“supports\_auto\_sales\_tax\_on\_purchases”: true,  
“type”: “UkLimitedCompany”,  
“url”: “[https://api.freeagent.com/v2/company](https://api.freeagent.com/v2/company)”  
}  
}

This has 4 extra fields (“sales\_tax\_name”,  
“support\_auto\_sales\_tax\_on\_purchases”, “sales\_tax\_is\_value\_added” and  
“sales\_tax\_rates”) compared to the online docs of:

{ “company”:  
{  
“url”:“[https://api.freeagent.com/v2/company](https://api.freeagent.com/v2/company)”,  
“name”:“My Company”,  
“subdomain”:“mycompany”,  
“type”:“UkLimitedCompany”,  
“currency”:“GBP”,  
“mileage\_units”:“miles”,  
“company\_start\_date”:“2010-05-01”,  
“freeagent\_start\_date”:“2010-05-01”,  
“first\_accounting\_year\_end”:“2011-05-01”,  
“company\_registration\_number”:“123456”,  
“sales\_tax\_registration\_status”:“Registered”,  
“sales\_tax\_registration\_number”:“123456”  
}}

I had a few other errors which I seem to have mitigated now by using a  
different approach to generating my types. I’ll be adding a test suite for  
the generated types now that they compile and I will let you know if there  
are any that are a bit off.

The other issue is that of fields that are encoded as strings that look  
like they really should be numbers. There are quite a few of these, off the  
top of my head:

bank\_account: current\_balance, opening\_balance  
bill : most fields  
expenses : most fields

It’s not a huge deal as I can write some code to fix this as and when I  
need to now that my types have been generated, but I thought I’d let you  
know.

Thanks,  
BenOn Tuesday, June 18, 2013 9:49:18 AM UTC+1, Jonathan Barrett wrote:

> Hi Ben,
> 
> Thanks for the feedback. If you can let me know what fields you’re seeing,  
> I’ll take a look and see if the documentation needs to be updated or  
> clarified.
> 
> Cheers,
> 
> -J
> 
> On Tuesday, 18 June 2013 05:36:20 UTC+1, [b...@perurbis.com](mailto:b...@perurbis.com) wrote:
> 
> > Hi,\*\*\*\*
> > 
> > * * *
> > 
> > I’m working on some Haskell bindings to freeagent and as part of this  
> > I’ve been experimenting with auto generating the Haskell types from the  
> > json embedded in your online documentation (quite a fun little project).\*
> > 
> > * * *
> > 
> > * * *
> > 
> > I’ve run into a little problem, in that the responses I get have  
> > different fields to those documented. For example, the response for company  
> > ([FreeAgent Developer Dashboard](https://dev.freeagent.com/docs/company)) has 4 extra fields in addition  
> > to the 12 mentioned in the documentation. (I can’t remember what they are  
> > offhand and I haven’t pushed my code to github yet, sorry). I’d also  
> > comment that there are quite a few fields that seem to be encoded as  
> > strings which actually look more like numbers e.g. current\_balance on bank  
> > accounts.\*\*\*\*
> > 
> > * * *
> > 
> > I have a plan to work around this, but I thought I’d let you know. I’ll  
> > ping you again when I’ve got the project into a usable state - unless  
> > you’ve got any Haskell hackers working there who’s like to join in J?\*\*\*\*
> > 
> > * * *
> > 
> > Thanks,\*\*\*\*
> > 
> > Ben Ford

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [18 June 2013 08:49 UTC](https://api-discuss.freeagent.com/t/online-documentation/438/3 "2013-06-18T08:49:18Z")

</div>

Hi Ben,

Thanks for the feedback. If you can let me know what fields you’re seeing,  
I’ll take a look and see if the documentation needs to be updated or  
clarified.

Cheers,

-JOn Tuesday, 18 June 2013 05:36:20 UTC+1, [b...@perurbis.com](mailto:b...@perurbis.com) wrote:

> Hi,\*\*\*\*
> 
> * * *
> 
> I’m working on some Haskell bindings to freeagent and as part of this I’ve  
> been experimenting with auto generating the Haskell types from the json  
> embedded in your online documentation (quite a fun little project).\*\*\*\*
> 
> * * *
> 
> I’ve run into a little problem, in that the responses I get have different  
> fields to those documented. For example, the response for company (  
> [FreeAgent Developer Dashboard](https://dev.freeagent.com/docs/company)) has 4 extra fields in addition to  
> the 12 mentioned in the documentation. (I can’t remember what they are  
> offhand and I haven’t pushed my code to github yet, sorry). I’d also  
> comment that there are quite a few fields that seem to be encoded as  
> strings which actually look more like numbers e.g. current\_balance on bank  
> accounts.\*\*\*\*
> 
> * * *
> 
> I have a plan to work around this, but I thought I’d let you know. I’ll  
> ping you again when I’ve got the project into a usable state - unless  
> you’ve got any Haskell hackers working there who’s like to join in J?\*\*\*\*
> 
> * * *
> 
> Thanks,\*\*\*\*
> 
> Ben Ford
