// Create the API instance $API = new QuickBooks_API($api_driver_dsn, $username, $source_type, $source_dsn, $api_options, $source_options, $driver_options); // Turn on debugging mode //$API->useDebugMode(true); // With QuickBooks Online Edition, the API can return values to you rather than // using callback functions to return values. Remember that is you use this, // your code will be less portable to systems using non-real-time connections // (i.e. the QuickBooks Web Connector). //$API->enableRealtime(true); // Let's get some general information about this connection to QBOE: print 'Our connection ticket is: ' . $API->connectionTicket() . "\n"; print 'Our session ticket is: ' . $API->sessionTicket() . "\n"; print 'Our application id is: ' . $API->applicationID() . "\n"; print 'Our application login is: ' . $API->applicationLogin() . "\n"; print "\n"; print 'Last error number: ' . $API->errorNumber() . "\n"; print 'Last error message: ' . $API->errorMessage() . "\n"; print "\n"; // The "raw" approach to accessing QuickBooks Online Edition is to build and // parse the qbXML requests/responses send to/from QuickBooks yourself. Here // is an example of querying for a customer by building a raw qbXML request. // The qbXML response is passed back to you in the _raw_qbxml_callback() // 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;