// function as the $qbxml parameter. $return = $API->qbxml(' <CustomerQueryRq> <FullName>Keith Palmer Jr.</FullName> </CustomerQueryRq>', '_raw_qbxml_callback'); // This function gets called when QuickBooks Online Edition sends a response back function _raw_qbxml_callback($method, $action, $ID, &$err, $qbxml, $Iterator, $qbres) { print 'We got back this qbXML from QuickBooks Online Edition: ' . $qbxml; } // For QuickBooks Online Edition, you can use real-time connections so that you // get return values instead of having to write callback functions. Note that // if you do this, you make your code less portable to other editions of // QuickBooks that do not support real-time connections (i.e. QuickBooks // desktop editions via the Web Connector) if ($API->usingRealtime()) { print 'Our real-time response from QuickBooks Online Edition was: '; print_r($return); } exit; // You can also create QuickBooks_Object_* instances and send them directly to // QBOE via the API as show below. The API takes care of transforming those // objects to valid qbXML requests for you. $name = 'Keith Palmer (' . mt_rand() . ')'; $Customer = new QuickBooks_Object_Customer(); $Customer->setName($name); $Customer->setShipAddress('134 Stonemill Road', '', '', '', '', 'Storrs', 'CT', '', '06268'); // Just a demo showing how to generate the raw qbXML request print 'Here is the qbXML request we\'re about to send to QuickBooks Online Edition: ' . "\n"; print $Customer->asQBXML('CustomerAdd'); // Send the request to QuickBooks