get invoice in my site using invoice id from xero api?

Home / Uncategorized / get invoice in my site using invoice id from xero api?

Question:
I am using xero for generate invoice, now I want get invoice using xero invoice id in php, my code is ………..
$nik = $xero->load(‘Accounting\Invoice’)
->where(‘InvoiceID’, $outwardRecord->xero_invoice_id)
or
->where(‘InvoiceID’, XeroPHPModelsAccountingInvoice::InvoiceID)
->execute();
but it’s given error
Fatal error: Undefined class constant ‘InvoiceID’ in /var/w
please guide me how to get invoice using invoiceId, how understand my problem.

thanks!


Answer:
thanks to all,

finally I got answer,
$xero_api_config = getCustomConfigItem(‘xero_api_config’);
$xero = new XeroPHPApplicationPrivateApplication($xero_api_config);
$response=$xero->loadByGUID(‘Accounting\Invoice’,$xero_invoice_id);
print_r($response);
it’s working!
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *