![Picture of Alexis RIbault Picture of Alexis RIbault](/graphics/unknown.gif)
Alexis RIbault - 2015-05-08 05:47:19
Hello,
I successfully connected to Xero API,
But I am currently stuck to POST an invoice using XML.
$url = 'xml/invoice.xml';
$xml = simplexml_load_file($url);
$success3 = $client->CallAPI(
'https://api.xero.com/api.xro/2.0/Invoices',
'POST', array('format'=>'text/xml','File'=>$xml), array('FailOnAccessError'=>true, 'DecodeXMLResponse'=>'simplexml'), $user3);
This is the code that I have, but I am not sure if this works that way.
This is the error I get as a response.
SimpleXMLElement Object
(
[ErrorNumber] => 17
[Type] => NoDataProcessedException
[Message] => No data has been processed for this endpoint. This endpoint is expecting Invoice data to be specifed in the request body.
)
Cheers,
Alexis