500 Server Error: Internal Server Error - Where to look next

I’m attempt to create a new journal set via the V2 API using POST to https:
//api.freeagent.com/v2/journal_sets.

I am getting a HTTP 500 response - Internal Server Error

Any clues as to what I can do next to try and work this out?

It was around 19:00 - 20:00 GMT if someone from Free Agent is able to look
in the logs…

Thanks

Hi Paul,

It would be really helpful if, in future, you could include details of the
request you’re making.

One of the journal entries you’re trying to create has an invalid category:
https://api.freeagent.com/v2/categories/7171950” which unfortunately at
the moment triggers a 500 error rather than an error message.

If you’re journaling a return of stock, you would debit 609, the balance
sheet stock account, and credit the relevant cost of sales category -
nominal code between 100 and 199.

Cheers,

GraemeOn 21 December 2014 at 19:53, Paul McDermott <larkfield.consulting@gmail.com wrote:

I’m attempt to create a new journal set via the V2 API using POST to https
://api.freeagent.com/v2/journal_sets.

I am getting a HTTP 500 response - Internal Server Error

Any clues as to what I can do next to try and work this out?

It was around 19:00 - 20:00 GMT if someone from Free Agent is able to look
in the logs…

Thanks


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.

Graeme Boyd
Compliance Team Engineering Manager

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

It would be really helpful if, in future, you could include details of
the request you’re making.
Sorry about that, but because it was an Internal Server Error I didn’t
think it would be a problem with my request…
One of the journal entries you’re trying to create has an invalid
category: “https://api.freeagent.com/v2/categories/7171950” which
unfortunately at the moment triggers a 500 error rather than an error
message.
Yes, that is correct that I set the credit category to that value. I got
this value from the ‘cost_of_category’ field in the stock item.

Here is a python-ised version of the JSON data for this stock item
(slightly disguised):

{u’opening_quantity’: u’0.0’, u’description’: u’SKU CODE’, u’url’:
u’https://api.freeagent.com/v2/stock_items/48746’,
u’cost_of_sale_category’:
u’https://api.freeagent.com/v2/categories/7171950’, u’stock_on_hand’:
u’0.0’, u’opening_balance’: u’0.0’}

My understanding was that this data corresponds to the data entered via
the web UI when creating a new stock item, and the
‘cost_of_sale_category’ was the one required. Is this not right?

If you’re journaling a return of stock, you would debit 609, the
balance sheet stock account, and credit the relevant cost of sales
category - nominal code between 100 and 199.

The cost of sales category for this stock item is set to “Cost of
Sales”, which has nominal code 101. But the data in the stock item API
request appears to return something else…

Thanks for your help,
Paul

There’s another bug with the API - we’re not returning the correct
nominal code for the cost of sales category from the stock_items
resource.

OK, so that’s 2 bugs. It would be useful if, at a minimum, these issues
were noted in the API documentation.

The following works for me to create a return of stock journal:

{
“journal_set”: {
“dated_on”: “2014-12-23”,
“description”: “Stock Test from API”,
“journal_entries”: [
{
“category”: “https://api.freeagent.com/v2/categories/101”,
“debit_value”: “100.0”
},
{
“category”: “https://api.freeagent.com/v2/categories/609”,
“debit_value”: “-100.0”,
“stock_altering_quantity”: “1.0”,
“stock_item”: “https://api.freeagent.com/v2/stock_items/1
}
]
}
}

Thank you. I have now got it working by looking up the ‘Cost of Sale’
category via the API.

As a side issue, the new journal entry I created appears “locked”,
whereas those I created via the web UI do not. It is true that the
journal entry I created was for a “locked” VAT period, but the journal
entry is not VAT affecting, and other journal entries in the same period
do not appear locked, which is inconsistent.

I’ll get the bug with the cost of sales category fixed.

Very good. An what about the misleading error code?

More generally, I think Free Agent need to spend some more time on this
API. The functionality coverage is not complete, and paying customers
such as myself are experiencing bugs. It is sometime difficult to
remember that this is a paid for SaaS proposition, and not some open
source project (except when I get the monthly bill…).

From a strategic perspective, a good, fully-featured API is the key to
creating a well-developed ecosystem of add-on services and partners.
Free Agent is slipping behind in this regard when compared to say Xero.

Thanks for your help,
Paul

Hi Paul,

There’s another bug with the API - we’re not returning the correct nominal
code for the cost of sales category from the stock_items resource.

The following works for me to create a return of stock journal:

{
“journal_set”: {
“dated_on”: “2014-12-23”,
“description”: “Stock Test from API”,
“journal_entries”: [
{
“category”: “https://api.freeagent.com/v2/categories/101”,
“debit_value”: “100.0”
},
{
“category”: “https://api.freeagent.com/v2/categories/609”,
“debit_value”: “-100.0”,
“stock_altering_quantity”: “1.0”,
“stock_item”: “https://api.freeagent.com/v2/stock_items/1
}
]
}
}

I’ll get the bug with the cost of sales category fixed.

GraemeOn 22 December 2014 at 20:25, Paul McDermott <larkfield.consulting@gmail.com wrote:

On 22/12/14 10:45, Graeme Boyd wrote:

It would be really helpful if, in future, you could include details of
the request you’re making.

Sorry about that, but because it was an Internal Server Error I didn’t
think it would be a problem with my request…

One of the journal entries you’re trying to create has an invalid
category: “https://api.freeagent.com/v2/categories/7171950” which
unfortunately at the moment triggers a 500 error rather than an error
message.

Yes, that is correct that I set the credit category to that value. I got
this value from the ‘cost_of_category’ field in the stock item.

Here is a python-ised version of the JSON data for this stock item
(slightly disguised):

{u’opening_quantity’: u’0.0’, u’description’: u’SKU CODE’, u’url’: u’
https://api.freeagent.com/v2/stock_items/48746’,
u’cost_of_sale_category’: u’https://api.freeagent.com/
v2/categories/7171950’, u’stock_on_hand’: u’0.0’, u’opening_balance’:
u’0.0’}

My understanding was that this data corresponds to the data entered via
the web UI when creating a new stock item, and the ‘cost_of_sale_category’
was the one required. Is this not right?

If you’re journaling a return of stock, you would debit 609, the balance

sheet stock account, and credit the relevant cost of sales category -
nominal code between 100 and 199.

The cost of sales category for this stock item is set to “Cost of Sales”,
which has nominal code 101. But the data in the stock item API request
appears to return something else…

Thanks for your help,
Paul


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.

Graeme Boyd
Compliance Team Engineering Manager

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

Hi Paul,

Thanks for your feedback and I’m really sorry you keep running into
problems.
Absolutely, our API is in need of some TLC and we’re making that a priority
over the coming months.

I’ll follow-up with Graeme as to the status of your most recent bug. If
needed, I can update the documentation to help others avoid the issue in
the short-term.

I really appreciate your patience and wish you a happy (and bug free) 2015!

Kind regards,
Dave JOn 26 December 2014 at 12:03, Paul McDermott <larkfield.consulting@gmail.com wrote:

On 23/12/14 10:01, Graeme Boyd wrote:

There’s another bug with the API - we’re not returning the correct nominal
code for the cost of sales category from the stock_items resource.

OK, so that’s 2 bugs. It would be useful if, at a minimum, these issues
were noted in the API documentation.

The following works for me to create a return of stock journal:

{
“journal_set”: {
“dated_on”: “2014-12-23”,
“description”: “Stock Test from API”,
“journal_entries”: [
{
“category”: “https://api.freeagent.com/v2/categories/101”,
“debit_value”: “100.0”
},
{
“category”: “https://api.freeagent.com/v2/categories/609”,
“debit_value”: “-100.0”,
“stock_altering_quantity”: “1.0”,
“stock_item”: “https://api.freeagent.com/v2/stock_items/1
}
]
}
}

Thank you. I have now got it working by looking up the ‘Cost of Sale’
category via the API.

As a side issue, the new journal entry I created appears “locked”, whereas
those I created via the web UI do not. It is true that the journal entry I
created was for a “locked” VAT period, but the journal entry is not VAT
affecting, and other journal entries in the same period do not appear
locked, which is inconsistent.

I’ll get the bug with the cost of sales category fixed.

Very good. An what about the misleading error code?

More generally, I think Free Agent need to spend some more time on this
API. The functionality coverage is not complete, and paying customers such
as myself are experiencing bugs. It is sometime difficult to remember that
this is a paid for SaaS proposition, and not some open source project
(except when I get the monthly bill…).

From a strategic perspective, a good, fully-featured API is the key to
creating a well-developed ecosystem of add-on services and partners. Free
Agent is slipping behind in this regard when compared to say Xero.

Thanks for your help,
Paul


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

Hi Paul,

Just a quick message to confirm that the bug you found has been fixed.
Now, if you look-up a cost-of-sales category, the URL for the stock-item
will correctly use the nominal-code.

Thanks for your patience and our apologies again for the confusion!

Kind regards,
Dave JOn Wednesday, 31 December 2014 15:10:33 UTC, David Jones wrote:

Hi Paul,

Thanks for your feedback and I’m really sorry you keep running into
problems.
Absolutely, our API is in need of some TLC and we’re making that a
priority over the coming months.

I’ll follow-up with Graeme as to the status of your most recent bug. If
needed, I can update the documentation to help others avoid the issue in
the short-term.

I really appreciate your patience and wish you a happy (and bug free) 2015!

Kind regards,
Dave J

On 26 December 2014 at 12:03, Paul McDermott < larkfield.consulting@gmail.com> wrote:

On 23/12/14 10:01, Graeme Boyd wrote:

There’s another bug with the API - we’re not returning the correct
nominal code for the cost of sales category from the stock_items resource.

OK, so that’s 2 bugs. It would be useful if, at a minimum, these issues
were noted in the API documentation.

The following works for me to create a return of stock journal:

{
“journal_set”: {
“dated_on”: “2014-12-23”,
“description”: “Stock Test from API”,
“journal_entries”: [
{
“category”: "https://api.freeagent.com/v2/categories/101
",
“debit_value”: “100.0”
},
{
“category”: "https://api.freeagent.com/v2/categories/609
",
“debit_value”: “-100.0”,
“stock_altering_quantity”: “1.0”,
“stock_item”: "https://api.freeagent.com/v2/stock_items/1
"
}
]
}
}

Thank you. I have now got it working by looking up the ‘Cost of Sale’
category via the API.

As a side issue, the new journal entry I created appears “locked”,
whereas those I created via the web UI do not. It is true that the journal
entry I created was for a “locked” VAT period, but the journal entry is not
VAT affecting, and other journal entries in the same period do not appear
locked, which is inconsistent.

I’ll get the bug with the cost of sales category fixed.

Very good. An what about the misleading error code?

More generally, I think Free Agent need to spend some more time on this
API. The functionality coverage is not complete, and paying customers such
as myself are experiencing bugs. It is sometime difficult to remember that
this is a paid for SaaS proposition, and not some open source project
(except when I get the monthly bill…).

From a strategic perspective, a good, fully-featured API is the key to
creating a well-developed ecosystem of add-on services and partners. Free
Agent is slipping behind in this regard when compared to say Xero.

Thanks for your help,
Paul


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

Hi, thanks for sharing informative concept with us . Because i also found that error on my website : http://www.cetpainfotech.com sometime in webmastertool i see this error. But don’t know how to resolve it.