Very shortly I will be required to do an integration between Quickbooks Desktop and a PHP website. I'm aware that there exists a PHP QuickBooks class that helps with integrating, but to my knowledge that only works when the PHP site is the one to initiate contact with the Desktop application. It's required of me that when a Purchase Order and/or Product is created on QuickBooks, it will automatically (and instantaneously) send the information over to my website using a REST API. Considering there will be multiple instances of QuickBooks Desktop that will be connected (we will allow customers to use a QuickBooks application that we will build), it is not practical to have to constantly check if ALL of those QuickBooks Desktop instances have any new Purchase Orders or Products that have been created since the last time we checked.
Is there a way to somehow add code to QuickBooks to send Purchase Orders and Products (upon creation) to my website using a REST API?
Thank you
QuickBooks itself doesn't really have any reliable method of catching events like you're talking about, and also doesn't have any way to then relay those events to an external REST API. So, you're not going to find exactly what you're looking for - it isn't possible.
With that said, you CAN get close by having an external application that polls QuickBooks periodically (as often as every few seconds) to grab new data from it, and then relays that data up to your REST API.
The easiest way to do this is via the Web Connector. It can poll as frequently as 1 minute, and is very capable of doing exactly what you're talking about. If you want to go with the Web Connector, your best bet is probably this open-source QuickBooks PHP DevKit (disclaimer: I'm the author). You could start with the Web Connector quick-start guide.
The harder way, but more flexible way is to write a custom QuickBooks SDK application that sits alongside QuickBooks, polls QuickBooks periodically, and relays that data up to your app. If you want to do this, you should check out the QuickBooks SDK - it has some C# and VB.NET examples in it which should prove useful.
Some specific notes:
but to my knowledge that only works when the PHP site is the one to initiate contact with the Desktop application.
Actually no - it only works when the Web Connector (which runs alongside QuickBooks) initiates the communication. But you can set it to run every 1 minute, which makes it pretty much constantly run and push data up to your app.
it will automatically
This is easily do-able with either the Web Connector or a custom SDK app.
(and instantaneously)
This isn't do-able. QuickBooks isn't even fast-enough performing to instantaneously relay data. You will never get instant data transfers from QuickBooks, so just forget about it now. (This is especially the case when you realize that there are lots of things in QuickBooks that can completely lock integrated applications out of even connecting to the data file - single-user mode, QuickBooks automatic updates, QuickBooks not being running, too many users in QuickBooks, etc.)
send the information over to my website using a REST API.
If using the Web Connector, your website receives the data, and you can then transform it and send it to your REST API.
If using a custom SDK app, you can write custom code to do that no problem.
it is not practical to have to constantly check if ALL of those QuickBooks Desktop instances have any new Purchase Orders or Products that have been created since the last time we checked.
Are you sure? We do this every day for thousands and thousands of people on ridiculously under-powered hardware.
Related
I have a PHP web application, I need to integrate SCORM with my application.I know that there is cloud option for integrating SCORM. But our requirement is that saving course details into our local DB.
Please help me.
You have a couple options for integrating SCORM content into standalone (web or otherwise) applications.
One is SCORMCloud (www.scorm.com), which gives you an integration API. They have PHP based plugins for both WordPress and Drupal, which you can use as a guide.
SCORMCloud has a couple of methods based whereby you can bring your learner data back into your database.
When a course launch is finished, SCORMCloud will redirect back to your website. At that point, you can hit the SCORMCloud API and fetch the results of your launch, and write that back to your database.
Our company (www.aura-software.com) produces an application integration framework for cloud based elearning sources (Vimeo, SCORMCloud, TinCan LRSs) called Bright CloudConnect. Depending on what your integration requirements were, it can perform the same functions and a few others. Enabling trackable elearning in existing applications is Bright's primary function.
I'm working on integrating a Magento store with an existing desktop Point of Sales software. My idea is that this desktop program would connect through Magento's REST API to gather the product list, inventory changes, etc., and it will also commit new products and other updates through the API endpoint.
The problem arises when I don't want the person in charge of the PoS know the API credentials or don't want to bother prompting for them. The best would be to set them up in a config file.
I thought about loading the API authorize page in the background and automatically post the credentials to the login form. But this looks like a nasty approach.
Any ideas?
Not a solution but some words of experience in this matter...
Magento's API can be slow and the user will wait forever for the task to finish especially if the server is under load. We use another application which uses the Magento's SOAP API which I built using java to handle all updates/downloads between magento and our POS. This way the user is not waiting on slow responses, or stopped by loss of connectivity.
We have adopted your queue approcach, and another reason for having 1 application with a queue is that it handles all updates from all users and Only Allows 1 Task To Execute At Once. You need to do this to avoid database locks. e.g. Two users modify a product and you get a table lock error and the update fails. You can also overload the server by flooding it with lots of single user requests to the server. We still have event driven processing as opposed to synch scripts by having our POS send messages to our local app instructing the app about the task and it simply queues the task for processing. Our application has no user interface what so ever and I run it as a System service on our server, with the user credentials stored in a config file.
I'm tasked with coming up with an e-commerce solution for a small, local business. My client uses Intuit/Quickbooks point of sale software. I've just discovered that Intuit has a series of PHP 5+ classes that allow interoperability (link for anyone else that may stumble on this: https://code.intuit.com/sf/sfmain/do/viewProject/projects.php_devkit).
The website will be hosted on shared hosting, so the two systems are split quite literally. Her desktop does have internet access.
So, my questions:
Is there a way for me to connect to her desktop via curl?
If so, is there a way for me to do it securely if I can't create a VPN on my host?
Now that I think about it, is there a VPN service I could use?
Any other security things I should be aware of?
Payment processing will be handled through Stripe (http://www.stripe.com). This is really just for inventory/order synching.
Your best bet is the QuickBooks Web Connector, along with that set of PHP classes you mentioned. See my specific comments below:
I've just discovered that Intuit has a series of PHP 5+ classes that allow interoperability (link for anyone else that may stumble on this: https://code.intuit.com/sf/sfmain/do/viewProject/projects.php_devkit).
It's worth noting that that library is NOT developed by Intuit (disclaimer - I'm the developer of that library). Intuit hosts our Subversion repository, but we're a separate company, and Intuit does not contribute to the actual PHP code. Intuit provides a Windows COM-based API only, we provide the actual PHP components so you can talk to QuickBooks from a remote server via the Web Connector, without the need to muck with COM.
We have a ton of information on our QuickBooks integration wiki which might be helpful - specifically the QuickBooks integration with PHP section and this overview of the QuickBooks Web Connector.
Consider grabbing the latest nightly build from the link you posted, and taking a look at this file:
* docs/example_web_connector_point_of_sale.php
It illustrates exchanging data between PHP and QuickBooks Point of Sale.
The website will be hosted on shared hosting, so the two systems are
split quite literally. Her desktop does have internet access.
This ^^^ is just fine, and a typical scenario. It's exactly what the Web Connector was designed for. The Web Connector essentially acts as a "dumb proxy" between a PHP SOAP service, and QuickBooks itself - it relays messages from your PHP app, over HTTP(S), to QuickBooks.
Is there a way for me to connect to her desktop via curl?
Not with Curl, no (though you could build one... but why reinvent the wheel?). The Web Connector is SOAP based, but your PHP components will be the SOAP server half, not the SOAP client half.
If so, is there a way for me to do it securely if I can't create a VPN on my host?
The Web Connector can use SSL via HTTPS to keep the data secure while in transit across the net.
Now that I think about it, is there a VPN service I could use?
Just buy an SSL certificate, it's easier. :-)
Any other security things I should be aware of?
Not beyond the typical web application security guidelines that you could find elsewhere on Stackoverflow.
If you're going to sync to a system like Quickbooks, don't do it real-time, do it in a batch process that is resilient to things like her desktop being turned off, the crappy office internet (compared to a datacenter) being slow or down, etc.
This ^^^ is great advice, and is exactly how the Web Connector works.
If you need real-time, Quickbooks running on a desktop is NOT the way to go.
In fact, if you need real-time, QuickBooks period is not the way to go. QuickBooks is a great small to medium business accounting software... but is slow and not reliable enough for consistent real-time communication. With that said... what you're talking about does not require real-time communication, so this shouldn't bother you.
Batching the orders isn't a problem, but how would I make even a batch process resilient?
The PHP code uses a queue with a status, so you can track what got processed, what didn't, what you got back from QuickBooks as a response ("Added a customer successfully!" vs. "Ooops, failed to add a customer because ..."), what error messages QuickBooks threw, etc. and then react appropriately with your code, or manually.
You won't need cron - the Web Connector can be scheduled to run, and it'll relay all errors and a ton of other information back to you so that you can handle errors, send out warnings, build reports to show to people about what failed/succeeded, etc.
I would like to write a Magento web-app working with Filemaker database.
Could I overwrite the database core files with code using filemaker php api?
What other options are there?
I wanted to do an interface between Filemaker and Magento database but cause of the EAV it's a nightmare to bind the Magento database with a filemaker database. If you want to do that you really need to use PHP in Filemaker and use the SOAP API of Magento if they are separated hosted.
You could too integrate the Magento core API into a PHP script with Filemaker API too if you host your Magento on the same web server or by installing a new Magento instance pointing to an availalble external database. You could do a local replication of the mysql database too on the Filemaker server.
To integrate Magento Core APi it's easy in a PHP file, you set the following:
<?php
require_once 'yourmagentoinstallation/path/app/Mage.php';
Mage::app('default'); // default can be replaced by your default store code
// You can use Magento code (model, EAV, singleton, block, etc)
...
?>
It's possible, there are different ways but I didn't find when I needed an out of the box solution.
It depends on what you mean by "integrate". I doubt you'll need to do something in the lines of "overwrite database core files". Most likely you'll need to update FileMaker when an order is placed and do the same thing to Magento when they get a stock update. It's quite likely that these two scenarios would have to be implemented in vastly different manner.
Here's what FileMaker can do. Its XML backend can readily accept GET and POST requests to the server. Their syntax is fairly advanced and you can find records, add, delete, and duplicate them, run FileMaker scripts, etc. It's nowhere near SQL, especially searching, but quite logical. The server responds in XML. Here's the manual (PDF).
The server can also accepts arbitrary requests sent to its PHP API. (It also has a XSLT API, but it's deprecated and is going to be removed.) The API then reshapes the request as it pleases, talks with the XML backend, and returns back the result. As I'm not a PHP expert, I'm not quite sure where the API is explained, but it must be somewhere here.
FileMaker itself (i.e. its desktop client or even the server) can use plug-ins to talk to web services. E.g. as the stock updates the desktop client can prepare and send requests to Magento API.
And FileMaker can access certain 'big' SQL databases directly. E.g. it can connect to a MySQL database and work with its tables very much like with its own. Maybe it would be unwise to allow free work with core Magento tables, but a carefully scripted updates look like a viable option.
The plug-in and direct connection are better left to FileMaker developers, while the XML and PHP (XSLT) APIs are pretty standard web stuff.
Productive Computing has done some work with Magento. It sounds like they are using external datasources to connect which would make for an overly excessive integration.
Productive Computing Blog
Our NRGship products use the Magento PHP API to pull order data and update order status post-shipment. In order to mirror this, you would need some PHP code server-side, and then use a plugin like Troi URL to invoke http requests to query and update record status.
Providing more information on your needs would allow for a more detailed response.
I use the JDBC driver that comes with Filemaker Pro and I have built a server app in Java that connects to filemaker through JDBC to auto insert data such as orders etc and have background tasks automate updates such as product updates and order status updates by getting data from filemaker through JDBC. The java server app then sends SOAP API requests off to Magento to handle the data exchange.
We have extended this further by having the server app listen for XML messages/commands on a socket so I can have real time integration to filemaker where needed. I then have a simple filemaker plugin I wrote using 24U Filemaker Plugin Template that sends small XML messages to the java server application which then issues an API call to magento accordingly. Filemaker waits for the server app response which gets returned and then filemaker continues the rest of the script that called the method.
It's a lot more elaborate than this in the sense it has a queue of tasks to perform so not to overload magento API, and we have a DB connection pool for the filemaker JDBC connections to save the overload of opening and closing connections. This works really really well, and we literally have the entirety of Magento integrated with filemaker and have produced many custom API modules for magento to achieve additional functionality which magento does not provide.
I was reading it's possible to create Java Plugins for java so in theory you could do away with the server app and simply create a filemaker plugin which has the magento API function calls built into it. If using V2 WSI Compliance mode for magento soap calls you could generate all the stub classes and methods using the JAXB web services plugin which is part of Netbeans which will save you days and days of work.
Looking at the Quickbooks API I only see options to sync users. I may just need to export the fields I need directly from the database? Just hoping someone had some scripts/templates to work with this already. I am not too worried about sync as long as the client could manually import web transactions at the beginning of the day
The QuickBooks SDK has the ability to import and export inventory items, including quantity on hand and cost information. Just to be clear, I speaking here about the classic SDK and not the Partner Platform. Using the SDK it is possible to connect to a QuickBooks online company using XML over SSL, or to a desktop company file (still the most popular option for most users) using XML or Intuit's QBFC framework, which is compatible with .NET.
There is no way to access the QuickBooks "database" directly. QODBC give you the ability to run SQL against QuickBooks company file data via ODBC, but it is implemented using the SDK. QODBC is the best way to get up and running fast with QuickBooks, and it's also great for custom reporting. But for most sync applications, the actual data access is a minor part of the overall scope, and the control that you get from going directly to the SDK and bypassing QODBC is worth it.
Most developers who have experience with QuickBooks have a library to help with common SDK tasks. There are also some offerings at code.intuit.com. In addition to library code, it also helps to understand the behavior of both QuickBooks and the SDK. The SDK is well documented and if you haven't visited the SDK section of the Intuit Developer site I would highly recommend it.