// Make sure you add those invoice lines on to the invoice
$Invoice->addInvoiceLine($InvoiceLine1);
$Invoice->addInvoiceLine($InvoiceLine2);
// Queue up the request to be sent to QuickBooks
$priority_of_add_invoice_request = 10;
// Make sure this is lower than the customer add it depends on
if ($API->addInvoice($Invoice, '_quickbooks_ca_invoice_add_callback', $primary_key_of_invoice_in_your_application, $priority_of_add_invoice_request)) {
    print 'Queued up a request to add invoice #' . $primary_key_of_invoice_in_your_application . ' to QuickBooks!' . "\n";
}
// Adding an estimate for a customer
$primary_key_of_estimate_in_your_application = 'ABC-123';
// Adding an estimate is very similar to adding an invoice, as most of the
//	estimate data within QuickBooks closely mirrors the invoice data.
$Estimate = new QuickBooks_Object_Estimate();
// Set the customer that this estimate belongs to
$Estimate->setCustomerName($name);
// Set some other estimate data
$Estimate->setTxnDate('4/2/1999');
$Estimate->setRefNumber($primary_key_of_estimate_in_your_application);
// Billing address
$Estimate->setBillAddress('134 Stonemill Road', '', '', '', '', 'Quebec City', '', 'Quebec', 'H12 ABC', 'Canada');
// Estimate line items
$EstimateLine1 = new QuickBooks_Object_Estimate_EstimateLine();
$EstimateLine1->setItemName('Item Type 1');
$EstimateLine1->setRate(14.95);
$EstimateLine1->setQuantity(5);
// Add the estimate line item to the estimate
$Estimate->addEstimateLine($EstimateLine1);
// Queue up the request to be sent to QuickBooks
$priority_of_add_estimate_request = 10;
// Make sure this is lower than the customer add it depends on