Connect online quickbook to my php website

∥☆過路亽.° 提交于 2019-12-13 07:20:25

问题


I am in need of generating invoices on my online quickbook account automatically through my php website. i searched a lot over intuit and other sources but dont know where to start or what to do. please help me.. Thanks


回答1:


For non-SaaS QuickBooks integration with QuickBooks Online, you want to use qbXML.

To do this, you first need to register with Intuit. It's easiest to register in DESKTOP mode. There are instructions to do this on our QuickBooks PHP wiki. Register as a PRODUCTION application (you can only use DEV/PTC if you get a special account from Intuit, which you won't be able to get).

Once you've registered, you'll have a connection ticket, an app id, and a app login.

Then, you can grab our open source PHP QuickBooks DevKit (use a recent nightly build) and open this example:

  • docs/example_online_edition.php

From there, you plug in your app id, app login, and connection ticket, and you'll be able to send XML formatted requests to QuickBooks.

You'll want to use Intuits QuickBooks OSR for XML reference. Make sure to check "OE", uncheck "US", change the qbXML version to 6.0 (QuickBooks Online only supports 6.0), use the "Select Message" drop-down to choose the request type, and the "XML Ops" tab to see the available XML fields.

Your resulting code will look something like:

require_once dirname(__FILE__) . '/../QuickBooks.php';

// Register in DESKTOP mode to get these. Docs: 
//  http://www.consolibyte.com/docs/index.php/QuickBooks_Online_via_qbXML#Connecting_with_the_.27Desktop.27_model_of_communication
$application_id = '134476443';
$application_login = 'qboe.www.consolibyte.com';
$connection_ticket = 'TGT-68-1sRm2nXMVfm$n8hb2MZfVQ';

// Create our new gateway instance 
$Gateway = new QuickBooks_Gateway_OnlineEdition(
    $application_id,
    $application_login,
    $connection_ticket);

$xml = '<QBXMLMsgsRq onError="stopOnError">
            <VendorAddRq>
                <VendorAdd>
                    <Name>ConsoliBYTE</Name>
                    <FirstName>Keith</FirstName>    
                    <LastName>Palmer</LastName> 
                    <VendorAddress>
                        <Addr1>123 Test Road</Addr1>    
                        <City>Mt Pleasant</City>    
                        <State>MI</State>   
                        <PostalCode>48858</PostalCode>  
                    </VendorAddress>
                    <Email>support@consolibyte.com</Email>  
                </VendorAdd>
            </VendorAddRq>
        </QBXMLMsgsRq>';

// Send the request
$resp = $Gateway->qbxml($xml);

print($resp);


来源:https://stackoverflow.com/questions/17224853/connect-online-quickbook-to-my-php-website

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