Internal Server Error when adding an Bank Transaction Explanation

Hi,

Getting an Internal Server Error back from the FreeAgent API when attempted
to explain a transaction on the Bank Statement.

Everything is authenticating correctly, the transaction and invoice both
exist. Using the Stripe.Net C#.NET API wrapper (which works for everything
else without issue).

Code:

FreeAgent.BankTransactionExplanation oExplanation = new
BankTransactionExplanation();
oExplanation.bank_transaction =
https://api.freeagent.com/v2/bank_transactions/” +
lFreeAgentTransactionID.ToString();
oExplanation.paid_invoice = “https://api.freeagent.com/v2/invoices/” +
lFreeAgentInvoiceID.ToString();
oExplanation.dated_on = dtDate.ToShortDateString().Replace("/", “-”);
oExplanation.gross_value = dGrossAmount;
oExplanation.manual_sales_tax_amount = dVAT;

poFreeAgentClient.BankTransactionExplanation.Put(oExplanation);

Regards,

Steve

Hi

Having the same issue here as well.

Do you think this will be resolved soon?

Cheers

JohnOn Wednesday, 29 January 2014 16:26:47 UTC, Steve Stovold wrote:

Thank you - by the way it seems to happen even when attempted to explain a
transaction with an invoice too.

Steve

On Wednesday, 29 January 2014 16:18:45 UTC, Olly H wrote:

Thanks Steve. We think we’ve identified the issue but we’re still
investigating.

Thank you - by the way it seems to happen even when attempted to explain a
transaction with an invoice too.

SteveOn Wednesday, 29 January 2014 16:18:45 UTC, Olly H wrote:

Thanks Steve. We think we’ve identified the issue but we’re still
investigating.

I believe it is:

{“bank_transaction_
explanation”:{“bank_transaction”:"
https://api.freeagent.com/v2/bank_transactions/39894873
“,“dated_on”:“20-01-2014”,“description”:null,“gross_value”:-22.88,“manual_sales_tax_amount”:0,“paid_invoice”:null,“paid_bill”:”
https://api.freeagent.com/v2/bills/2590081
“,“updated_at”:”“,“created_at”:”“,“url”:”"}}On Wednesday, 29 January 2014 15:56:27 UTC, Olly H wrote:

Steve

Are you able to post the JSON you’re sending so it’s more obvious what the
request is, which will make it easier to debug?

Feel free to change the IDs.

Olly

Hi

We will have a fix soon but in the meantime you should be able to post your decimal values as strings rather than JSON floats which appears to be the source of the problem. The docs do actually recommend sending everything as strings so you’d be best always following that convention.

Let me know if this helps.

Olly

Hey folks,

We’ve deployed a fix for this now, so sending gross_value as a native JSON float in will work as expected. Apologies for any inconvenience caused!

Thanks,
C
Caius Durling
Senior Engineer, FreeAgent

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

Thanks Steve. We think we’ve identified the issue but we’re still
investigating.On Wednesday, January 29, 2014 4:15:02 PM UTC, Steve Stovold wrote:

I believe it is:

{“bank_transaction_explanation”:{“bank_transaction”:"
https://api.freeagent.com/v2/bank_transactions/39894873
“,“dated_on”:“20-01-2014”,“description”:null,“gross_value”:-22.88,“manual_sales_tax_amount”:0,“paid_invoice”:null,“paid_bill”:”
https://api.freeagent.com/v2/bills/2590081
“,“updated_at”:”“,“created_at”:”“,“url”:”"}}

On Wednesday, 29 January 2014 15:37:58 UTC, Steve Stovold wrote:

Hi,

Getting an Internal Server Error back from the FreeAgent API when
attempted to explain a transaction on the Bank Statement.

Everything is authenticating correctly, the transaction and invoice both
exist. Using the Stripe.Net C#.NET API wrapper (which works for everything
else without issue).

Code:

FreeAgent.BankTransactionExplanation oExplanation = new
BankTransactionExplanation();
oExplanation.bank_transaction = "
https://api.freeagent.com/v2/bank_transactions/" +
lFreeAgentTransactionID.ToString();
oExplanation.paid_invoice = “https://api.freeagent.com/v2/invoices/” +
lFreeAgentInvoiceID.ToString();
oExplanation.dated_on = dtDate.ToShortDateString().Replace(“/”, “-”);
oExplanation.gross_value = dGrossAmount;
oExplanation.manual_sales_tax_amount = dVAT;

poFreeAgentClient.BankTransactionExplanation.Put(oExplanation);

Regards,

Steve

Steve

Are you able to post the JSON you’re sending so it’s more obvious what the
request is, which will make it easier to debug?

Feel free to change the IDs.

OllyOn Wednesday, January 29, 2014 3:37:58 PM UTC, Steve Stovold wrote:

Hi,

Getting an Internal Server Error back from the FreeAgent API when
attempted to explain a transaction on the Bank Statement.

Everything is authenticating correctly, the transaction and invoice both
exist. Using the Stripe.Net C#.NET API wrapper (which works for everything
else without issue).

Code:

FreeAgent.BankTransactionExplanation oExplanation = new
BankTransactionExplanation();
oExplanation.bank_transaction = "
https://api.freeagent.com/v2/bank_transactions/" +
lFreeAgentTransactionID.ToString();
oExplanation.paid_invoice = “https://api.freeagent.com/v2/invoices/” +
lFreeAgentInvoiceID.ToString();
oExplanation.dated_on = dtDate.ToShortDateString().Replace(“/”, “-”);
oExplanation.gross_value = dGrossAmount;
oExplanation.manual_sales_tax_amount = dVAT;

poFreeAgentClient.BankTransactionExplanation.Put(oExplanation);

Regards,

Steve