Missing fields from Expenses GET

Hi,

I mentioned this a while back but I’m still getting missing data from the
JSON response to a GET to https://api.freeagent.com/v2/expenses

For example, from the documentation I expect to get back

{
“expenses”:[
{
“path”:“https://api.freeagent.com/v2/expenses/1”,
“user”:“https://api.freeagent.com/v2/users/1”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2011-08-24”,
“gross_value”:"-12.0",
“sales_tax_rate”:“20.0”,
“description”:“Some description”,
“manual_sales_tax_amount”:“0.12”,
“updated_at”:“2011-08-24T08:10:40Z”,
“created_at”:“2011-08-24T08:10:40Z”,
}
]
}

but I really get back (with no sales_tax_rate field, the path field has
turned into url). I didn’t set a manual tax amount through the GUI in the
example below and 0.04 (the default?) isn’t the correct value (it should be
0.20 in this example), so I can’t calculate the sales tax rate.

{
“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/…”,
“user”:“https://api.freeagent.com/v2/users/…”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2012-01-04”,
“gross_value”:"-4.35",
“manual_sales_tax_amount”:“0.04”,
“description”:“Subsistence”,
“receipt_reference”:“03572500032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
} …

Any ideas? This is a blocker for me app :frowning:

Cheers,
Toby

I think path was from an old version of the api (ie v2 beta 0) and the
docs never got updated. I had the same issue half way thru my API
client development, but on the up side: all the (server side) models
are now the same, so it’s URL everywhere.

(this is being used for mobileAgent, but it should work for anything
which uses C#/.NET/Mono/MonoTouch/MonoForAndroid etc)

And, I’m pretty sure that the sales tax rate never comes back - you
only get back what the values was calculated to be, based on the rate
(or, if you submit, don’t provide one and it’ll work it out for you)

Graeme should know tho :)On Tue, Oct 23, 2012 at 8:33 AM, Toby toby.weston@gmail.com wrote:

Has anyone else seen this?

On Friday, 19 October 2012 17:00:07 UTC+1, Toby wrote:

Hi,

I mentioned this a while back but I’m still getting missing data from the
JSON response to a GET to https://api.freeagent.com/v2/expenses

For example, from the documentation I expect to get back

{
“expenses”:[
{
“path”:“https://api.freeagent.com/v2/expenses/1”,
“user”:“https://api.freeagent.com/v2/users/1”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2011-08-24”,
“gross_value”:“-12.0”,
“sales_tax_rate”:“20.0”,
“description”:“Some description”,
“manual_sales_tax_amount”:“0.12”,
“updated_at”:“2011-08-24T08:10:40Z”,
“created_at”:“2011-08-24T08:10:40Z”,
}
]
}

but I really get back (with no sales_tax_rate field, the path field has
turned into url). I didn’t set a manual tax amount through the GUI in the
example below and 0.04 (the default?) isn’t the correct value (it should be
0.20 in this example), so I can’t calculate the sales tax rate.

{
“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/…”,
“user”:“https://api.freeagent.com/v2/users/…”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2012-01-04”,
“gross_value”:“-4.35”,
“manual_sales_tax_amount”:“0.04”,
“description”:“Subsistence”,
“receipt_reference”:“03572500032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
} …

Any ideas? This is a blocker for me app :frowning:

Cheers,
Toby


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To view this discussion on the web visit
https://groups.google.com/d/msg/freeagent_api/-/2uksW-wy_4cJ.

To post to this group, send email to freeagent_api@googlegroups.com.
To unsubscribe from this group, send email to
freeagent_api+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/freeagent_api?hl=en.

Nic Wise
t. +44 7788 592 806 | @fastchicken | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2

Has anyone else seen this?On Friday, 19 October 2012 17:00:07 UTC+1, Toby wrote:

Hi,

I mentioned this a while back but I’m still getting missing data from the
JSON response to a GET to https://api.freeagent.com/v2/expenses

For example, from the documentation I expect to get back

{
“expenses”:[
{
“path”:“https://api.freeagent.com/v2/expenses/1”,
“user”:“https://api.freeagent.com/v2/users/1”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2011-08-24”,
“gross_value”:“-12.0”,
“sales_tax_rate”:“20.0”,
“description”:“Some description”,
“manual_sales_tax_amount”:“0.12”,
“updated_at”:“2011-08-24T08:10:40Z”,
“created_at”:“2011-08-24T08:10:40Z”,
}
]
}

but I really get back (with no sales_tax_rate field, the path field has
turned into url). I didn’t set a manual tax amount through the GUI in the
example below and 0.04 (the default?) isn’t the correct value (it should be
0.20 in this example), so I can’t calculate the sales tax rate.

{
“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/…”,
“user”:“https://api.freeagent.com/v2/users/…”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2012-01-04”,
“gross_value”:“-4.35”,
“manual_sales_tax_amount”:“0.04”,
“description”:“Subsistence”,
“receipt_reference”:“03572500032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
} …

Any ideas? This is a blocker for me app :frowning:

Cheers,
Toby

Thanks for the reply and link Nic,

It’s a shame you can get back the manual sales tax (even when you didn’t
set it and in that case, it comes back with a strange default) but can’t
get the calculated sales tax rate.

My app needs this to break down expenses with the rate. Without it, I’ll
have to duplicate and maintain a list of rates to categories :frowning:

Cheers,
TobyOn Tuesday, 23 October 2012 10:06:47 UTC+1, Nic Wise wrote:

I think path was from an old version of the api (ie v2 beta 0) and the
docs never got updated. I had the same issue half way thru my API
client development, but on the up side: all the (server side) models
are now the same, so it’s URL everywhere.

GitHub - nicwise/FreeAgent: A basic .NET client for FreeAgent.com (work in progress)

(this is being used for mobileAgent, but it should work for anything
which uses C#/.NET/Mono/MonoTouch/MonoForAndroid etc)

And, I’m pretty sure that the sales tax rate never comes back - you
only get back what the values was calculated to be, based on the rate
(or, if you submit, don’t provide one and it’ll work it out for you)

Graeme should know tho :slight_smile:

On Tue, Oct 23, 2012 at 8:33 AM, Toby <toby....@gmail.com <javascript:>> wrote:

Has anyone else seen this?

On Friday, 19 October 2012 17:00:07 UTC+1, Toby wrote:

Hi,

I mentioned this a while back but I’m still getting missing data from
the
JSON response to a GET to https://api.freeagent.com/v2/expenses

For example, from the documentation I expect to get back

{
“expenses”:[
{
“path”:“https://api.freeagent.com/v2/expenses/1”,
“user”:“https://api.freeagent.com/v2/users/1”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2011-08-24”,
“gross_value”:“-12.0”,
“sales_tax_rate”:“20.0”,
“description”:“Some description”,
“manual_sales_tax_amount”:“0.12”,
“updated_at”:“2011-08-24T08:10:40Z”,
“created_at”:“2011-08-24T08:10:40Z”,
}
]
}

but I really get back (with no sales_tax_rate field, the path field has
turned into url). I didn’t set a manual tax amount through the GUI in
the
example below and 0.04 (the default?) isn’t the correct value (it
should be
0.20 in this example), so I can’t calculate the sales tax rate.

{
“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/…”,
“user”:“https://api.freeagent.com/v2/users/…”,
“category”:“https://api.freeagent.com/v2/categories/285”,
“dated_on”:“2012-01-04”,
“gross_value”:“-4.35”,
“manual_sales_tax_amount”:“0.04”,
“description”:“Subsistence”,
“receipt_reference”:“03572500032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
} …

Any ideas? This is a blocker for me app :frowning:

Cheers,
Toby


You received this message because you are subscribed to the Google
Groups
“FreeAgent API” group.
To view this discussion on the web visit
https://groups.google.com/d/msg/freeagent_api/-/2uksW-wy_4cJ.

To post to this group, send email to freeag...@googlegroups.com<javascript:>.

To unsubscribe from this group, send email to
freeagent_ap...@googlegroups.com <javascript:>.
For more options, visit this group at
http://groups.google.com/group/freeagent_api?hl=en.


Nic Wise
t. +44 7788 592 806 | @fastchicken | Nic Wise - Tend Health Ltd | LinkedIn
b. http://www.fastchicken.co.nz/

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
Nearest Bus: find when the next bus is coming to your stop.
http://goo.gl/Vcz1p
London Bike App: Find the nearest Boris Bike, and get riding!
http://goo.gl/Icp2