Expenses on v2 API (I get back less than the documentations shows)

Hey Folks,

Is the documentation accurate for the invoices JSON?

I ask because I noticed sales tax is missing from the JSON I get back,
in fact, I get a bunch less than the documentation shows (https://
dev.freeagent.com/docs/expenses). Am I doing something wrong? I’m
using a URL with just from_date and to_date on the query string.

I get back this kind of thing from v2

{“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/1097”,
“user”:“https://api.freeagent.com/v2/users/1352”,
“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”:“0357032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
}
]}

but this kind of thing from v1

10175 285 11 Accommodation and Meals 2011-12-05T00:00:00Z -8.85 20.0 0.0 Subsistence 4 Years 1 0 true 0.0 0.09 1544 0.0 0.4 0.4 cost 42631 1644 161987731 2012-01-01T11:56:50Z

For completness, the XML version seems off too

From v2, I get

https://api.freeagent.com/v2/expenses/1082 https://api.freeagent.com/v2/users/11 https://api.freeagent.com/v2/categories/285 2012-01-04 -4.35 0.04 Subsistence 030032 2012-01-27T17:05:58+00:00 2012-01-27T17:05:58+00:00

where as the docs show

https://api.freeagent.com/v2/expenses/1 https://api.freeagent.com/v2/users/1 https://api.freeagent.com/v2/categories/285 2011-08-24 -12.0 20.0 asd 0.12 2011-08-24T08:10:40Z 2011-08-24T08:10:40Z https://api.freeagent.com/v2/attachments/3 https://s3.amazonaws.com/freeagent-dev/ attachments/1/original.png? AWSAccessKeyId=1K3MW21E6T8KWBY84B02&Expires=1314281298&Signature=jhGeAgqdnDwyFKHJoPI6AKU %2Fb2s%3D image/png barcode.png 7673

Any ideas?

Anyone know why fields are missing? anyone…?On Sep 17, 9:29 am, Toby toby.wes...@gmail.com wrote:

Thanks, but it’s the GET that’s ‘getting’ me at the mo. seems like the sales tax rate is just plain missing from the response body?

Ta

Hi Toby,

Sales_tax_rate is only shown for Invoice Items and not for the Invoice.
The reason is that an invoice can hold invoice items which each have
different sales_tax_rates (e.g. if selling zero VAT rated items alongside
standard rated items).

Invoices show the sales_tax_amount. As Nic points out if the
sales_tax_rate for an invoice item is not supplied it will be calculated.

Does this answer your question?

GraemeOn 17 September 2012 09:29, Toby toby.weston@gmail.com wrote:

Thanks, but it’s the GET that’s ‘getting’ me at the mo. seems like the
sales tax rate is just plain missing from the response body?

Ta


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/-/yK1fZOSsDiYJ.
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.

Graeme Boyd
Senior Software Engineer

Web. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
FreeAgent | Edinburgh

40 Torphichen Street, Edinburgh, EH3 8JB
FreeAgent Central Ltd. Registered in sunny Scotland SC316774

Thanks, but it’s the GET that’s ‘getting’ me at the mo. seems like the sales tax rate is just plain missing from the response body?

Ta

Ah, I think I spotted the sales tax. It’s an amount and not a rate
now! Silly me!On Sep 16, 3:34 pm, Toby toby.wes...@gmail.com wrote:

Hey Folks,

Is the documentation accurate for the invoices JSON?

I ask because I noticed sales tax is missing from the JSON I get back,
in fact, I get a bunch less than the documentation shows (https://
FreeAgent Developer Dashboard). Am I doing something wrong? I’m
using a URL with just from_date and to_date on the query string.

I get back this kind of thing from v2

{“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/1097”,
“user”:“https://api.freeagent.com/v2/users/1352”,
“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”:“0357032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
}
]}

but this kind of thing from v1

10175 285 11 Accommodation and Meals 2011-12-05T00:00:00Z -8.85 20.0 0.0 Subsistence 4 Years 1 0 true 0.0 0.09 1544 0.0 0.4 0.4 cost 42631 1644 161987731 2012-01-01T11:56:50Z

For completness, the XML version seems off too

From v2, I get

https://api.freeagent.com/v2/expenses/1082 https://api.freeagent.com/v2/users/11 https://api.freeagent.com/v2/categories/285 2012-01-04 -4.35 0.04 Subsistence 030032 2012-01-27T17:05:58+00:00 2012-01-27T17:05:58+00:00

where as the docs show

https://api.freeagent.com/v2/expenses/1 https://api.freeagent.com/v2/users/1 https://api.freeagent.com/v2/categories/285 2011-08-24 -12.0 20.0 asd 0.12 2011-08-24T08:10:40Z 2011-08-24T08:10:40Z https://api.freeagent.com/v2/attachments/3 https://s3.amazonaws.com/freeagent-dev/ attachments/1/original.png? AWSAccessKeyId=1K3MW21E6T8KWBY84B02&Expires=1314281298&Signature=jh GeAgqdnDwyFKHJoPI6AKU %2Fb2s%3D image/png barcode.png 7673

Any ideas?

Hmm, maybe not. I spotted the manual_sales_tax_amount and mistook it
for something i could use to work out the sales-tax-rate.

Should I be looking up what was the sales tax rate from the category
resource? that shows

“auto_sales_tax_rate”:“Standard rate”

for some, but nothing for others. I after something equivalent to the
old api, ie,

“sales_tax_rate” : 20.0

and would prefer not to lookup against hypermedia, any ideas?On Sep 16, 3:41 pm, Toby toby.wes...@gmail.com wrote:

Ah, I think I spotted the sales tax. It’s an amount and not a rate
now! Silly me!

On Sep 16, 3:34 pm, Toby toby.wes...@gmail.com wrote:

Hey Folks,

Is the documentation accurate for the invoices JSON?

I ask because I noticed sales tax is missing from the JSON I get back,
in fact, I get a bunch less than the documentation shows (https://
FreeAgent Developer Dashboard). Am I doing something wrong? I’m
using a URL with just from_date and to_date on the query string.

I get back this kind of thing from v2

{“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/1097”,
“user”:“https://api.freeagent.com/v2/users/1352”,
“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”:“0357032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
}
]}

but this kind of thing from v1

10175 285 11 Accommodation and Meals 2011-12-05T00:00:00Z -8.85 20.0 0.0 Subsistence 4 Years 1 0 true 0.0 0.09 1544 0.0 0.4 0.4 cost 42631 1644 161987731 2012-01-01T11:56:50Z

For completness, the XML version seems off too

From v2, I get

https://api.freeagent.com/v2/expenses/1082 https://api.freeagent.com/v2/users/11 https://api.freeagent.com/v2/categories/285 2012-01-04 -4.35 0.04 Subsistence 030032 2012-01-27T17:05:58+00:00 2012-01-27T17:05:58+00:00

where as the docs show

https://api.freeagent.com/v2/expenses/1 https://api.freeagent.com/v2/users/1 https://api.freeagent.com/v2/categories/285 2011-08-24 -12.0 20.0 asd 0.12 2011-08-24T08:10:40Z 2011-08-24T08:10:40Z https://api.freeagent.com/v2/attachments/3 https://s3.amazonaws.com/freeagent-dev/ attachments/1/original.png? AWSAccessKeyId=1K3MW21E6T8KWBY84B02&Expires=1314281298&Signature=jh GeAgqdnDwyFKHJoPI6AKU %2Fb2s%3D image/png barcode.png 7673

Any ideas?

Hi Graeme,

Thanks for the reply, I’m interested in expenses at the moment though. Am I
right in thinking sales_tax_rate should appear on those (ie
FreeAgent Developer Dashboard). I get a much smaller set of
fields back where I used to (in v1) get a bunch more stuff.

Initially I thought I could calculate the rate based on the
manual_sales_tax_amount (which does come back) but I can’t figure out how
to do that.

Cheers,
TobyOn Wednesday, 19 September 2012 09:36:25 UTC+1, Graeme Boyd wrote:

Hi Toby,

Sales_tax_rate is only shown for Invoice Items and not for the Invoice.
The reason is that an invoice can hold invoice items which each have
different sales_tax_rates (e.g. if selling zero VAT rated items alongside
standard rated items).

Invoices show the sales_tax_amount. As Nic points out if the
sales_tax_rate for an invoice item is not supplied it will be calculated.

Does this answer your question?

Graeme

On 17 September 2012 09:29, Toby <toby....@gmail.com <javascript:>> wrote:

Thanks, but it’s the GET that’s ‘getting’ me at the mo. seems like the
sales tax rate is just plain missing from the response body?

Ta


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/-/yK1fZOSsDiYJ.
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.


Graeme Boyd
Senior Software Engineer

Web. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
FreeAgent | Edinburgh

40 Torphichen Street, Edinburgh, EH3 8JB
FreeAgent Central Ltd. Registered in sunny Scotland SC316774

bounce!On Wednesday, 19 September 2012 11:15:49 UTC+1, Toby wrote:

Hi Graeme,

Thanks for the reply, I’m interested in expenses at the moment though. Am
I right in thinking sales_tax_rate should appear on those (ie
FreeAgent Developer Dashboard). I get a much smaller set of
fields back where I used to (in v1) get a bunch more stuff.

Initially I thought I could calculate the rate based on the
manual_sales_tax_amount (which does come back) but I can’t figure out how
to do that.

Cheers,
Toby

On Wednesday, 19 September 2012 09:36:25 UTC+1, Graeme Boyd wrote:

Hi Toby,

Sales_tax_rate is only shown for Invoice Items and not for the Invoice.
The reason is that an invoice can hold invoice items which each have
different sales_tax_rates (e.g. if selling zero VAT rated items alongside
standard rated items).

Invoices show the sales_tax_amount. As Nic points out if the
sales_tax_rate for an invoice item is not supplied it will be calculated.

Does this answer your question?

Graeme

On 17 September 2012 09:29, Toby toby....@gmail.com wrote:

Thanks, but it’s the GET that’s ‘getting’ me at the mo. seems like the
sales tax rate is just plain missing from the response body?

Ta


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/-/yK1fZOSsDiYJ.
To post to this group, send email to freeag...@googlegroups.com.
To unsubscribe from this group, send email to
freeagent_ap...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/freeagent_api?hl=en.


Graeme Boyd
Senior Software Engineer

Web. freeagent.com http://www.freeagent.com/ Blog. The FreeAgent Blog - FreeAgent
Twitter. @freeagent https://twitter.com/#!/freeagent Facebook.
FreeAgent | Edinburgh

40 Torphichen Street, Edinburgh, EH3 8JB
FreeAgent Central Ltd. Registered in sunny Scotland SC316774

I think there is a manual amount, and a manual rate.

So you can set the rate to 20 (20%) (sales_tax_rate)
Or set the manual amount to 1.50 (£1.50) (manual_sales_tax_amont)
Or don’t submit ANYTHING for either field (ie, not null, blank or
zero, but NO FIELD SHOWING in the JSON), and it’ll work it out.

That one got me for ages. I have to do manual removal from my json
before I send it, based on various “magic” values. :(On Sun, Sep 16, 2012 at 7:35 PM, Toby toby.weston@gmail.com wrote:

Hmm, maybe not. I spotted the manual_sales_tax_amount and mistook it
for something i could use to work out the sales-tax-rate.

Should I be looking up what was the sales tax rate from the category
resource? that shows

“auto_sales_tax_rate”:“Standard rate”

for some, but nothing for others. I after something equivalent to the
old api, ie,

“sales_tax_rate” : 20.0

and would prefer not to lookup against hypermedia, any ideas?

On Sep 16, 3:41 pm, Toby toby.wes...@gmail.com wrote:

Ah, I think I spotted the sales tax. It’s an amount and not a rate
now! Silly me!

On Sep 16, 3:34 pm, Toby toby.wes...@gmail.com wrote:

Hey Folks,

Is the documentation accurate for the invoices JSON?

I ask because I noticed sales tax is missing from the JSON I get back,
in fact, I get a bunch less than the documentation shows (https://
FreeAgent Developer Dashboard). Am I doing something wrong? I’m
using a URL with just from_date and to_date on the query string.

I get back this kind of thing from v2

{“expenses”:[
{
“url”:“https://api.freeagent.com/v2/expenses/1097”,
“user”:“https://api.freeagent.com/v2/users/1352”,
“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”:“0357032”,
“updated_at”:“2012-01-27T17:05:58+00:00”,
“created_at”:“2012-01-27T17:05:58+00:00”
}
]}

but this kind of thing from v1

10175 285 11 Accommodation and Meals 2011-12-05T00:00:00Z -8.85 20.0 0.0 Subsistence 4 Years 1 0 true 0.0 0.09 1544 0.0 0.4 0.4 cost 42631 1644 161987731 2012-01-01T11:56:50Z

For completness, the XML version seems off too

From v2, I get

https://api.freeagent.com/v2/expenses/1082 https://api.freeagent.com/v2/users/11 https://api.freeagent.com/v2/categories/285 2012-01-04 -4.35 0.04 Subsistence 030032 2012-01-27T17:05:58+00:00 2012-01-27T17:05:58+00:00

where as the docs show

https://api.freeagent.com/v2/expenses/1 https://api.freeagent.com/v2/users/1 https://api.freeagent.com/v2/categories/285 2011-08-24 -12.0 20.0 asd 0.12 2011-08-24T08:10:40Z 2011-08-24T08:10:40Z https://api.freeagent.com/v2/attachments/3 https://s3.amazonaws.com/freeagent-dev/ attachments/1/original.png? AWSAccessKeyId=1K3MW21E6T8KWBY84B02&Expires=1314281298&Signature=jh GeAgqdnDwyFKHJoPI6AKU %2Fb2s%3D image/png barcode.png 7673

Any ideas?


You received this message because you are subscribed to the Google Groups “FreeAgent API” group.
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