Can't store VAT amount on explanations via API

Hi there,

(I also sent this to support@freeagent.com - feel free to answer in the
google group if you prefer)

Transaction explanations with VAT amounts don’t seem to persist the VAT
amount when created via the API. This is what I POSTed to
https://api.freeagent.com/v2/bank_transaction_explanations :

{
“bank_transaction_explanation”: {
“manual_sales_tax_amount”: 3.03,
“gross_value”: “18.17”,
“description”: “See Stripe for details,
https://dashboard.stripe.com/payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_transaction”: "
https://api.freeagent.com/v2/bank_transactions/57331159"
}
}

When I look at the explanation in the FreeAgent UI I don’t see it:

https://cukes.freeagent.com/bank_accounts/246200/bank_account_entries/53759205/edit?bank_transaction_id=57331159

I’m attaching two screenshots - what I am seeing and what I expected to see.

I also tried to retrieve the explanation via the API, issuing a GET to
https://api.freeagent.com/v2/bank_transaction_explanations/53759205 :

{
“bank_transaction_explanation”: {
“sales_tax_rate”: “0.0”,
“gross_value”: “18.17”,
“description”: “See Stripe for details,
https://dashboard.stripe.com/payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_account”: “https://api.freeagent.com/v2/bank_accounts/246200”,
“bank_transaction”: "
https://api.freeagent.com/v2/bank_transactions/57331159",
“url”: "
https://api.freeagent.com/v2/bank_transaction_explanations/53759205"
}
}

This confirms that the VAT amount has not been stored. The result is also
different from what I stored. It has a sales_tax_rate property, but no
manual_sales_tax_amount property.

Am I doing something wrong? Are the API docs wrong or is there a bug in
your system?

Cheers,
Aslak

Hi David,

Thanks for the swift reply.

I came up with a different solution in the meanwhile. Instead of using the manual_sales_tax_amount
property I set the sales_tax_rate property. This property is undocumented
in the API docs, but I guessed it would work based on what I get back when
I do a GET. That works fine.

Cheers,
AslakOn Friday, January 30, 2015 at 1:25:26 PM UTC, David Jones wrote:

Hi Aslak,

Thanks for your message and sorry to hear you’re having trouble, hopefully
I can help.

I’ve been able to reproduce the problem you’re reporting and you’re right,
setting the “manual_sales_tax_amount” isn’t currently being persisted when
an explanation is created.

Digging through the code, it looks like we require an extra parameter to
be specified, if you want to manually pass through a sales tax amount:
“sales_tax_rate”: “-3.0”,

This -3 tells FreeAgent that a manual amount is being specified - It’s
normally set when you select the “Amount” option from the drop-down in the
FreeAgent UI (see your second screenshot).

I’m working on a patch so that specifying the “manual_sales_tax_amount”
will be enough, without the need to set this magical “sales_tax_rate” value.
Once I’ve released the patch, I’ll be sure to update this thread. In the
mean-time, could you amend your parameters to add the “sales_tax_rate”
parameter?

{
“bank_transaction_explanation”: {
“sales_tax_rate”: “-3”,
“manual_sales_tax_amount”: “3.03”,
“gross_value”: “18.17”,
“description”: “See Stripe for details,
https://dashboard.stripe.com/payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_transaction”: "
https://api.freeagent.com/v2/bank_transactions/57331159"
}
}

I hope this helps and sorry for the confusion!

Kind regards,
Dave J

On 29 January 2015 at 15:37, Aslak Hellesøy <aslak.h...@gmail.com <javascript:>> wrote:

Hi there,

(I also sent this to sup...@freeagent.com <javascript:> - feel free to
answer in the google group if you prefer)

Transaction explanations with VAT amounts don’t seem to persist the VAT
amount when created via the API. This is what I POSTed to
https://api.freeagent.com/v2/bank_transaction_explanations :

{
“bank_transaction_explanation”: {
“manual_sales_tax_amount”: 3.03,
“gross_value”: “18.17”,
“description”: “See Stripe for details, https://dashboard.stripe.com/
payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_transaction”: “https://api.freeagent.com/v2/
bank_transactions/57331159”
}
}

When I look at the explanation in the FreeAgent UI I don’t see it:

https://cukes.freeagent.com/bank_accounts/246200/bank_
account_entries/53759205/edit?bank_transaction_id=57331159

I’m attaching two screenshots - what I am seeing and what I expected to
see.

I also tried to retrieve the explanation via the API, issuing a GET to
https://api.freeagent.com/v2/bank_transaction_explanations/53759205 :

{
“bank_transaction_explanation”: {
“sales_tax_rate”: “0.0”,
“gross_value”: “18.17”,
“description”: “See Stripe for details, https://dashboard.stripe.com/
payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_account”: “https://api.freeagent.com/v2/bank_accounts/246200”,
“bank_transaction”: “https://api.freeagent.com/v2/
bank_transactions/57331159”,
“url”: “https://api.freeagent.com/v2/bank_transaction_explanations/
53759205”
}
}

This confirms that the VAT amount has not been stored. The result is also
different from what I stored. It has a sales_tax_rate property, but no
manual_sales_tax_amount property.

Am I doing something wrong? Are the API docs wrong or is there a bug in
your system?

Cheers,
Aslak


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_ap...@googlegroups.com <javascript:>.
To post to this group, send email to freeag...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.


David Jones
Senior Support Engineer

FreeAgent

Hi Aslak,

Thanks for your message and sorry to hear you’re having trouble, hopefully
I can help.

I’ve been able to reproduce the problem you’re reporting and you’re right,
setting the “manual_sales_tax_amount” isn’t currently being persisted when
an explanation is created.

Digging through the code, it looks like we require an extra parameter to be
specified, if you want to manually pass through a sales tax amount:
“sales_tax_rate”: “-3.0”,

This -3 tells FreeAgent that a manual amount is being specified - It’s
normally set when you select the “Amount” option from the drop-down in the
FreeAgent UI (see your second screenshot).

I’m working on a patch so that specifying the “manual_sales_tax_amount”
will be enough, without the need to set this magical “sales_tax_rate” value.
Once I’ve released the patch, I’ll be sure to update this thread. In the
mean-time, could you amend your parameters to add the “sales_tax_rate”
parameter?

{
“bank_transaction_explanation”: {
“sales_tax_rate”: “-3”,
“manual_sales_tax_amount”: “3.03”,
“gross_value”: “18.17”,
“description”: “See Stripe for details,
https://dashboard.stripe.com/payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_transaction”: "
https://api.freeagent.com/v2/bank_transactions/57331159"
}
}

I hope this helps and sorry for the confusion!

Kind regards,
Dave JOn 29 January 2015 at 15:37, Aslak Hellesøy aslak.hellesoy@gmail.com wrote:

Hi there,

(I also sent this to support@freeagent.com - feel free to answer in the
google group if you prefer)

Transaction explanations with VAT amounts don’t seem to persist the VAT
amount when created via the API. This is what I POSTed to
https://api.freeagent.com/v2/bank_transaction_explanations :

{
“bank_transaction_explanation”: {
“manual_sales_tax_amount”: 3.03,
“gross_value”: “18.17”,
“description”: “See Stripe for details, https://dashboard.stripe.com/
payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_transaction”: “https://api.freeagent.com/v2/
bank_transactions/57331159”
}
}

When I look at the explanation in the FreeAgent UI I don’t see it:

https://cukes.freeagent.com/bank_accounts/246200/bank_
account_entries/53759205/edit?bank_transaction_id=57331159

I’m attaching two screenshots - what I am seeing and what I expected to
see.

I also tried to retrieve the explanation via the API, issuing a GET to
https://api.freeagent.com/v2/bank_transaction_explanations/53759205 :

{
“bank_transaction_explanation”: {
“sales_tax_rate”: “0.0”,
“gross_value”: “18.17”,
“description”: “See Stripe for details, https://dashboard.stripe.com/
payments/ch_154leY2FNpzctXevvNrvCRJb”,
“dated_on”: “2014-12-09”,
“category”: “https://api.freeagent.com/v2/categories/005”,
“bank_account”: “https://api.freeagent.com/v2/bank_accounts/246200”,
“bank_transaction”: “https://api.freeagent.com/v2/
bank_transactions/57331159”,
“url”: “https://api.freeagent.com/v2/bank_transaction_explanations/
53759205”
}
}

This confirms that the VAT amount has not been stored. The result is also
different from what I stored. It has a sales_tax_rate property, but no
manual_sales_tax_amount property.

Am I doing something wrong? Are the API docs wrong or is there a bug in
your system?

Cheers,
Aslak


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

David Jones
Senior Support Engineer

FreeAgent