How to integrate Quickbooks desktop Application with a PHP(web app)?

安稳与你 提交于 2019-12-04 14:04:27

Here is a PHP QuickBooks Library which does exactly what you want to do.

You should follow the QuickBooks PHP Web Connector quick-start guide to get started. You'll want to architect your application so that your PHP script can receive the data, store it temporarily in a database (MySQL, etc.) and then the Web Connector can pick up the data destined for QuickBooks from there.

The Web Connector is a little different than a standard web service in that it works in a sort of backwards manner - the Web Connector will call out to your PHP web service vs. you calling out to it.

There's a overview of how the Web Connector works over here.

You should refer to this script (as the quick-start guide does above):

You'll end up writing functions to generate qbXML requests that look something like this:

<?php

/**
 * Example Web Connector application
 * 
 * This is a very simple application that allows someone to enter a customer 
 * name into a web form, and then adds the customer to QuickBooks.
 * 
 * @author Keith Palmer <keith@consolibyte.com>
 * 
 * @package QuickBooks
 * @subpackage Documentation
 */

/**
 * Generate a qbXML response to add a particular customer to QuickBooks
 */
function _quickbooks_customer_add_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
{
        // Grab the data from our MySQL database
        $arr = mysql_fetch_assoc(mysql_query("SELECT * FROM my_customer_table WHERE id = " . (int) $ID));

        $xml = '<?xml version="1.0" encoding="utf-8"?>
                <?qbxml version="2.0"?>
                <QBXML>
                        <QBXMLMsgsRq onError="stopOnError">
                                <CustomerAddRq requestID="' . $requestID . '">
                                        <CustomerAdd>
                                                <Name>' . $arr['name'] . '</Name>
                                                <CompanyName>' . $arr['name'] . '</CompanyName>
                                                <FirstName>' . $arr['fname'] . '</FirstName>
                                                <LastName>' . $arr['lname'] . '</LastName>
                                        </CustomerAdd>
                                </CustomerAddRq>
                        </QBXMLMsgsRq>
                </QBXML>';

        return $xml;
}


Intuit also has a PHP SDK for v3 of the QuickBooks API. https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits

regards Jarred

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!