Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

JSON Response to Invoice Request

Started by Chris Barrett -   in API Endpoints

I have a 2 identical php applications that link to Xero, getting invoice information as it is entered.

One of the applications works perfectly - entering an invoice triggers a webhook, which is then stored and processed by my application - gather the invoice information from Xero

The second application appears to work, triggering the webhook, put does not process the invoice. Or more accurately fails to parse the invoice information. I think tis is due to the fact the invoice data is being passed as JSON rather than XML.

The error message is:
E_WARNING: DateTime::__construct(): Failed to parse time string (/Date(1592934718000)/) at position 0 (/): Unexpected character

Are there any known changes to the API that would cause this, the only difference is the original Xero app was register late 2019, and the new app in May 2020.

Any suggestions would be most appreciated.

Hi Chris,

Are both of your applications using JSON or is one using XML?



Steven Brown (Xero Staff)  

Hi Steven,

I believe that they are both using / expecting XML. But only 1 is failing due to receiving JSON (I think).

Sorry for the non specific answer. While I developed the overall application, the Xero integration was handled by a 3rd party developer.



Chris Barrett