I am integrating my application with with Quickbook Online Sandbox account using php sdk version 3. I am able to connect and fetch/add data like customers without a problem. But I am unable to create an invoice using the sdk. Here is my code:
$invoiceObj = new IPPInvoice();
$Line = new IPPline();
$Line->Amount = 15;
$Line->DetailType = 'SalesItemLineDetail';
$saleItemLineDetail = new IPPSalesItemLineDetail();
$saleItemLineDetail->ItemRef = 1;
$saleItemLineDetail->UnitPrice = 15;
$saleItemLineDetail->Qty = 2;
$Line->SalesItemLineDetail = $saleItemLineDetail;
$invoiceObj->Line = $Line;
$invoiceObj->DocNumber = '23713';
$invoiceObj->TxnDate = 2015-10-11;
$invoiceObj->CustomerRef = 67;
try{
$resultingInvoiceObj = $connect->Add($invoiceObj);
} catch (Exception $e){
echo $e->getMessage();
}
I am writing this in a function which takes the connection object as parameter. I am able to add customer using this connection object in the same function.
The response i'm getting is
2015-04-22 06:46:15 - E:\wamp\www\test\application\libraries\QuickBooksOnline\DataService\DataService.php - 340 - CheckNullResponseAndThrowException - Response Null or Empty
I got stuck here. Please point out where i am doing wrong. Any help in this regard is highly appreciated.
$connectis configured. - Samuel Parkinson