Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

ManualJournals and JSON Validation Error

Started by Ryan Lott -   in API Endpoints

I am receiving validation errors when posting agains the ManalJournals endpoint using JSON. It works fine if I switch to XML.

Here is the error:

<ApiException xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Message>A validation exception occurred</Message>
<DataContractBase xsi:type="ManualJournal">
<Message>A Manual Journal must contain at least 2 lines</Message>
<Message>The Narration field is mandatory</Message>

Also I would like to receive a response in JSON rather than XML once this is actually working

Hi Ryan,

I'm not sure if I can tell you anything based just on the errors except ask you to check that you're including the things it's asking about correctly. If you can share the JSON request you're sending through then we might be able to spot something.

As far as the error coming back in JSON, you should receive the errors in JSON if you set the 'accept' header on your request to 'application/json'



Steven Brown (Xero Staff)