I am using the open-source QuickBooks PHP DevKit on GitHub. Suppose their are three line items in a invoice. Is it possilbe to update third line item? Also Is it possible to delete an invoice? Please help.
Asked
Active
Viewed 235 times
1 Answers
1
Start with the example of updating an invoice here:
You'll first retrieve the invoice from QuickBooks:
$invoices = $InvoiceService->query($Context, $realm, "SELECT * FROM Invoice WHERE Id = '34' ");
$Invoice = $invoices[0];
Then you can get the third line item:
$Line = $Invoice->getLine(2); // zero-indexed, so "2" is the third line item
Then you can change it:
$Line->setDescription('Here is my updated description');
Then update the invoice:
$resp = $InvoiceService->update($Context, $realm, $Invoice->getId(), $Invoice);

Keith Palmer Jr.
- 27,666
- 16
- 68
- 105
-
Thanks. updation by line worked. Is it possible to delete an invoice? – Shino Jun 11 '14 at 09:09
-
@Shino Example of deleting an invoice https://github.com/consolibyte/quickbooks-php/blob/master/docs/partner_platform/example_app_ipp_v3/example_invoice_delete.php – Keith Palmer Jr. Jul 16 '14 at 12:20