Creating a bill is generating a 500 error

Hi,

I’m trying to create a bill via the API, and it’s giving me a 500 error. If
I use exactly the same values and create it manually, it works.

I have tried creating the simplest, most basic bill using the API and it’s
forever giving me a 500 error.

Any direction as to what causes these errors would be greatly appreciated.

Thanks,

Dave

Hi Dave,

Here’s an example JSON request:

{

"bill":

    {

        "contact": "https://api.freeagent.com/v2/contacts/1

https://api.freeagent.com/v2/contacts/120504523456",

        "category":"https://api.freeagent.com/v2/categories/285",

        "dated_on": "2012-08-29",

        "due_on": "2012-09-28",

        "reference": "126",

        "total_value":"100.0",

        "currency": "GBP",

        "exchange_rate": "1.0",

        "status": "Draft",

        "comments": "An example bill comment."

    }

}

I’ve had a quick look in the logs and the main error you’re making is
sending a number for category. Category must be sent as a string URL.
You’re also sending some numbers as integers rather than as decimal
strings which can lead to rounding errors so they should be sent as strings.

Kind regards,

GraemeOn 25 July 2014 12:36, Dave Goodchild dave@davegoodchild.co.uk wrote:

Hi,

I’m trying to create a bill via the API, and it’s giving me a 500 error.
If I use exactly the same values and create it manually, it works.

I have tried creating the simplest, most basic bill using the API and it’s
forever giving me a 500 error.

Any direction as to what causes these errors would be greatly appreciated.

Thanks,

Dave


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
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